Brightness indicator is not shown if brightness < 0
+ Tray moved to the very left.
This commit is contained in:
parent
e85fafcd80
commit
1af0a084f8
2 changed files with 23 additions and 18 deletions
28
Bar/Bar.qml
28
Bar/Bar.qml
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
|
@ -8,11 +9,10 @@ import qs.Bar.Modules
|
||||||
import qs.Settings
|
import qs.Settings
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Components
|
import qs.Components
|
||||||
|
import qs.Helpers
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
import qs.Widgets.Sidebar
|
import qs.Widgets.Sidebar
|
||||||
import qs.Widgets.Sidebar.Panel
|
import qs.Widgets.Sidebar.Panel
|
||||||
import qs.Helpers
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Widgets.Notification
|
import qs.Widgets.Notification
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
|
|
@ -87,6 +87,18 @@ Scope {
|
||||||
anchors.rightMargin: 18
|
anchors.rightMargin: 18
|
||||||
spacing: 12
|
spacing: 12
|
||||||
|
|
||||||
|
SystemTray {
|
||||||
|
id: systemTrayModule
|
||||||
|
shell: rootScope.shell
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
bar: panel
|
||||||
|
trayMenu: externalTrayMenu
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomTrayMenu {
|
||||||
|
id: externalTrayMenu
|
||||||
|
}
|
||||||
|
|
||||||
NotificationIcon {
|
NotificationIcon {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
@ -107,18 +119,6 @@ Scope {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemTray {
|
|
||||||
id: systemTrayModule
|
|
||||||
shell: rootScope.shell
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
bar: panel
|
|
||||||
trayMenu: externalTrayMenu
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomTrayMenu {
|
|
||||||
id: externalTrayMenu
|
|
||||||
}
|
|
||||||
|
|
||||||
ClockWidget {
|
ClockWidget {
|
||||||
screen: modelData
|
screen: modelData
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
|
||||||
|
|
@ -21,19 +21,24 @@ Item {
|
||||||
Process {
|
Process {
|
||||||
id: getBrightnessProcess
|
id: getBrightnessProcess
|
||||||
command: [Quickshell.shellDir + "/Programs/zigbrightness", "get", monitorName]
|
command: [Quickshell.shellDir + "/Programs/zigbrightness", "get", monitorName]
|
||||||
|
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
const output = this.text.trim()
|
const output = this.text.trim()
|
||||||
const val = parseInt(output)
|
const val = parseInt(output)
|
||||||
|
if (isNaN(val)) return
|
||||||
if (!isNaN(val) && val >= 0 && val !== previousBrightness) {
|
|
||||||
|
if (val < 0) {
|
||||||
|
brightnessDisplay.visible = false
|
||||||
|
}
|
||||||
|
else if (val >= 0 && val !== previousBrightness) {
|
||||||
|
brightnessDisplay.visible = true
|
||||||
previousBrightness = brightness
|
previousBrightness = brightness
|
||||||
brightness = val
|
brightness = val
|
||||||
pill.text = brightness + "%"
|
pill.text = brightness + "%"
|
||||||
|
|
||||||
if (firstChange) {
|
if (firstChange) {
|
||||||
firstChange = false;
|
firstChange = false
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pill.show()
|
pill.show()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue