Comments only, no code changes. Replaces vague or personified phrasing with explicit statements of what the code does and why, uses bullet lists for multi-case behavior, and fixes the settings path in WindowSettings.h (~/.config/sloposk/sloposk.conf). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
945 B
QML
41 lines
945 B
QML
import QtQuick
|
|
|
|
// On/off button in the grab bar, highlighted while on.
|
|
// Child items form the icon and should use `foreground` as their color.
|
|
Item {
|
|
id: toggle
|
|
|
|
required property string label
|
|
property bool checked: false
|
|
readonly property color foreground: checked ? Theme.accentText : (tap.pressed ? Theme.text : Theme.handle)
|
|
default property alias icon: iconArea.data
|
|
signal toggled(bool checked)
|
|
|
|
implicitWidth: 34
|
|
implicitHeight: 22
|
|
Accessible.role: Accessible.CheckBox
|
|
Accessible.name: label
|
|
Accessible.checked: checked
|
|
|
|
Rectangle {
|
|
anchors.centerIn: parent
|
|
width: 30
|
|
height: 20
|
|
radius: 5
|
|
color: Theme.accent
|
|
visible: toggle.checked
|
|
}
|
|
|
|
Item {
|
|
id: iconArea
|
|
anchors.centerIn: parent
|
|
width: 20
|
|
height: 14
|
|
}
|
|
|
|
TapHandler {
|
|
id: tap
|
|
onTapped: toggle.toggled(!toggle.checked)
|
|
}
|
|
}
|