2019-07-21 08:08:58 +10:00
|
|
|
import QtQuick 2.12
|
2019-08-23 03:03:26 +10:00
|
|
|
import "Base"
|
|
|
|
import "utils.js" as Utils
|
2019-07-21 08:08:58 +10:00
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcutHandler {
|
2019-07-21 08:08:58 +10:00
|
|
|
property Item flickTarget: Item {}
|
|
|
|
|
2019-08-23 04:16:49 +10:00
|
|
|
// App
|
2019-08-20 03:55:21 +10:00
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
|
|
|
enabled: debugMode
|
|
|
|
sequences: settings.keys.startDebugger
|
|
|
|
onPressed: py.call("APP.pdb")
|
2019-07-21 08:08:58 +10:00
|
|
|
}
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
|
|
|
sequences: settings.keys.reloadConfig
|
|
|
|
onPressed: py.loadSettings(() => { mainUI.pressAnimation.start() })
|
2019-07-21 08:08:58 +10:00
|
|
|
}
|
2019-07-24 16:14:34 +10:00
|
|
|
|
2019-08-23 04:16:49 +10:00
|
|
|
// Page scrolling
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
|
|
|
sequences: settings.keys.scrollUp
|
|
|
|
onPressed: Utils.smartVerticalFlick(flickTarget, -335)
|
2019-08-23 04:16:49 +10:00
|
|
|
onHeld: pressed(event)
|
2019-08-20 04:05:59 +10:00
|
|
|
}
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
|
|
|
sequences: settings.keys.scrollDown
|
|
|
|
onPressed: Utils.smartVerticalFlick(flickTarget, 335)
|
2019-08-23 04:16:49 +10:00
|
|
|
onHeld: pressed(event)
|
2019-08-20 03:09:05 +10:00
|
|
|
}
|
|
|
|
|
2019-08-23 04:16:49 +10:00
|
|
|
// SidePane
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
2019-08-24 01:06:19 +10:00
|
|
|
enabled: mainUI.accountsPresent
|
2019-08-23 03:03:26 +10:00
|
|
|
sequences: settings.keys.focusSidePane
|
|
|
|
onPressed: mainUI.sidePane.setFocus()
|
2019-08-18 10:29:56 +10:00
|
|
|
}
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
2019-08-24 01:06:19 +10:00
|
|
|
enabled: mainUI.accountsPresent
|
2019-08-23 03:03:26 +10:00
|
|
|
sequences: settings.keys.clearRoomFilter
|
|
|
|
onPressed: mainUI.sidePane.paneToolBar.roomFilter = ""
|
2019-08-20 04:28:12 +10:00
|
|
|
}
|
|
|
|
|
2019-08-24 01:02:22 +10:00
|
|
|
HShortcut {
|
2019-08-24 01:06:19 +10:00
|
|
|
enabled: mainUI.accountsPresent
|
2019-08-24 01:02:22 +10:00
|
|
|
sequences: settings.keys.addNewAccount
|
|
|
|
onPressed: mainUI.sidePane.paneToolBar.addAccountButton.clicked()
|
|
|
|
}
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
2019-08-24 01:06:19 +10:00
|
|
|
enabled: mainUI.accountsPresent
|
2019-08-23 03:03:26 +10:00
|
|
|
sequences: settings.keys.goToPreviousRoom
|
|
|
|
onPressed: mainUI.sidePane.accountRoomList.previous()
|
2019-08-23 04:16:49 +10:00
|
|
|
onHeld: pressed(event)
|
2019-07-24 16:14:34 +10:00
|
|
|
}
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
2019-08-24 01:06:19 +10:00
|
|
|
enabled: mainUI.accountsPresent
|
2019-08-23 03:03:26 +10:00
|
|
|
sequences: settings.keys.goToNextRoom
|
|
|
|
onPressed: mainUI.sidePane.accountRoomList.next()
|
2019-08-23 04:16:49 +10:00
|
|
|
onHeld: pressed(event)
|
2019-07-24 16:14:34 +10:00
|
|
|
}
|
|
|
|
|
2019-08-23 03:03:26 +10:00
|
|
|
HShortcut {
|
2019-08-24 01:06:19 +10:00
|
|
|
enabled: mainUI.accountsPresent
|
2019-08-23 03:03:26 +10:00
|
|
|
sequences: settings.keys.toggleCollapseAccount
|
|
|
|
onPressed: mainUI.sidePane.accountRoomList.toggleCollapseAccount()
|
2019-07-24 16:14:34 +10:00
|
|
|
}
|
2019-07-21 08:08:58 +10:00
|
|
|
}
|