Add keyboard navigation for account device list
Enter/Return/Menu: open device menu Space: toggle check device Escape: uncheck all Alt+R/F5: refresh device list Alt+S/Delete: sign out checked or all sessions
This commit is contained in:
parent
612ded755a
commit
099c20c138
2
TODO.md
2
TODO.md
|
@ -1,6 +1,5 @@
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
- composer menu?
|
|
||||||
- fix members not synced bug
|
- fix members not synced bug
|
||||||
- fix local unread counters order
|
- fix local unread counters order
|
||||||
- fix highlight when logging in to new account
|
- fix highlight when logging in to new account
|
||||||
|
@ -57,7 +56,6 @@
|
||||||
|
|
||||||
- Show scrollbars for a few seconds if there's content to scroll on when
|
- Show scrollbars for a few seconds if there's content to scroll on when
|
||||||
opening a page or popup
|
opening a page or popup
|
||||||
- Device list keyboard navigation
|
|
||||||
- Device IP geolocation
|
- Device IP geolocation
|
||||||
- Can rooms but left with a reason?
|
- Can rooms but left with a reason?
|
||||||
|
|
||||||
|
|
|
@ -337,6 +337,9 @@ class UISettings(JSONDataFile):
|
||||||
"forgetRoom": ["Alt+Shift+Escape"],
|
"forgetRoom": ["Alt+Shift+Escape"],
|
||||||
|
|
||||||
"toggleFocusRoomPane": ["Alt+R"],
|
"toggleFocusRoomPane": ["Alt+R"],
|
||||||
|
|
||||||
|
"refreshDevices": ["Alt+R", "F5"],
|
||||||
|
"signOutCheckedOrAllDevices": ["Alt+S", "Delete"],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,8 @@ HColumnPage {
|
||||||
|
|
||||||
loadFuture = null
|
loadFuture = null
|
||||||
deviceList.sectionItemCounts = getSectionItemCounts()
|
deviceList.sectionItemCounts = getSectionItemCounts()
|
||||||
|
|
||||||
|
if (! deviceList.currentItem) deviceList.currentIndex = 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,12 +99,14 @@ HColumnPage {
|
||||||
|
|
||||||
footer: ButtonLayout {
|
footer: ButtonLayout {
|
||||||
OtherButton {
|
OtherButton {
|
||||||
|
id: refreshButton
|
||||||
text: qsTr("Refresh")
|
text: qsTr("Refresh")
|
||||||
icon.name: "device-refresh-list"
|
icon.name: "device-refresh-list"
|
||||||
onClicked: page.loadDevices()
|
onClicked: page.loadDevices()
|
||||||
}
|
}
|
||||||
|
|
||||||
OtherButton {
|
OtherButton {
|
||||||
|
id: signOutCheckedButton
|
||||||
enabled: deviceList.model.count > 0
|
enabled: deviceList.model.count > 0
|
||||||
text:
|
text:
|
||||||
deviceList.selectedCount === 0 ?
|
deviceList.selectedCount === 0 ?
|
||||||
|
@ -118,6 +122,8 @@ HColumnPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keys.forwardTo: [deviceList]
|
||||||
|
|
||||||
|
|
||||||
HListView {
|
HListView {
|
||||||
id: deviceList
|
id: deviceList
|
||||||
|
@ -149,6 +155,22 @@ HColumnPage {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
Keys.onEscapePressed: uncheckAll()
|
||||||
|
Keys.onSpacePressed: if (currentItem) toggleCheck(currentIndex)
|
||||||
|
Keys.onEnterPressed: if (currentItem) currentItem.openMenu(false)
|
||||||
|
Keys.onReturnPressed: Keys.onEnterPressed(event)
|
||||||
|
Keys.onMenuPressed: Keys.onEnterPressed(event)
|
||||||
|
|
||||||
|
HShortcut {
|
||||||
|
sequences: window.settings.keys.refreshDevices
|
||||||
|
onActivated: refreshButton.clicked()
|
||||||
|
}
|
||||||
|
|
||||||
|
HShortcut {
|
||||||
|
sequences: window.settings.keys.signOutCheckedOrAllDevices
|
||||||
|
onActivated: signOutCheckedButton.clicked()
|
||||||
|
}
|
||||||
|
|
||||||
FlickShortcuts {
|
FlickShortcuts {
|
||||||
flickable: deviceList
|
flickable: deviceList
|
||||||
active:
|
active:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user