Support menu key for room/member lists currentItem

Allow opening context menu for AccountDelegate, RoomDelegate and
MemberDelegate by selecting an item with up/down (when focusing filter
field) and pressing the menu key.
This commit is contained in:
miruka 2020-07-09 21:40:33 -04:00
parent 10eeb662af
commit 08f15b6a01
2 changed files with 7 additions and 0 deletions

View File

@ -55,6 +55,10 @@ Rectangle {
if (window.settings.clearRoomFilterOnEnter) text = "" if (window.settings.clearRoomFilterOnEnter) text = ""
} }
Keys.onMenuPressed:
if (roomList.currentItem)
roomList.currentItem.doRightClick(false)
Keys.onEscapePressed: { Keys.onEscapePressed: {
mainPane.toggleFocus() mainPane.toggleFocus()
if (window.settings.clearRoomFilterOnEscape) text = "" if (window.settings.clearRoomFilterOnEscape) text = ""

View File

@ -43,6 +43,9 @@ HColumnLayout {
currentItem.leftClicked() currentItem.leftClicked()
currentItem.clicked() currentItem.clicked()
} }
Keys.onMenuPressed:
if (currentItem) currentItem.doRightClick(false)
} }
Layout.fillWidth: true Layout.fillWidth: true