The Shortcuts settings page answers "how do I change this", which is worth opening a window for. This answers the other question, the one you have with your hands already on the keyboard, so it is an overlay on SUPER + / and the same key closes it. It reads Keybinds.grouped() rather than a written-down list, so a shortcut rebound in Settings shows its new chord here with nothing kept in sync. A cheatsheet that lies is worse than none: it gets consulted exactly when somebody does not already know. Three columns, balanced by how many shortcuts each category holds. The first attempt used a Flow, which wraps into as many columns as it likes and made 120 binds across six uneven categories unreadable; it also sized the card from a child that filled it, which is a circular binding and produced a card taller than the display with its contents running off the bottom. Both were found by looking at it rather than by a test, which is the argument for looking at it. Fixes a real bug on the way past: luaChord and formatChord appended the key unconditionally, so the window switcher's modifier-only release bind became "SUPER + " with a dangling separator. That matched neither the chord keybinds.lua binds nor the one an override is keyed by, so that bind could never be rebound and had no category -- it was sitting in a seventh group of its own, which is how it was noticed.
67 lines
1.9 KiB
QML
67 lines
1.9 KiB
QML
// One category of shortcuts, as a column.
|
|
//
|
|
// Deliberately plain: a chord on the left, what it does on the right, and no
|
|
// separators between rows. The cheatsheet is read at a glance while a key is
|
|
// held, so anything that draws the eye away from the two columns is in the way.
|
|
|
|
import QtQuick
|
|
import qs.config
|
|
|
|
Column {
|
|
id: root
|
|
|
|
required property string name
|
|
required property var binds
|
|
|
|
spacing: 3
|
|
|
|
Text {
|
|
text: root.name
|
|
color: Theme.accent
|
|
font.family: Theme.fontFamily
|
|
font.pixelSize: Theme.fontSizeSmall
|
|
font.weight: Font.DemiBold
|
|
font.capitalization: Font.AllUppercase
|
|
font.letterSpacing: 0.6
|
|
bottomPadding: 5
|
|
}
|
|
|
|
Repeater {
|
|
model: root.binds
|
|
|
|
Item {
|
|
required property var modelData
|
|
|
|
width: root.width
|
|
height: chord.implicitHeight + 5
|
|
|
|
// The chord is monospaced and tabular so a column of them lines up
|
|
// rather than jittering with the width of each key name. This is
|
|
// the one place in the shell where a monospaced face is correct:
|
|
// it is showing keys, not prose.
|
|
Text {
|
|
id: chord
|
|
width: 168
|
|
text: modelData.chord
|
|
color: Theme.fg
|
|
font.family: Theme.fontMono
|
|
font.pixelSize: Theme.fontSizeSmall
|
|
font.features: Theme.tabularFigures
|
|
elide: Text.ElideRight
|
|
}
|
|
|
|
Text {
|
|
anchors.left: chord.right
|
|
anchors.leftMargin: 10
|
|
anchors.right: parent.right
|
|
anchors.verticalCenter: chord.verticalCenter
|
|
text: modelData.description
|
|
color: Theme.fgDim
|
|
font.family: Theme.fontFamily
|
|
font.pixelSize: Theme.fontSizeSmall
|
|
elide: Text.ElideRight
|
|
}
|
|
}
|
|
}
|
|
}
|