fix: hide detailed text of MonitorItem immediatly after hovering and changing the value & specify device for brightnessctl
This commit is contained in:
@@ -18,6 +18,7 @@ Item {
|
||||
property real hideTimeOut: 2000 // ms
|
||||
property bool forceExpand: false
|
||||
property bool _expand: forceExpand || mouseArea.containsMouse
|
||||
property bool _isFirst: true
|
||||
property bool disableHover: false
|
||||
property bool critical: false
|
||||
property color criticalColor: Colors.red
|
||||
@@ -39,6 +40,15 @@ Item {
|
||||
|
||||
sourceComponent: Connections {
|
||||
function onValueChanged() {
|
||||
// No need to expand (again) if already hovering
|
||||
if (mouseArea.containsMouse)
|
||||
return ;
|
||||
|
||||
// Skip first change (which is most likely initialization)
|
||||
if (root._isFirst) {
|
||||
root._isFirst = false;
|
||||
return ;
|
||||
}
|
||||
root.forceExpand = true;
|
||||
hideTimer.restart();
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ Singleton {
|
||||
Quickshell.execDetached(["ddcutil", "-b", busNum, "setvcp", "10", rounded])
|
||||
} else {
|
||||
monitor.ignoreNextChange = true
|
||||
Quickshell.execDetached(["brightnessctl", "s", rounded + "%"])
|
||||
Quickshell.execDetached(["set-brightness", rounded + "%"])
|
||||
}
|
||||
|
||||
if (isDdc) {
|
||||
|
||||
Reference in New Issue
Block a user