Add tab navigation shortcuts (for AddChat)
This commit is contained in:
parent
484e9e595d
commit
f2ab84c754
@ -130,6 +130,9 @@ class UISettings(JSONConfigFile):
|
||||
"scrollToBottom":
|
||||
["Alt+Ctrl+Shift+Down", "Alt+Ctrl+Shift+J", "End"],
|
||||
|
||||
"previousTab": ["Alt+Shift+Left", "Alt+Shift+H"],
|
||||
"nextTab": ["Alt+Shift+Right", "Alt+Shift+L"],
|
||||
|
||||
"focusSidePane": ["Alt+S"],
|
||||
"clearRoomFilter": ["Alt+Shift+S"],
|
||||
"accountSettings": ["Alt+A"],
|
||||
|
@ -26,6 +26,7 @@ HPage {
|
||||
HTabBar {
|
||||
id: tabBar
|
||||
currentIndex: 0
|
||||
Component.onCompleted: shortcuts.tabsTarget = this
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
@ -1,11 +1,19 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "Base"
|
||||
import "utils.js" as Utils
|
||||
|
||||
HShortcutHandler {
|
||||
// Flickable or ListView that should be affected by scroll shortcuts
|
||||
property Item flickTarget
|
||||
|
||||
// TabBar that should be affected by tab navigation shortcuts
|
||||
property TabBar tabsTarget
|
||||
|
||||
// DebugConsole that should be affected by console shortcuts
|
||||
property DebugConsole debugConsole
|
||||
|
||||
|
||||
// App
|
||||
|
||||
HShortcut {
|
||||
@ -84,6 +92,25 @@ HShortcutHandler {
|
||||
}
|
||||
|
||||
|
||||
// Tab navigation
|
||||
|
||||
HShortcut {
|
||||
enabled: tabsTarget
|
||||
sequences: settings.keys.previousTab
|
||||
onPressed: tabsTarget.setCurrentIndex(
|
||||
Utils.numberWrapAt(tabsTarget.currentIndex - 1, tabsTarget.count),
|
||||
)
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
enabled: tabsTarget
|
||||
sequences: settings.keys.nextTab
|
||||
onPressed: tabsTarget.setCurrentIndex(
|
||||
Utils.numberWrapAt(tabsTarget.currentIndex + 1, tabsTarget.count),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// SidePane
|
||||
|
||||
HShortcut {
|
||||
|
Loading…
Reference in New Issue
Block a user