Fix up/down key handling for account context menu

- Press down while focusing status field or apply icon:
  focus the online menu item

- Press up while focusing online menu item: focus status field
This commit is contained in:
miruka 2020-07-10 14:15:47 -04:00
parent 8557c79e12
commit b6b02ee6a7

View File

@ -13,7 +13,7 @@ HMenu {
property string presence property string presence
property string statusMsg property string statusMsg
signal wentToAccountPage() signal wentToAccountPage()
@ -33,6 +33,8 @@ HMenu {
label.text: qsTr("Status message:") label.text: qsTr("Status message:")
label.horizontalAlignment: Qt.AlignHCenter label.horizontalAlignment: Qt.AlignHCenter
Keys.onDownPressed: onlineButton.forceActiveFocus()
HRowLayout { HRowLayout {
width: parent.width width: parent.width
@ -70,10 +72,13 @@ HMenu {
HMenuSeparator { } HMenuSeparator { }
HMenuItem { HMenuItem {
id: onlineButton
icon.name: "presence-online" icon.name: "presence-online"
icon.color: theme.controls.presence.online icon.color: theme.controls.presence.online
text: qsTr("Online") text: qsTr("Online")
onTriggered: setPresence("online") onTriggered: setPresence("online")
Keys.onUpPressed: statusText.forceActiveFocus()
} }
HMenuItem { HMenuItem {