- Replace ModComboBox with Ctrl/Shift/Alt checkboxes for KO mods - Build HID bitmask from checkboxes (Ctrl=0x01, Shift=0x02, Alt=0x04) - Add DarkCheckbox component (Dracula theme) - Descriptive label: "When you press [From] key, output [To] key instead" - Read all KO fields from properties (no args in callback) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.2 KiB
Text
45 lines
1.2 KiB
Text
import { Theme } from "../theme.slint";
|
|
|
|
export component DarkCheckbox inherits Rectangle {
|
|
in property <string> text;
|
|
in-out property <bool> checked: false;
|
|
|
|
height: 24px;
|
|
min-width: box.width + label.preferred-width + 10px;
|
|
|
|
HorizontalLayout {
|
|
spacing: 4px;
|
|
alignment: start;
|
|
|
|
box := Rectangle {
|
|
width: 16px;
|
|
height: 16px;
|
|
y: (parent.height - self.height) / 2;
|
|
border-radius: 3px;
|
|
border-width: 1px;
|
|
border-color: root.checked ? Theme.accent-purple : Theme.button-border;
|
|
background: root.checked ? Theme.accent-purple : Theme.button-bg;
|
|
|
|
Text {
|
|
text: root.checked ? "v" : "";
|
|
color: #282a36;
|
|
font-size: 11px;
|
|
font-weight: 700;
|
|
horizontal-alignment: center;
|
|
vertical-alignment: center;
|
|
}
|
|
}
|
|
|
|
label := Text {
|
|
text: root.text;
|
|
color: Theme.fg-primary;
|
|
font-size: 11px;
|
|
vertical-alignment: center;
|
|
}
|
|
}
|
|
|
|
TouchArea {
|
|
clicked => { root.checked = !root.checked; }
|
|
mouse-cursor: pointer;
|
|
}
|
|
}
|