From 49a0c8449fa6693704001f6e7384ed4164ebd79c Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Wed, 1 Oct 2025 16:50:54 -0400 Subject: [PATCH] Tooltips: fixed a bunch of tooltips which where not following the screen's scaling --- Modules/Bar/Extras/BarPill.qml | 5 +++++ Modules/Bar/Extras/BarPillHorizontal.qml | 6 ++++++ Modules/Bar/Extras/BarPillVertical.qml | 5 +++++ Modules/Bar/Widgets/Battery.qml | 1 + Modules/Bar/Widgets/Brightness.qml | 1 + Modules/Bar/Widgets/CustomButton.qml | 1 + Modules/Bar/Widgets/KeyboardLayout.qml | 1 + Modules/Bar/Widgets/Microphone.qml | 2 ++ Modules/Bar/Widgets/Taskbar.qml | 1 + Modules/Bar/Widgets/Tray.qml | 3 +++ Modules/Bar/Widgets/Volume.qml | 1 + Modules/Tooltip/Tooltip.qml | 2 ++ Services/BrightnessService.qml | 4 ++-- 13 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Modules/Bar/Extras/BarPill.qml b/Modules/Bar/Extras/BarPill.qml index 6714d175..03a5941d 100644 --- a/Modules/Bar/Extras/BarPill.qml +++ b/Modules/Bar/Extras/BarPill.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls +import Quickshell import qs.Commons import qs.Services import qs.Widgets @@ -7,6 +8,8 @@ import qs.Widgets Item { id: root + property ShellScreen screen + property string icon: "" property string text: "" property string suffix: "" @@ -43,6 +46,7 @@ Item { Component { id: verticalPillComponent BarPillVertical { + screen: root.screen icon: root.icon text: root.text suffix: root.suffix @@ -68,6 +72,7 @@ Item { Component { id: horizontalPillComponent BarPillHorizontal { + screen: root.screen icon: root.icon text: root.text suffix: root.suffix diff --git a/Modules/Bar/Extras/BarPillHorizontal.qml b/Modules/Bar/Extras/BarPillHorizontal.qml index 95f95b15..2691a7b6 100644 --- a/Modules/Bar/Extras/BarPillHorizontal.qml +++ b/Modules/Bar/Extras/BarPillHorizontal.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls +import Quickshell import qs.Commons import qs.Services import qs.Widgets @@ -7,6 +8,8 @@ import qs.Widgets Item { id: root + property ShellScreen screen + property string icon: "" property string text: "" property string suffix: "" @@ -55,6 +58,9 @@ Item { Rectangle { id: pill + + property ShellScreen screen: root.screen + width: revealed ? pillMaxWidth : 1 height: pillHeight diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index d37f454d..ef6dff13 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls +import Quickshell import qs.Commons import qs.Services import qs.Widgets @@ -7,6 +8,7 @@ import qs.Widgets Item { id: root + property ShellScreen screen property string icon: "" property string text: "" property string suffix: "" @@ -67,6 +69,9 @@ Item { Rectangle { id: pill + + property ShellScreen screen: root.screen + width: revealed ? maxPillWidth : 1 height: revealed ? maxPillHeight : 1 diff --git a/Modules/Bar/Widgets/Battery.qml b/Modules/Bar/Widgets/Battery.qml index 336ee925..79b987e9 100644 --- a/Modules/Bar/Widgets/Battery.qml +++ b/Modules/Bar/Widgets/Battery.qml @@ -87,6 +87,7 @@ Item { BarPill { id: pill + screen: root.screen compact: (Settings.data.bar.density === "compact") rightOpen: BarService.getPillDirection(root) icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent, charging, isReady) diff --git a/Modules/Bar/Widgets/Brightness.qml b/Modules/Bar/Widgets/Brightness.qml index 652660c0..35ca2666 100644 --- a/Modules/Bar/Widgets/Brightness.qml +++ b/Modules/Bar/Widgets/Brightness.qml @@ -77,6 +77,7 @@ Item { BarPill { id: pill + screen: root.screen compact: (Settings.data.bar.density === "compact") rightOpen: BarService.getPillDirection(root) icon: getIcon() diff --git a/Modules/Bar/Widgets/CustomButton.qml b/Modules/Bar/Widgets/CustomButton.qml index 3973b4cd..ce144650 100644 --- a/Modules/Bar/Widgets/CustomButton.qml +++ b/Modules/Bar/Widgets/CustomButton.qml @@ -47,6 +47,7 @@ Item { BarPill { id: pill + screen: root.screen rightOpen: BarService.getPillDirection(root) icon: customIcon text: _dynamicText diff --git a/Modules/Bar/Widgets/KeyboardLayout.qml b/Modules/Bar/Widgets/KeyboardLayout.qml index ec83b71e..a85521b4 100644 --- a/Modules/Bar/Widgets/KeyboardLayout.qml +++ b/Modules/Bar/Widgets/KeyboardLayout.qml @@ -42,6 +42,7 @@ Item { BarPill { id: pill + screen: root.screen anchors.verticalCenter: parent.verticalCenter compact: (Settings.data.bar.density === "compact") rightOpen: BarService.getPillDirection(root) diff --git a/Modules/Bar/Widgets/Microphone.qml b/Modules/Bar/Widgets/Microphone.qml index 3d92106c..d1feb135 100644 --- a/Modules/Bar/Widgets/Microphone.qml +++ b/Modules/Bar/Widgets/Microphone.qml @@ -89,6 +89,8 @@ Item { BarPill { id: pill + + screen: root.screen rightOpen: BarService.getPillDirection(root) icon: getIcon() compact: (Settings.data.bar.density === "compact") diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index a4623e40..3d2bef1f 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -62,6 +62,7 @@ Rectangle { delegate: Item { id: taskbarItem required property var modelData + property ShellScreen screen: root.screen visible: (!widgetSettings.onlySameOutput || modelData.output == screen.name) && (!widgetSettings.onlyActiveWorkspaces || CompositorService.getActiveWorkspaces().map(ws => ws.id).includes(modelData.workspaceId)) diff --git a/Modules/Bar/Widgets/Tray.qml b/Modules/Bar/Widgets/Tray.qml index df8709fa..741f0e20 100644 --- a/Modules/Bar/Widgets/Tray.qml +++ b/Modules/Bar/Widgets/Tray.qml @@ -53,6 +53,9 @@ Rectangle { IconImage { id: trayIcon + + property ShellScreen screen: root.screen + anchors.centerIn: parent width: Style.marginL * scaling height: Style.marginL * scaling diff --git a/Modules/Bar/Widgets/Volume.qml b/Modules/Bar/Widgets/Volume.qml index 775a31d6..edea87be 100644 --- a/Modules/Bar/Widgets/Volume.qml +++ b/Modules/Bar/Widgets/Volume.qml @@ -75,6 +75,7 @@ Item { BarPill { id: pill + screen: root.screen compact: (Settings.data.bar.density === "compact") rightOpen: BarService.getPillDirection(root) icon: getIcon() diff --git a/Modules/Tooltip/Tooltip.qml b/Modules/Tooltip/Tooltip.qml index ded2b479..de1e3cc5 100644 --- a/Modules/Tooltip/Tooltip.qml +++ b/Modules/Tooltip/Tooltip.qml @@ -154,6 +154,8 @@ PopupWindow { screenWidth = targetItem.screen.width screenHeight = targetItem.screen.height scaling = ScalingService.getScreenScale(targetItem.screen) + } else { + Logger.warn("Tooltip", "Could not get screen scale for targetItem:", targetItem) } } diff --git a/Services/BrightnessService.qml b/Services/BrightnessService.qml index 24565be0..4e834c25 100644 --- a/Services/BrightnessService.qml +++ b/Services/BrightnessService.qml @@ -178,8 +178,8 @@ Singleton { // When a file change is detected, actively refresh from system // to ensure we get the most up-to-date value Qt.callLater(() => { - monitor.refreshBrightnessFromSystem() - }) + monitor.refreshBrightnessFromSystem() + }) } }