fixed forceHide logic so that the bluetooth menu works
This commit is contained in:
@@ -10,7 +10,7 @@ import "Bluetooth"
|
|||||||
Container {
|
Container {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool hidden: true
|
property bool shown: false
|
||||||
|
|
||||||
animOffset: 200
|
animOffset: 200
|
||||||
boxColor: Colors.peach
|
boxColor: Colors.peach
|
||||||
@@ -18,7 +18,7 @@ Container {
|
|||||||
boxWidth: 30
|
boxWidth: 30
|
||||||
defaultItem: icon
|
defaultItem: icon
|
||||||
exclusiveToScreen: true
|
exclusiveToScreen: true
|
||||||
forceHidden: (hidden == true || BluetoothManager.getConnected())
|
forceHidden: !(root.shown || BluetoothManager.getConnected())
|
||||||
hoverableWhenHidden: true
|
hoverableWhenHidden: true
|
||||||
state: ""
|
state: ""
|
||||||
|
|
||||||
@@ -34,9 +34,6 @@ Container {
|
|||||||
StateChangeScript {
|
StateChangeScript {
|
||||||
script: {
|
script: {
|
||||||
root.stack.replace(icon);
|
root.stack.replace(icon);
|
||||||
if (BluetoothManager.getConnected() == false) {
|
|
||||||
root.hidden = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -52,7 +49,7 @@ Container {
|
|||||||
StateChangeScript {
|
StateChangeScript {
|
||||||
script: {
|
script: {
|
||||||
root.stack.replace(expanded);
|
root.stack.replace(expanded);
|
||||||
root.hidden = false;
|
root.shown = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,7 +60,7 @@ Container {
|
|||||||
root.state = "";
|
root.state = "";
|
||||||
hoverIntervalTimer.start();
|
hoverIntervalTimer.start();
|
||||||
} else {
|
} else {
|
||||||
root.hidden = false;
|
root.shown = true;
|
||||||
hoverIntervalTimer.start();
|
hoverIntervalTimer.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,13 +69,13 @@ Container {
|
|||||||
Timer {
|
Timer {
|
||||||
id: hoverIntervalTimer
|
id: hoverIntervalTimer
|
||||||
|
|
||||||
interval: 1000
|
interval: 500
|
||||||
repeat: false
|
repeat: false
|
||||||
running: false
|
running: false
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (root.hover.hovered != true && root.state != "expanded") {
|
if (root.hover.hovered == false) {
|
||||||
root.hidden = true;
|
root.shown = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,17 +15,20 @@ Item {
|
|||||||
property double boxRadius: 9
|
property double boxRadius: 9
|
||||||
property double boxWidth: 100
|
property double boxWidth: 100
|
||||||
readonly property double calculatedTopMargin: {
|
readonly property double calculatedTopMargin: {
|
||||||
if (root.exclusiveToScreen) {
|
if (!root.exclusiveToScreen) {
|
||||||
let baseMargin = hoverableWhenHidden == true ? 8 : -4;
|
|
||||||
if (Hyprland.focusedMonitor != root.exclusiveMonitor || forceHidden == true) {
|
|
||||||
return baseMargin - root.boxHeight - 5;
|
|
||||||
} else {
|
|
||||||
return visibleTopMargin;
|
return visibleTopMargin;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
if (Hyprland.focusedMonitor == root.exclusiveMonitor) {
|
||||||
|
if (!root.forceHidden) {
|
||||||
return visibleTopMargin;
|
return visibleTopMargin;
|
||||||
|
} else if (root.hoverableWhenHidden) {
|
||||||
|
return 7 - root.boxHeight - 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return -4 - root.boxHeight - 5;
|
||||||
|
}
|
||||||
property Component defaultItem
|
property Component defaultItem
|
||||||
required property HyprlandMonitor exclusiveMonitor
|
required property HyprlandMonitor exclusiveMonitor
|
||||||
property bool exclusiveToScreen: false
|
property bool exclusiveToScreen: false
|
||||||
|
|||||||
Reference in New Issue
Block a user