diff options
| -rw-r--r-- | desktop/modules/monitors/MonitorsPage.qml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/desktop/modules/monitors/MonitorsPage.qml b/desktop/modules/monitors/MonitorsPage.qml index df13d92..06fc182 100644 --- a/desktop/modules/monitors/MonitorsPage.qml +++ b/desktop/modules/monitors/MonitorsPage.qml @@ -127,6 +127,8 @@ Column { id: drag anchors.fill: parent enabled: !page.mod.pending + // The page's ScrollView would take a vertical drag. + preventStealing: true cursorShape: pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor property point start onPressed: m => start = mapToItem(canvas, m.x, m.y) @@ -135,7 +137,10 @@ Column { mon.dx = p.x - start.x; mon.dy = p.y - start.y; } + onCanceled: { mon.dx = 0; mon.dy = 0; } onReleased: { + // A click is not a move: it would snap, and make an auto position exact. + if (Math.hypot(mon.dx, mon.dy) < 4) { mon.dx = 0; mon.dy = 0; return; } const moved = { x: mon.r.x + mon.dx / canvas.k, y: mon.r.y + mon.dy / canvas.k, w: mon.r.w, h: mon.r.h }; const others = canvas.rects.filter((o, i) => i !== mon.index); const s = M.snap(moved, others, 64); @@ -169,6 +174,8 @@ Column { Column { id: rows anchors { fill: parent; margins: 14 } + // Keep writes the draft, so it may not change from what was tried. + enabled: !page.mod.pending spacing: 8 Text { @@ -182,7 +189,9 @@ Column { Label { text: "Mode" } Combo { width: 220 - model: card.d ? card.d.modes.map(m => m.replace("@", " @ ") + " Hz") : [] + // From orig, which set() leaves alone: a new model on every edit + // could reset the shown index. + model: page.mod.orig[card.index] ? page.mod.orig[card.index].modes.map(m => m.replace("@", " @ ") + " Hz") : [] currentIndex: card.d ? card.d.modes.indexOf(card.d.mode) : -1 onActivated: i => page.mod.set(card.index, "mode", card.d.modes[i]) } |
