Join/LeftBanner: auto keyboard-focus first button
This commit is contained in:
parent
78acb51220
commit
6d26ac9006
1
TODO.md
1
TODO.md
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
- General change/upload avatar component for account and room settings
|
- General change/upload avatar component for account and room settings
|
||||||
- Refactor EventList.qml
|
- Refactor EventList.qml
|
||||||
|
- Refactor `InviteBanner`/`LeftBanner`
|
||||||
- Implement different delegate for different types of events in QML, instead
|
- Implement different delegate for different types of events in QML, instead
|
||||||
of having only one doing everything with untranslatable content texts
|
of having only one doing everything with untranslatable content texts
|
||||||
from Python
|
from Python
|
||||||
|
@ -76,12 +76,19 @@ Rectangle {
|
|||||||
|
|
||||||
HButton {
|
HButton {
|
||||||
id: button
|
id: button
|
||||||
|
|
||||||
|
readonly property bool shouldFocus:
|
||||||
|
banner.visible && model.index === 0
|
||||||
|
|
||||||
text: modelData.text
|
text: modelData.text
|
||||||
icon.name: modelData.iconName
|
icon.name: modelData.iconName
|
||||||
icon.color: modelData.iconColor || theme.icons.colorize
|
icon.color: modelData.iconColor || theme.icons.colorize
|
||||||
onClicked: buttonCallbacks[modelData.name](button)
|
onClicked: buttonCallbacks[modelData.name](button)
|
||||||
|
|
||||||
Layout.preferredHeight: theme.baseElementsHeight
|
Layout.preferredHeight: theme.baseElementsHeight
|
||||||
|
|
||||||
|
onShouldFocusChanged:
|
||||||
|
if (shouldFocus) forceActiveFocus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user