summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-02 21:09:19 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-02 21:09:19 +1000
commit05d8a6a7cbe26b589f5a33602d8cffff59d18180 (patch)
tree3f04fbc2fb583bb39c5b5d3d133ab6452e0d2355
parentfeat: bar popouts (diff)
downloadcaelestia-shell-05d8a6a7cbe26b589f5a33602d8cffff59d18180.tar.gz
caelestia-shell-05d8a6a7cbe26b589f5a33602d8cffff59d18180.tar.bz2
caelestia-shell-05d8a6a7cbe26b589f5a33602d8cffff59d18180.zip
bar: fix scroll areas
-rw-r--r--modules/bar/Content.qml36
-rw-r--r--modules/bar/components/ActiveWindow.qml30
2 files changed, 34 insertions, 32 deletions
diff --git a/modules/bar/Content.qml b/modules/bar/Content.qml
index 7d91076..f469a3f 100644
--- a/modules/bar/Content.qml
+++ b/modules/bar/Content.qml
@@ -4,7 +4,6 @@ import "root:/config"
import "components"
import "components/workspaces"
import Quickshell
-import Quickshell.Widgets
import QtQuick
StyledRect {
@@ -13,10 +12,10 @@ StyledRect {
required property ShellScreen screen
function checkPopout(y: real): var {
- const aw = activeWindow.child
- const awy = activeWindow.y + aw.y
+ const aw = activeWindow.child;
+ const awy = activeWindow.y + aw.y;
if (y >= awy && y <= awy + aw.implicitHeight) {
- Popouts.currentName = "activewindow"
+ Popouts.currentName = "activewindow";
Popouts.currentCenter = Qt.binding(() => activeWindow.y + aw.y + aw.implicitHeight / 2);
Popouts.hasCurrent = true;
} else {
@@ -83,20 +82,6 @@ StyledRect {
}
}
- MouseArea {
- anchors.top: workspaces.bottom
- anchors.bottom: activeWindow.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- onWheel: event => {
- if (event.angleDelta.y > 0)
- Audio.setVolume(Audio.volume + 0.1);
- else if (event.angleDelta.y < 0)
- Audio.setVolume(Audio.volume - 0.1);
- }
- }
-
ActiveWindow {
id: activeWindow
@@ -104,21 +89,8 @@ StyledRect {
anchors.top: workspaces.bottom
anchors.bottom: tray.top
anchors.margins: Appearance.spacing.large
- }
-
- MouseArea {
- anchors.top: workspaces.bottom
- anchors.bottom: activeWindow.top
- anchors.left: parent.left
- anchors.right: parent.right
- onWheel: event => {
- const monitor = Brightness.getMonitorForScreen(root.screen);
- if (event.angleDelta.y > 0)
- monitor.setBrightness(monitor.brightness + 0.1);
- else if (event.angleDelta.y < 0)
- monitor.setBrightness(monitor.brightness - 0.1);
- }
+ monitor: Brightness.getMonitorForScreen(root.screen)
}
Tray {
diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml
index 6f387f4..f6204ae 100644
--- a/modules/bar/components/ActiveWindow.qml
+++ b/modules/bar/components/ActiveWindow.qml
@@ -9,12 +9,42 @@ import QtQuick
Item {
id: root
+ required property Brightness.Monitor monitor
property color colour: Colours.palette.m3primary
readonly property Item child: child
implicitWidth: child.implicitWidth
implicitHeight: child.implicitHeight
+ MouseArea {
+ anchors.top: parent.top
+ anchors.bottom: child.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ onWheel: event => {
+ if (event.angleDelta.y > 0)
+ Audio.setVolume(Audio.volume + 0.1);
+ else if (event.angleDelta.y < 0)
+ Audio.setVolume(Audio.volume - 0.1);
+ }
+ }
+
+ MouseArea {
+ anchors.top: child.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ onWheel: event => {
+ const monitor = root.monitor;
+ if (event.angleDelta.y > 0)
+ monitor.setBrightness(monitor.brightness + 0.1);
+ else if (event.angleDelta.y < 0)
+ monitor.setBrightness(monitor.brightness - 0.1);
+ }
+ }
+
Item {
id: child