diff --git a/Modules/Bar/Widgets/ArchUpdater.qml b/Modules/Bar/Widgets/ArchUpdater.qml index 05598e1..8d7a60c 100644 --- a/Modules/Bar/Widgets/ArchUpdater.qml +++ b/Modules/Bar/Widgets/ArchUpdater.qml @@ -48,10 +48,10 @@ NIconButton { let tooltip = header if (pacmanTooltip !== "") { - tooltip += "\n" + pacmanTooltip + tooltip += "
" + pacmanTooltip } if (aurTooltip !== "") { - tooltip += "\n" + aurTooltip + tooltip += "
" + aurTooltip } return tooltip } diff --git a/Modules/Bar/Widgets/Battery.qml b/Modules/Bar/Widgets/Battery.qml index b6823c7..e76a0a3 100644 --- a/Modules/Bar/Widgets/Battery.qml +++ b/Modules/Bar/Widgets/Battery.qml @@ -102,25 +102,25 @@ Item { tooltipText: { let lines = [] if (testMode) { - lines.push("Time Left: " + Time.formatVagueHumanReadableDuration(12345)) - return lines.join("\n") + lines.push("Time left: " + Time.formatVagueHumanReadableDuration(12345)) + return lines.join("
") } if (!isReady || !battery.isLaptopBattery) { - return "No Battery Detected" + return "No battery detected" } if (battery.timeToEmpty > 0) { - lines.push("Time Left: " + Time.formatVagueHumanReadableDuration(battery.timeToEmpty)) + lines.push("Time left: " + Time.formatVagueHumanReadableDuration(battery.timeToEmpty)) } if (battery.timeToFull > 0) { - lines.push("Time Until Full: " + Time.formatVagueHumanReadableDuration(battery.timeToFull)) + lines.push("Time until full: " + Time.formatVagueHumanReadableDuration(battery.timeToFull)) } if (battery.changeRate !== undefined) { const rate = battery.changeRate if (rate > 0) { - lines.push(charging ? "Charging Rate: " + rate.toFixed(2) + " W" : "Discharging Rate: " + rate.toFixed( + lines.push(charging ? "Charging rate: " + rate.toFixed(2) + " W" : "Discharging rate: " + rate.toFixed( 2) + " W") } else if (rate < 0) { - lines.push("Discharging Rate: " + Math.abs(rate).toFixed(2) + " W") + lines.push("Discharging rate: " + Math.abs(rate).toFixed(2) + " W") } else { lines.push("Estimating...") } @@ -130,7 +130,7 @@ Item { if (battery.healthPercentage !== undefined && battery.healthPercentage > 0) { lines.push("Health: " + Math.round(battery.healthPercentage) + "%") } - return lines.join("\n") + return lines.join("
") } } } diff --git a/Modules/Bar/Widgets/Brightness.qml b/Modules/Bar/Widgets/Brightness.qml index bc09dca..63a8c20 100644 --- a/Modules/Bar/Widgets/Brightness.qml +++ b/Modules/Bar/Widgets/Brightness.qml @@ -70,8 +70,8 @@ Item { var monitor = getMonitor() if (!monitor) return "" - return "Brightness: " + Math.round(monitor.brightness * 100) + "%\nMethod: " + monitor.method - + "\nLeft click for advanced settings.\nScroll up/down to change brightness." + return "Brightness: " + Math.round(monitor.brightness * 100) + "%
Method: " + monitor.method + + "
Left click for advanced settings.
Scroll up/down to change brightness." } onWheel: function (angle) { diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 5679e4f..70dec55 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -200,10 +200,10 @@ Row { text: { var str = "" if (MediaService.canGoNext) { - str += "Right click for next\n" + str += "Right click for next
" } if (MediaService.canGoPrevious) { - str += "Middle click for previous\n" + str += "Middle click for previous
" } return str } diff --git a/Modules/Bar/Widgets/NightLight.qml b/Modules/Bar/Widgets/NightLight.qml index 5fe70da..43e330e 100644 --- a/Modules/Bar/Widgets/NightLight.qml +++ b/Modules/Bar/Widgets/NightLight.qml @@ -1,50 +1,32 @@ import QtQuick +import QtQuick.Layouts +import QtQuick.Controls import Quickshell +import Quickshell.Wayland import qs.Commons -import qs.Modules.SettingsPanel import qs.Services import qs.Widgets -Item { +NIconButton { id: root property ShellScreen screen property real scaling: ScalingService.scale(screen) - implicitWidth: pill.width - implicitHeight: pill.height - visible: true + sizeRatio: 0.8 - NPill { - id: pill - icon: Settings.data.nightLight.enabled ? "bedtime" : "bedtime_off" - iconCircleColor: Settings.data.nightLight.enabled ? Color.mSecondary : Color.mOnSurfaceVariant - collapsedIconColor: Settings.data.nightLight.enabled ? Color.mOnSecondary : Color.mOnSurface - autoHide: false - text: Settings.data.nightLight.enabled ? "On" : "Off" - tooltipText: { - if (!Settings.isLoaded || !Settings.data.nightLight.enabled) { - return "Night Light: Disabled\nLeft click to open settings.\nRight click to enable." - } + colorBg: Color.mSurfaceVariant + colorFg: Color.mOnSurface + colorBorder: Color.transparent + colorBorderHover: Color.transparent - var intensity = Math.round(Settings.data.nightLight.intensity * 100) - var schedule = Settings.data.nightLight.autoSchedule ? `Auto schedule` : `Manual: ${Settings.data.nightLight.startTime} - ${Settings.data.nightLight.stopTime}` - return `Night Light: Enabled\nIntensity: ${intensity}%\n${schedule}\nLeft click to open settings.\nRight click to toggle.` - } + icon: Settings.data.nightLight.enabled ? "bedtime" : "bedtime_off" + tooltipText: `Night Light: ${Settings.data.nightLight.enabled ? "enabled" : "disabled"}
Left click to toggle.
Right click to access settings.` + onClicked: Settings.data.nightLight.enabled = !Settings.data.nightLight.enabled - onClicked: { - // Left click - open settings - var settingsPanel = PanelService.getPanel("settingsPanel") - settingsPanel.requestedTab = SettingsPanel.Tab.Display - settingsPanel.open(screen) - } - - onRightClicked: { - // Right click - toggle night light (debounced apply handled by service) - Settings.data.nightLight.enabled = !Settings.data.nightLight.enabled - NightLightService.apply() - } - - // Wheel handler removed to avoid frequent rapid restarts/flicker + onRightClicked: { + var settingsPanel = PanelService.getPanel("settingsPanel") + settingsPanel.requestedTab = SettingsPanel.Tab.Display + settingsPanel.open(screen) } } diff --git a/Modules/Bar/Widgets/Volume.qml b/Modules/Bar/Widgets/Volume.qml index 8819cc9..24a8492 100644 --- a/Modules/Bar/Widgets/Volume.qml +++ b/Modules/Bar/Widgets/Volume.qml @@ -59,7 +59,7 @@ Item { autoHide: false // Important to be false so we can hover as long as we want text: Math.floor(AudioService.volume * 100) + "%" tooltipText: "Volume: " + Math.round( - AudioService.volume * 100) + "%\nLeft click for advanced settings.\nScroll up/down to change volume." + AudioService.volume * 100) + "%
Left click for advanced settings.
Scroll up/down to change volume." onWheel: function (delta) { wheelAccumulator += delta diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index 898dcf3..0972b42 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -27,6 +27,7 @@ Rectangle { signal entered signal exited signal clicked + signal rightClicked implicitWidth: size implicitHeight: size @@ -57,6 +58,7 @@ Rectangle { MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.LeftButton | Qt.RightButton hoverEnabled: true onEntered: { hovering = true @@ -72,11 +74,15 @@ Rectangle { } root.exited() } - onClicked: { + onClicked: function (mouse) { if (tooltipText) { tooltip.hide() } - root.clicked() + if (mouse.button === Qt.LeftButton) { + root.clicked() + } else if (mouse.button === Qt.RightButton) { + root.rightClicked() + } } } }