Clear bar move outline on release
This commit is contained in:
@@ -86,7 +86,6 @@ Item {
|
|||||||
property real barDragOffsetX: 0
|
property real barDragOffsetX: 0
|
||||||
property real barDragOffsetY: 0
|
property real barDragOffsetY: 0
|
||||||
property bool barMoveActive: false
|
property bool barMoveActive: false
|
||||||
property bool barMoveSettling: false
|
|
||||||
property string barMoveCandidate: ""
|
property string barMoveCandidate: ""
|
||||||
property var barMoveWindow: null
|
property var barMoveWindow: null
|
||||||
property var barMoveScreen: null
|
property var barMoveScreen: null
|
||||||
@@ -223,8 +222,6 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function beginBarMove(window) {
|
function beginBarMove(window) {
|
||||||
barMoveSettleTimer.stop()
|
|
||||||
barMoveSettling = false
|
|
||||||
barMoveWindow = window
|
barMoveWindow = window
|
||||||
barMoveScreen = window ? window.screen : null
|
barMoveScreen = window ? window.screen : null
|
||||||
barMoveCandidate = position
|
barMoveCandidate = position
|
||||||
@@ -237,9 +234,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearBarMove() {
|
function clearBarMove() {
|
||||||
barMoveSettleTimer.stop()
|
|
||||||
barMoveActive = false
|
barMoveActive = false
|
||||||
barMoveSettling = false
|
|
||||||
barMoveCandidate = ""
|
barMoveCandidate = ""
|
||||||
barMoveWindow = null
|
barMoveWindow = null
|
||||||
barMoveScreen = null
|
barMoveScreen = null
|
||||||
@@ -252,20 +247,10 @@ Item {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hold the ghost on the target edge while the config round-trips and the
|
clearBarMove()
|
||||||
// bar re-anchors, so the handoff doesn't flash an empty edge.
|
|
||||||
barMoveActive = false
|
|
||||||
barMoveSettling = true
|
|
||||||
barMoveSettleTimer.restart()
|
|
||||||
setBarPosition(edge)
|
setBarPosition(edge)
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: barMoveSettleTimer
|
|
||||||
interval: 450
|
|
||||||
onTriggered: root.clearBarMove()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBarPosition(value) {
|
function setBarPosition(value) {
|
||||||
var next = normalizePosition(value)
|
var next = normalizePosition(value)
|
||||||
if (root.shell && typeof root.shell.mutateShellConfig === "function") {
|
if (root.shell && typeof root.shell.mutateShellConfig === "function") {
|
||||||
@@ -1069,7 +1054,7 @@ Item {
|
|||||||
required property var ghostScreen
|
required property var ghostScreen
|
||||||
readonly property bool screenMatches: root.barMoveScreen === ghostScreen ||
|
readonly property bool screenMatches: root.barMoveScreen === ghostScreen ||
|
||||||
(root.barMoveScreen && ghostScreen && root.barMoveScreen.name && ghostScreen.name && root.barMoveScreen.name === ghostScreen.name)
|
(root.barMoveScreen && ghostScreen && root.barMoveScreen.name && ghostScreen.name && root.barMoveScreen.name === ghostScreen.name)
|
||||||
visible: (root.barMoveActive || root.barMoveSettling) && screenMatches
|
visible: root.barMoveActive && screenMatches
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
exclusionMode: ExclusionMode.Ignore
|
exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.namespace: "omarchy-bar-move-ghost"
|
WlrLayershell.namespace: "omarchy-bar-move-ghost"
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ if perl -0ne 'exit(/drag\s*\.\s*target\s*:\s*[^;]*\bslot\b/s ? 0 : 1)' "$ROOT/sh
|
|||||||
fi
|
fi
|
||||||
pass "bar module dragging leaves layout-managed slots in place"
|
pass "bar module dragging leaves layout-managed slots in place"
|
||||||
|
|
||||||
|
if rg -q 'barMoveSettling|barMoveSettleTimer' "$ROOT/shell/plugins/bar/Bar.qml"; then
|
||||||
|
fail "bar move outline must clear when the pointer is released"
|
||||||
|
fi
|
||||||
|
pass "bar move outline has no post-release settling state"
|
||||||
|
|
||||||
run_node_test <<'JS'
|
run_node_test <<'JS'
|
||||||
const bar = requireFromRoot('shell/plugins/bar/BarModel.js')
|
const bar = requireFromRoot('shell/plugins/bar/BarModel.js')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user