diff --git a/mx-keymap/SheetPanel.qml b/mx-keymap/SheetPanel.qml index bf229b0..b5e20db 100644 --- a/mx-keymap/SheetPanel.qml +++ b/mx-keymap/SheetPanel.qml @@ -32,7 +32,8 @@ Panel { // Board geometry in key units. readonly property real unitsW: layoutKeys.reduce((m, k) => Math.max(m, k.x + 1), 0) readonly property real unitsH: layoutKeys.reduce((m, k) => Math.max(m, k.y + 1), 0) + 0.2 - readonly property real unit: Math.min(Style.space(66), unitsW > 0 ? (card.availableCardWidth - card.padding * 2) / unitsW : Style.space(66)) + readonly property real keySize: Style.space(Math.max(36, Math.min(120, Number(setting("keySize", 66)) || 66))) + readonly property real unit: Math.min(keySize, unitsW > 0 ? (card.availableCardWidth - card.padding * 2) / unitsW : keySize) readonly property real gap: Math.max(3, Math.round(unit * 0.07)) readonly property int cardWidth: Math.max(Style.space(560), Math.ceil(unitsW * unit)) + card.padding * 2 @@ -495,7 +496,7 @@ Panel { Column { width: parent.width spacing: Style.spacing.lg - visible: root.combos.length > 0 || root.layerCombos.length > 0 + visible: root.setting("showCombos", true) !== false && (root.combos.length > 0 || root.layerCombos.length > 0) Rectangle { width: parent.width @@ -655,6 +656,7 @@ Panel { Text { width: parent.width + visible: root.setting("showHints", true) !== false horizontalAlignment: Text.AlignRight text: "Arrow keys or 0–" + Math.min(9, root.layers.length) + " switch layers · R refresh · checks the repo every " + (root.service ? root.service.checkMinutes : 2) + " min" color: Qt.alpha(Color.foreground, 0.32) diff --git a/mx-keymap/manifest.json b/mx-keymap/manifest.json index 48913f3..cb7ed21 100644 --- a/mx-keymap/manifest.json +++ b/mx-keymap/manifest.json @@ -26,14 +26,20 @@ "branch": "", "path": "", "checkMinutes": 2, - "startView": "overview" + "startView": "overview", + "keySize": 66, + "showCombos": true, + "showHints": true }, "schema": [ { "key": "background", "label": "Background", "description": "pill: the button sits on a round pill; transparent: just the icon.", - "choices": ["pill", "transparent"], + "choices": [ + "pill", + "transparent" + ], "defaultValue": "pill" }, { @@ -60,16 +66,46 @@ { "key": "checkMinutes", "type": "integer", - "label": "Check for changes every (minutes)", + "label": "Check for changes every", "description": "A git ls-remote, so frequent checks are cheap. The sheet also checks when you open it.", - "defaultValue": 2 + "defaultValue": 2, + "min": 1, + "max": 60, + "unit": "min" }, { "key": "startView", "label": "Opens on", "description": "Overview shows every layer on one keyboard; Base shows the first layer on its own.", - "choices": ["overview", "base"], + "choices": [ + "overview", + "base" + ], "defaultValue": "overview" + }, + { + "key": "keySize", + "type": "integer", + "label": "Key size", + "description": "Size of one key on the sheet. It shrinks by itself when the screen is too narrow.", + "min": 44, + "max": 96, + "unit": "px", + "defaultValue": 66 + }, + { + "key": "showCombos", + "type": "boolean", + "label": "Show combos", + "description": "List the combos (and layers you reach by holding two) under the keyboard.", + "defaultValue": true + }, + { + "key": "showHints", + "type": "boolean", + "label": "Show keyboard hints", + "description": "The line at the bottom with the keys that switch layers.", + "defaultValue": true } ] }