bar: better scroll actions
Also fix workspaces interaction area
This commit is contained in:
parent
7157fe2cdd
commit
bf558cfe83
3 changed files with 21 additions and 33 deletions
|
|
@ -97,8 +97,8 @@ Item {
|
||||||
|
|
||||||
CustomMouseArea {
|
CustomMouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: -Config.border.thickness
|
anchors.leftMargin: -Math.max(Appearance.padding.smaller, Config.border.thickness)
|
||||||
anchors.rightMargin: -Config.border.thickness
|
anchors.rightMargin: -Math.max(Appearance.padding.smaller, Config.border.thickness)
|
||||||
|
|
||||||
function onWheel(event: WheelEvent): void {
|
function onWheel(event: WheelEvent): void {
|
||||||
const activeWs = Hyprland.activeToplevel?.workspace?.name;
|
const activeWs = Hyprland.activeToplevel?.workspace?.name;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.components
|
import qs.components
|
||||||
import qs.components.controls
|
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.utils
|
import qs.utils
|
||||||
import qs.config
|
import qs.config
|
||||||
|
|
@ -17,35 +16,6 @@ Item {
|
||||||
implicitWidth: child.implicitWidth
|
implicitWidth: child.implicitWidth
|
||||||
implicitHeight: child.implicitHeight
|
implicitHeight: child.implicitHeight
|
||||||
|
|
||||||
CustomMouseArea {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: child.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
function onWheel(event: WheelEvent): void {
|
|
||||||
if (event.angleDelta.y > 0)
|
|
||||||
Audio.incrementVolume();
|
|
||||||
else if (event.angleDelta.y < 0)
|
|
||||||
Audio.decrementVolume();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomMouseArea {
|
|
||||||
anchors.top: child.bottom
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
function onWheel(event: WheelEvent): void {
|
|
||||||
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 {
|
Item {
|
||||||
id: child
|
id: child
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import qs.components.controls
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.config
|
import qs.config
|
||||||
import qs.modules.bar.popouts as BarPopouts
|
import qs.modules.bar.popouts as BarPopouts
|
||||||
|
|
@ -5,7 +6,7 @@ import qs.modules.osd as Osd
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
MouseArea {
|
CustomMouseArea {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
|
|
@ -42,6 +43,23 @@ MouseArea {
|
||||||
return y > root.height - Config.border.thickness - panel.height - Config.border.rounding && withinPanelWidth(panel, x, y);
|
return y > root.height - Config.border.thickness - panel.height - Config.border.rounding && withinPanelWidth(panel, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue