Compare commits
2 Commits
8c7ecc1b14
...
7a324e6119
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a324e6119 | |||
| 8abc848325 |
@@ -182,7 +182,6 @@ Container {
|
||||
|
||||
onTriggered: {
|
||||
if (!root.hover.hovered) {
|
||||
console.log("some");
|
||||
root.state = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,13 +10,16 @@ import "Bluetooth"
|
||||
Container {
|
||||
id: root
|
||||
|
||||
property bool shown: false
|
||||
|
||||
animOffset: 200
|
||||
boxColor: Colors.peach
|
||||
boxHeight: 25
|
||||
boxWidth: 30
|
||||
defaultItem: icon
|
||||
exclusiveToScreen: true
|
||||
forceHidden: BluetoothManager.getConnected()
|
||||
forceHidden: !(root.shown || BluetoothManager.getConnected())
|
||||
hoverableWhenHidden: true
|
||||
state: ""
|
||||
|
||||
states: [
|
||||
@@ -46,20 +49,43 @@ Container {
|
||||
StateChangeScript {
|
||||
script: {
|
||||
root.stack.replace(expanded);
|
||||
root.shown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
hover.onHoveredChanged: hover.hovered == false ? state = "" : undefined
|
||||
hover.onHoveredChanged: {
|
||||
if (hover.hovered == false) {
|
||||
root.state = "";
|
||||
hoverIntervalTimer.start();
|
||||
} else {
|
||||
root.shown = true;
|
||||
hoverIntervalTimer.start();
|
||||
}
|
||||
}
|
||||
tap.onTapped: state = "expanded"
|
||||
|
||||
Timer {
|
||||
id: hoverIntervalTimer
|
||||
|
||||
interval: 500
|
||||
repeat: false
|
||||
running: false
|
||||
|
||||
onTriggered: {
|
||||
if (root.hover.hovered == false) {
|
||||
root.shown = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: icon
|
||||
|
||||
Item {
|
||||
CenteredText {
|
||||
text: ""
|
||||
text: BluetoothManager.getConnected() == true ? "" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,21 +15,26 @@ Item {
|
||||
property double boxRadius: 9
|
||||
property double boxWidth: 100
|
||||
readonly property double calculatedTopMargin: {
|
||||
if (root.exclusiveToScreen) {
|
||||
if (Hyprland.focusedMonitor != root.exclusiveMonitor || forceHidden == true) {
|
||||
if (!root.exclusiveToScreen) {
|
||||
return visibleTopMargin;
|
||||
}
|
||||
|
||||
if (Hyprland.focusedMonitor == root.exclusiveMonitor) {
|
||||
if (!root.forceHidden) {
|
||||
return visibleTopMargin;
|
||||
} else if (root.hoverableWhenHidden) {
|
||||
return 7 - root.boxHeight - 5;
|
||||
}
|
||||
}
|
||||
|
||||
return -4 - root.boxHeight - 5;
|
||||
} else {
|
||||
return visibleTopMargin;
|
||||
}
|
||||
} else {
|
||||
return visibleTopMargin;
|
||||
}
|
||||
}
|
||||
property Component defaultItem
|
||||
required property HyprlandMonitor exclusiveMonitor
|
||||
property bool exclusiveToScreen: false
|
||||
property bool forceHidden: false
|
||||
property alias hover: hoverHandler
|
||||
property bool hoverableWhenHidden: false
|
||||
property alias rect: container
|
||||
property alias stack: containerContent
|
||||
property alias tap: tapHandler
|
||||
|
||||
@@ -14,11 +14,11 @@ Singleton {
|
||||
for (let device in deviceList) {
|
||||
let currentDevice = deviceList[device];
|
||||
if (currentDevice.connected == true) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getDevicesList() {
|
||||
return root.defaultAdapter.devices.values;
|
||||
|
||||
Reference in New Issue
Block a user