Compare commits

...
Author SHA1 Message Date
DeeJanuzandClaude Opus 5.5 f68d1458be Merge pin-combo-fix: Display Settings pins the chosen screen and keeps its rows in place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:22:12 -06:00
DeeJanuzandClaude Opus 5.5 bb7104961c Display Settings: pin the chosen screen, keep the pin rows in place
A screen's pin menu sent its own row as the screen: ComboBox.activated's
argument is also called index, so On your head pinned screen 4 and the
wrists screens 2 and 3. Pinning all screens worked.

A new pins list also rebuilt the rows, and FormLayout put the rebuilt
ones after the wrist slider and All screens row. Both Repeaters now take
a count and read the state by index, and a pin or switch that didn't take
goes back to what ft-screens has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:17:18 -06:00
+21 -9
View File
@@ -868,15 +868,21 @@ Kirigami.ApplicationWindow {
Kirigami.Separator { Kirigami.FormData.isSection: true; Kirigami.FormData.label: "Screens shown" }
// Counts as models, here and in Pinned screens: a new list rebuilds the rows, and
// FormLayout puts rebuilt rows after the ones below (a report: pinning a screen
// moved the wrist slider and All screens up between Screen 2 and Screen 3).
Repeater {
model: backend.screensShown
model: backend.screensShown.length
delegate: Controls.Switch {
required property var modelData
id: shownSwitch
required property int index
Kirigami.FormData.label: "Screen " + (index + 1) + ":"
text: modelData ? "Shown" : "Hidden"
checked: modelData
onToggled: backend.setScreenShown(index, checked)
text: checked ? "Shown" : "Hidden"
checked: backend.screensShown[index]
onToggled: {
backend.setScreenShown(shownSwitch.index, checked)
checked = Qt.binding(() => backend.screensShown[shownSwitch.index])
}
}
}
Controls.Label {
@@ -890,10 +896,11 @@ Kirigami.ApplicationWindow {
Kirigami.Separator { Kirigami.FormData.isSection: true; Kirigami.FormData.label: "Pinned screens" }
Repeater {
model: backend.pins
model: backend.pins.length
delegate: Controls.ComboBox {
required property var modelData
id: pinBox
required property int index
readonly property int pinIndex: Math.max(0, ["none", "left", "right", "head"].indexOf(backend.pins[index]))
Kirigami.FormData.label: "Screen " + (index + 1) + ":"
model: [
{ text: "In the room", value: "none" },
@@ -903,8 +910,13 @@ Kirigami.ApplicationWindow {
]
textRole: "text"
valueRole: "value"
currentIndex: Math.max(0, ["none", "left", "right", "head"].indexOf(modelData))
onActivated: backend.pin(String(index + 1), currentValue)
currentIndex: pinIndex
// pinBox.index: activated's own argument is also called index (the
// chosen row), so a bare index sent "On your head" to screen 4.
onActivated: {
backend.pin(String(pinBox.index + 1), currentValue)
currentIndex = Qt.binding(() => pinBox.pinIndex) // what ft-screens has, if the pin failed
}
}
}
RowLayout {