Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/qs-bar-edit-lock-regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
V1_BAR="$REPO_ROOT/versions/V1/BarSlot.qml"
V2_BAR="$REPO_ROOT/versions/V1/variants/V2/BarSlot.qml"

fail() {
printf 'FAIL: %s\n' "$*" >&2
exit 1
}

assert_unlock_guard() {
local id="$1" file="$2" block
block="$(sed -n "/id: ${id}[[:space:]]*$/,+8p" "$file")"
[[ -n $block ]] || fail "missing MouseArea id: $id in $file"
grep -Fq 'enabled: barSlot.root.barUnlocked' <<<"$block" \
|| fail "$id can mutate separators while the bar is locked"
}

assert_unlock_guard mkMa "$V1_BAR"
assert_unlock_guard bMa "$V1_BAR"
assert_unlock_guard sepMa "$V2_BAR"

printf 'PASS: separator edit handles require unlock mode\n'
2 changes: 2 additions & 0 deletions versions/V1/BarSlot.qml
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ PanelWindow {
MouseArea {
id: mkMa
anchors.fill: parent
enabled: barSlot.root.barUnlocked
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: if (toggleGap) toggleGap(slot.index)
Expand Down Expand Up @@ -976,6 +977,7 @@ PanelWindow {
MouseArea {
id: bMa
anchors.fill: parent
enabled: barSlot.root.barUnlocked
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: if (bm.toggleFn) bm.toggleFn()
Expand Down
1 change: 1 addition & 0 deletions versions/V1/variants/V2/BarSlot.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,7 @@ PanelWindow {
MouseArea {
id: sepMa
anchors.fill: parent
enabled: barSlot.root.barUnlocked
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: barSlot.root.toggleSep(slot.gid)
Expand Down