forked from Shinonome/dots-hyprland
add corner scrolling for brightness/volume
This commit is contained in:
@@ -295,8 +295,10 @@ Singleton {
|
||||
}
|
||||
property JsonObject cornerOpen: JsonObject {
|
||||
property bool enable: true
|
||||
property bool clickless: true
|
||||
property real cornerRegionWidth: 30
|
||||
property bool bottom: false
|
||||
property bool valueScroll: true
|
||||
property bool clickless: false
|
||||
property real cornerRegionWidth: 60
|
||||
property real cornerRegionHeight: 2
|
||||
property bool visualize: false
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ MouseArea { // Right side | scroll to change volume
|
||||
property real lastScrollX: 0
|
||||
property real lastScrollY: 0
|
||||
property bool trackingScroll: false
|
||||
property real moveThreshold: 20
|
||||
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
@@ -47,7 +48,7 @@ MouseArea { // Right side | scroll to change volume
|
||||
if (root.trackingScroll) {
|
||||
const dx = mouse.x - root.lastScrollX;
|
||||
const dy = mouse.y - root.lastScrollY;
|
||||
if (Math.sqrt(dx * dx + dy * dy) > osdHideMouseMoveThreshold) {
|
||||
if (Math.sqrt(dx * dx + dy * dy) > root.moveThreshold) {
|
||||
root.movedAway();
|
||||
root.trackingScroll = false;
|
||||
}
|
||||
|
||||
@@ -17,13 +17,17 @@ Item {
|
||||
property bool isBottomLeft: corner === RoundCorner.CornerEnum.BottomLeft
|
||||
property bool isTopRight: corner === RoundCorner.CornerEnum.TopRight
|
||||
property bool isBottomRight: corner === RoundCorner.CornerEnum.BottomRight
|
||||
property bool isTop: isTopLeft || isTopRight
|
||||
property bool isBottom: isBottomLeft || isBottomRight
|
||||
property bool isLeft: isTopLeft || isBottomLeft
|
||||
property bool isRight: isTopRight || isBottomRight
|
||||
|
||||
Shape {
|
||||
anchors {
|
||||
top: (isTopLeft || isTopRight) ? parent.top : undefined
|
||||
bottom: (isBottomLeft || isBottomRight) ? parent.bottom : undefined
|
||||
left: (isTopLeft || isBottomLeft) ? parent.left : undefined
|
||||
right: (isTopRight || isBottomRight) ? parent.right : undefined
|
||||
top: root.isTop ? parent.top : undefined
|
||||
bottom: root.isBottom ? parent.bottom : undefined
|
||||
left: root.isLeft ? parent.left : undefined
|
||||
right: root.isRight ? parent.right : undefined
|
||||
}
|
||||
layer.enabled: true
|
||||
layer.smooth: true
|
||||
|
||||
Reference in New Issue
Block a user