diff --git a/Bar/Bar.qml b/Bar/Bar.qml index 67c20bf..1027f9d 100644 --- a/Bar/Bar.qml +++ b/Bar/Bar.qml @@ -1,4 +1,5 @@ import QtQuick +import QtQuick.Controls import QtQuick.Layouts import Quickshell import Quickshell.Io @@ -8,11 +9,10 @@ import qs.Bar.Modules import qs.Settings import qs.Services import qs.Components +import qs.Helpers import qs.Widgets import qs.Widgets.Sidebar import qs.Widgets.Sidebar.Panel -import qs.Helpers -import QtQuick.Controls import qs.Widgets.Notification Scope { @@ -87,6 +87,18 @@ Scope { anchors.rightMargin: 18 spacing: 12 + SystemTray { + id: systemTrayModule + shell: rootScope.shell + anchors.verticalCenter: parent.verticalCenter + bar: panel + trayMenu: externalTrayMenu + } + + CustomTrayMenu { + id: externalTrayMenu + } + NotificationIcon { anchors.verticalCenter: parent.verticalCenter } @@ -107,18 +119,6 @@ Scope { anchors.verticalCenter: parent.verticalCenter } - SystemTray { - id: systemTrayModule - shell: rootScope.shell - anchors.verticalCenter: parent.verticalCenter - bar: panel - trayMenu: externalTrayMenu - } - - CustomTrayMenu { - id: externalTrayMenu - } - ClockWidget { screen: modelData anchors.verticalCenter: parent.verticalCenter diff --git a/Bar/Modules/Brightness.qml b/Bar/Modules/Brightness.qml index c36f291..9f28478 100644 --- a/Bar/Modules/Brightness.qml +++ b/Bar/Modules/Brightness.qml @@ -21,19 +21,24 @@ Item { Process { id: getBrightnessProcess command: [Quickshell.shellDir + "/Programs/zigbrightness", "get", monitorName] - + stdout: StdioCollector { onStreamFinished: { const output = this.text.trim() const val = parseInt(output) - - if (!isNaN(val) && val >= 0 && val !== previousBrightness) { + if (isNaN(val)) return + + if (val < 0) { + brightnessDisplay.visible = false + } + else if (val >= 0 && val !== previousBrightness) { + brightnessDisplay.visible = true previousBrightness = brightness brightness = val pill.text = brightness + "%" if (firstChange) { - firstChange = false; + firstChange = false } else { pill.show()