2019-07-21 08:08:58 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
|
|
|
|
Item {
|
|
|
|
property Item flickTarget: Item {}
|
|
|
|
|
2019-08-20 03:55:21 +10:00
|
|
|
|
2019-07-21 08:08:58 +10:00
|
|
|
function smartVerticalFlick(baseVelocity, fastMultiply=3) {
|
2019-07-21 08:28:00 +10:00
|
|
|
if (! flickTarget.interactive) { return }
|
2019-07-21 08:08:58 +10:00
|
|
|
|
2019-07-21 08:28:00 +10:00
|
|
|
baseVelocity = -baseVelocity
|
|
|
|
let vel = -flickTarget.verticalVelocity
|
|
|
|
let fast = (baseVelocity < 0 && vel < baseVelocity / 2) ||
|
|
|
|
(baseVelocity > 0 && vel > baseVelocity / 2)
|
2019-07-21 08:08:58 +10:00
|
|
|
|
|
|
|
flickTarget.flick(0, baseVelocity * (fast ? fastMultiply : 1))
|
|
|
|
}
|
|
|
|
|
2019-08-20 03:55:21 +10:00
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequences: settings.keys ? settings.keys.startDebugger : []
|
|
|
|
onActivated: if (debugMode) { py.call("APP.pdb") }
|
|
|
|
}
|
|
|
|
|
2019-07-25 07:26:40 +10:00
|
|
|
Shortcut {
|
|
|
|
sequences: settings.keys ? settings.keys.reloadConfig : []
|
2019-07-25 07:40:06 +10:00
|
|
|
onActivated: py.loadSettings(() => { mainUI.pressAnimation.start() })
|
2019-07-25 07:26:40 +10:00
|
|
|
}
|
|
|
|
|
2019-07-21 08:08:58 +10:00
|
|
|
Shortcut {
|
2019-07-25 07:05:27 +10:00
|
|
|
sequences: settings.keys ? settings.keys.scrollUp : []
|
2019-07-21 08:08:58 +10:00
|
|
|
onActivated: smartVerticalFlick(-335)
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
2019-07-25 07:05:27 +10:00
|
|
|
sequences: settings.keys ? settings.keys.scrollDown : []
|
2019-07-21 08:08:58 +10:00
|
|
|
onActivated: smartVerticalFlick(335)
|
|
|
|
}
|
|
|
|
|
2019-08-18 05:58:32 +10:00
|
|
|
Shortcut {
|
2019-08-20 03:55:21 +10:00
|
|
|
sequences: settings.keys ? settings.keys.focusSidePane : []
|
|
|
|
onActivated: mainUI.sidePane.forceActiveFocus()
|
2019-07-21 08:08:58 +10:00
|
|
|
}
|
2019-07-24 16:14:34 +10:00
|
|
|
|
2019-08-18 10:29:56 +10:00
|
|
|
Shortcut {
|
2019-08-20 03:09:05 +10:00
|
|
|
sequences: settings.keys ? settings.keys.goToPreviousRoom : []
|
|
|
|
onActivated: mainUI.sidePane.accountRoomList.previous()
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequences: settings.keys ? settings.keys.goToNextRoom : []
|
|
|
|
onActivated: mainUI.sidePane.accountRoomList.next()
|
2019-08-18 10:29:56 +10:00
|
|
|
}
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
/*
|
|
|
|
Shortcut {
|
|
|
|
sequence: "Ctrl+-"
|
|
|
|
onActivated: theme.fontScale = Math.max(0.1, theme.fontScale - 0.1)
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequence: "Ctrl++"
|
|
|
|
onActivated: theme.fontScale = Math.min(10, theme.fontScale + 0.1)
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequence: "Ctrl+="
|
|
|
|
onActivated: theme.fontScale = 1.0
|
|
|
|
}
|
|
|
|
*/
|
2019-07-21 08:08:58 +10:00
|
|
|
}
|