From 3710df29f588c2aa430d9797a36afa1cbd85b128 Mon Sep 17 00:00:00 2001 From: Laurens Duin <85798751+Laurens256@users.noreply.github.com> Date: Wed, 13 Aug 2025 06:31:48 +0200 Subject: bar: allow hiding items and reordering (#379) * feat: reorder bar, no popout yet * chore: cleanup * refactor: use DelegateChooser * feat: popouts * chore: cleanup * better popout check + fix async stuff + bar interaction + a bunch of other fixes * fix activewindow and bar vertical padding * readme: add config opt * bar: fix top/bottom padding * bar: better wheel behaviour --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- modules/drawers/Drawers.qml | 16 ++++++++-------- modules/drawers/Interactions.qml | 13 +------------ modules/drawers/Panels.qml | 2 +- 3 files changed, 10 insertions(+), 21 deletions(-) (limited to 'modules/drawers') diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml index 26f177c..06183dd 100644 --- a/modules/drawers/Drawers.qml +++ b/modules/drawers/Drawers.qml @@ -133,17 +133,17 @@ Variants { visibilities: visibilities bar: bar } - } - BarWrapper { - id: bar + BarWrapper { + id: bar - anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.top: parent.top + anchors.bottom: parent.bottom - screen: scope.modelData - visibilities: visibilities - popouts: panels.popouts + screen: scope.modelData + visibilities: visibilities + popouts: panels.popouts + } } } } diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 6b276a0..94d27cc 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -45,18 +45,7 @@ CustomMouseArea { function onWheel(event: WheelEvent): void { if (event.x < bar.implicitWidth) { - if (event.y < screen.height / 2) { - if (event.angleDelta.y > 0) - Audio.incrementVolume(); - else if (event.angleDelta.y < 0) - Audio.decrementVolume(); - } else { - const monitor = Brightness.getMonitorForScreen(screen); - if (event.angleDelta.y > 0) - monitor.setBrightness(monitor.brightness + 0.1); - else if (event.angleDelta.y < 0) - monitor.setBrightness(monitor.brightness - 0.1); - } + bar.handleWheel(event.y, event.angleDelta); } } diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml index ae3a9f2..d27dca0 100644 --- a/modules/drawers/Panels.qml +++ b/modules/drawers/Panels.qml @@ -92,7 +92,7 @@ Item { const diff = root.height - Math.floor(off + nonAnimHeight); if (diff < 0) return off + diff; - return off; + return Math.max(off, 0); } } -- cgit v1.2.3-freya