forked from Shinonome/dots-hyprland
cheatsheet: switch on all monitors; add tab cycle (#637)
This commit is contained in:
@@ -118,18 +118,26 @@ export default (id) => {
|
||||
clickCloseRegion({ name: 'cheatsheet' }),
|
||||
],
|
||||
setup: (self) => self.on('key-press-event', (widget, event) => { // Typing
|
||||
// Whole sheet
|
||||
if (checkKeybind(event, userOptions.keybinds.cheatsheet.nextTab))
|
||||
sheetContents[id].nextTab();
|
||||
sheetContents.forEach(tab => tab.nextTab())
|
||||
else if (checkKeybind(event, userOptions.keybinds.cheatsheet.prevTab))
|
||||
sheetContents[id].prevTab();
|
||||
sheetContents.forEach(tab => tab.prevTab())
|
||||
else if (checkKeybind(event, userOptions.keybinds.cheatsheet.cycleTab))
|
||||
sheetContents.forEach(tab => tab.cycleTab())
|
||||
// Keybinds
|
||||
if (sheets.attribute.names[sheets.attribute.shown.value] == 'Keybinds') { // If Keybinds tab is focused
|
||||
if (checkKeybind(event, userOptions.keybinds.cheatsheet.keybinds.nextTab)) {
|
||||
const toSwitchTab = sheets.attribute.children[sheets.attribute.shown.value];
|
||||
toSwitchTab.nextTab();
|
||||
sheetContents.forEach((sheet) => {
|
||||
const toSwitchTab = sheet.attribute.children[sheet.attribute.shown.value];
|
||||
toSwitchTab.nextTab();
|
||||
})
|
||||
}
|
||||
else if (checkKeybind(event, userOptions.keybinds.cheatsheet.keybinds.prevTab)) {
|
||||
const toSwitchTab = sheets.attribute.children[sheets.attribute.shown.value];
|
||||
toSwitchTab.prevTab();
|
||||
sheetContents.forEach((sheet) => {
|
||||
const toSwitchTab = sheet.attribute.children[sheet.attribute.shown.value];
|
||||
toSwitchTab.prevTab();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user