Stage 3 and 4 of docs/superpowers/plans/2026-08-17-panama-cohesion.md. Add SettingsPage plus ToggleRow, SliderRow, ChoiceRow, ActionRow, and TextRow. A row names a schema key and needs nothing else: label, detail, range, and unit come from PreferenceSchema, and writes go through SystemSettings.commitPreference, which routes compositor-backed keys through apply-and-verify and local keys straight to the store. The page scaffold that was copy-pasted eleven times is now one component. Rebuild Appearance around a live preview of the real desktop, scaled by the ratio between the preview and the actual monitor so a 10px gap on a 4500px display looks as small as it is. Rebuild Desktop & Dock and Input & Shortcuts on the shared rows, replacing the read-only text that stood in for controls that were merely expensive to add. Generate the shortcut list from hyprctl binds. The page held a hand-typed nineteen entries against a real keymap of a hundred and thirteen; it could not show the rest and went stale whenever a bind changed. Every bind now carries its own description -- backfilled for the twenty-nine that lacked one -- and keybinds-contract.sh fails if any bind lacks one, since undescribed binds are dropped from the page. Make Restore defaults span every store Panama owns. Resetting only the schema store left the Home accessory arrangement customised while claiming to restore defaults, which is worse than no reset because it is silent. Done through HomePreferences' existing public aliases rather than a new API. Four defects found while building: cursor:inactive_timeout is answered by getoption as float, not int. A wrong readAs does not fail loudly; it makes every write to that key look rejected, and the user saw an error for a change that worked. schema-hypr-shape-contract.sh now checks all 23 mapped options against the running compositor. The Settings window is tiled, so implicitWidth is only a hint and rows must survive roughly 400px. SliderRow stacks its control under the label below 520px. Binding an anchor to undefined to switch layouts does not reliably release it. Both row layouts are positioned explicitly. Concurrent compositor writes are queued and merged rather than refused. The startup replay of every compositor-backed preference routinely overlaps a UI change, and refusing left the store and the compositor disagreeing. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
99 lines
3.4 KiB
QML
99 lines
3.4 KiB
QML
// An enum setting, bound to a schema key by name.
|
|
//
|
|
// ChoiceRow { setting: "vrrPolicy" }
|
|
//
|
|
// The options are the schema's, so a row can never offer a value the store
|
|
// would reject. Rendered as a segmented control rather than a dropdown: every
|
|
// choice here has two or three options, and showing them all is both faster to
|
|
// use and self-documenting.
|
|
|
|
import QtQuick
|
|
import qs.config
|
|
import qs.services
|
|
|
|
SettingRow {
|
|
id: root
|
|
|
|
required property string setting
|
|
|
|
readonly property var spec: PreferenceSchema.spec(root.setting)
|
|
readonly property var options: root.spec && root.spec.options ? root.spec.options : []
|
|
readonly property var current: DesktopPreferences.get(root.setting)
|
|
|
|
label: root.spec ? root.spec.label : root.setting
|
|
detail: root.spec ? root.spec.detail : ""
|
|
controlWidth: Math.max(120, root.options.length * 92)
|
|
|
|
Rectangle {
|
|
anchors.right: parent.right
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
implicitWidth: segments.implicitWidth + 4
|
|
implicitHeight: 30
|
|
radius: 9
|
|
color: Theme.alpha(Theme.fg, 0.07)
|
|
border.width: 0
|
|
|
|
Row {
|
|
id: segments
|
|
anchors.centerIn: parent
|
|
spacing: 0
|
|
|
|
Repeater {
|
|
model: root.options
|
|
|
|
Rectangle {
|
|
id: segment
|
|
|
|
required property var modelData
|
|
|
|
readonly property bool selected: root.current === segment.modelData.value
|
|
|
|
implicitWidth: Math.max(70, caption.implicitWidth + 24)
|
|
implicitHeight: 26
|
|
radius: 7
|
|
border.width: 0
|
|
color: "transparent"
|
|
|
|
// The selected segment is the only place the prism appears
|
|
// in a row: blue leads into orchid, never orchid alone.
|
|
Rectangle {
|
|
anchors.fill: parent
|
|
radius: parent.radius
|
|
visible: segment.selected
|
|
border.width: 0
|
|
gradient: Gradient {
|
|
orientation: Gradient.Horizontal
|
|
GradientStop { position: 0.0; color: Theme.alpha(Theme.accent, 0.30) }
|
|
GradientStop { position: 1.0; color: Theme.alpha(Theme.accentSecondary, 0.30) }
|
|
}
|
|
}
|
|
|
|
Rectangle {
|
|
anchors.fill: parent
|
|
radius: parent.radius
|
|
border.width: 0
|
|
visible: !segment.selected && hover.hovered
|
|
color: Theme.alpha(Theme.fg, 0.06)
|
|
}
|
|
|
|
Text {
|
|
id: caption
|
|
anchors.centerIn: parent
|
|
text: segment.modelData.label
|
|
color: segment.selected ? Theme.fg : Theme.fgDim
|
|
font.family: Theme.fontFamily
|
|
font.pixelSize: Theme.fontSize
|
|
font.weight: segment.selected ? Font.DemiBold : Font.Normal
|
|
}
|
|
|
|
HoverHandler { id: hover }
|
|
|
|
TapHandler {
|
|
onTapped: SystemSettings.commitPreference(root.setting, segment.modelData.value)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|