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
|
||||
- Refactor EventList.qml
|
||||
- Refactor `InviteBanner`/`LeftBanner`
|
||||
- Implement different delegate for different types of events in QML, instead
|
||||
of having only one doing everything with untranslatable content texts
|
||||
from Python
|
||||
|
|
|
@ -76,12 +76,19 @@ Rectangle {
|
|||
|
||||
HButton {
|
||||
id: button
|
||||
|
||||
readonly property bool shouldFocus:
|
||||
banner.visible && model.index === 0
|
||||
|
||||
text: modelData.text
|
||||
icon.name: modelData.iconName
|
||||
icon.color: modelData.iconColor || theme.icons.colorize
|
||||
onClicked: buttonCallbacks[modelData.name](button)
|
||||
|
||||
Layout.preferredHeight: theme.baseElementsHeight
|
||||
|
||||
onShouldFocusChanged:
|
||||
if (shouldFocus) forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user