forked from Shinonome/dots-hyprland
left sidebar: add keybinds
This commit is contained in:
@@ -16,7 +16,7 @@ Scope { // Scope
|
|||||||
id: root
|
id: root
|
||||||
property int sidebarWidth: Appearance.sizes.sidebarWidth
|
property int sidebarWidth: Appearance.sizes.sidebarWidth
|
||||||
property int sidebarPadding: 15
|
property int sidebarPadding: 15
|
||||||
property var tabButtonList: [{"icon": "neurology", "name": qsTr("LLMs")}, {"icon": "flare", "name": qsTr("Waifus")}]
|
property var tabButtonList: [{"icon": "neurology", "name": qsTr("Intelligence")}, {"icon": "flare", "name": qsTr("Waifus")}]
|
||||||
|
|
||||||
Variants { // Window repeater
|
Variants { // Window repeater
|
||||||
id: sidebarVariants
|
id: sidebarVariants
|
||||||
@@ -81,11 +81,21 @@ Scope { // Scope
|
|||||||
height: parent.height - Appearance.sizes.hyprlandGapsOut * 2
|
height: parent.height - Appearance.sizes.hyprlandGapsOut * 2
|
||||||
color: Appearance.colors.colLayer0
|
color: Appearance.colors.colLayer0
|
||||||
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
|
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
|
||||||
|
focus: sidebarRoot.visible
|
||||||
|
|
||||||
Keys.onPressed: (event) => {
|
Keys.onPressed: (event) => {
|
||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
sidebarRoot.visible = false;
|
sidebarRoot.visible = false;
|
||||||
}
|
}
|
||||||
|
if (event.modifiers === Qt.ControlModifier) {
|
||||||
|
console.log("Control pressed")
|
||||||
|
if (event.key === Qt.Key_PageDown) {
|
||||||
|
sidebarRoot.currentTab = Math.min(sidebarRoot.currentTab + 1, root.tabButtonList.length - 1)
|
||||||
|
} else if (event.key === Qt.Key_PageUp) {
|
||||||
|
sidebarRoot.currentTab = Math.max(sidebarRoot.currentTab - 1, 0)
|
||||||
|
}
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|||||||
Reference in New Issue
Block a user