Refactor global shortcuts, simplify debug consoles

- Move out all shortcuts from their central file to the component they
  actually belong to

- Get rid of DebugConsoleLoader and the multiple consoles handling mess,
  have only one global console
This commit is contained in:
miruka
2020-03-28 07:18:00 -04:00
parent af2d5f8cba
commit 1038678a2f
24 changed files with 268 additions and 401 deletions

View File

@@ -0,0 +1,39 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import "../Base"
HQtObject {
property Item flickable: parent
HShortcut {
sequences: window.settings.keys.scrollUp
onActivated: utils.flickPages(flickable, -1 / 10)
}
HShortcut {
sequences: window.settings.keys.scrollDown
onActivated: utils.flickPages(flickable, 1 / 10)
}
HShortcut {
sequences: window.settings.keys.scrollPageUp
onActivated: utils.flickPages(flickable, -1)
}
HShortcut {
sequences: window.settings.keys.scrollPageDown
onActivated: utils.flickPages(flickable, 1)
}
HShortcut {
sequences: window.settings.keys.scrollToTop
onActivated: utils.flickToTop(flickable)
}
HShortcut {
sequences: window.settings.keys.scrollToBottom
onActivated: utils.flickToBottom(flickable)
}
}

View File

@@ -0,0 +1,23 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import "../Base"
HQtObject {
property Item container: parent
HShortcut {
sequences: window.settings.keys.previousTab
onActivated: container.setCurrentIndex(
utils.numberWrapAt(container.currentIndex - 1, container.count),
)
}
HShortcut {
sequences: window.settings.keys.nextTab
onActivated: container.setCurrentIndex(
utils.numberWrapAt(container.currentIndex + 1, container.count),
)
}
}