Add Keymap Cheat Sheet: a bar cheat sheet drawn from a keymap repo
Reads keymap-drawer YAML (or a ZMK .keymap / QMK keymap.json) from a git repo, default xnmrph/corne. Watches it with git ls-remote and redraws when the keymap changes; waits for the repo's CI redraw after a .keymap push. Overview puts four layers in the key corners; each layer also has its own tab; combos and conditional layers are listed underneath. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f2dc91559
commit
9efb66fe5e
8 files changed
+1971
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Ui
|
||||
|
||||
// Bar button for the keymap cheat sheet. Click opens the sheet under it; the
|
||||
// icon lights up when the keymap changed since you last looked.
|
||||
BarWidget {
|
||||
id: root
|
||||
moduleName: "mx-keymap"
|
||||
|
||||
readonly property var service: bar && bar.shell ? bar.shell.serviceFor(moduleName) : null
|
||||
readonly property bool opened: panel.opened
|
||||
readonly property bool popoutSwitchClosing: panel.popoutSwitchClosing
|
||||
|
||||
implicitWidth: button.implicitWidth
|
||||
implicitHeight: button.implicitHeight
|
||||
|
||||
function open() { panel.open() }
|
||||
function close() { panel.close() }
|
||||
function toggle() { panel.opened ? panel.close() : panel.open() }
|
||||
function closeForPopoutSwitch() { panel.closeForPopoutSwitch() }
|
||||
|
||||
onServiceChanged: if (service) service.configure(settings)
|
||||
onSettingsChanged: if (service) service.configure(settings)
|
||||
|
||||
BarIconButton {
|
||||
id: button
|
||||
anchors.fill: parent
|
||||
bar: root.bar
|
||||
text: ""
|
||||
tooltipText: root.service && root.service.unseen ? "Keymap: updated" : "Keymap"
|
||||
active: !!root.service && root.service.unseen
|
||||
onPressed: function(mouseButton) {
|
||||
if (mouseButton === Qt.LeftButton) root.toggle()
|
||||
else if (mouseButton === Qt.RightButton && root.service) root.service.refresh(true)
|
||||
}
|
||||
}
|
||||
|
||||
SheetPanel {
|
||||
id: panel
|
||||
bar: root.bar
|
||||
moduleName: root.moduleName
|
||||
settings: root.settings
|
||||
anchorItem: button
|
||||
service: root.service
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user