From 47b0ace19926a3e31f94af377f8323cf09040703 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Fri, 3 Oct 2025 19:02:53 -0400 Subject: [PATCH] Tooltips: fixed a bunch of tooltips which were not properly scaled. --- Modules/Bar/Widgets/Bluetooth.qml | 1 - Modules/Bar/Widgets/ControlCenter.qml | 1 - Modules/Bar/Widgets/DarkMode.qml | 1 - Modules/Bar/Widgets/KeepAwake.qml | 1 - Modules/Bar/Widgets/NightLight.qml | 1 - Modules/Bar/Widgets/NotificationHistory.qml | 1 - Modules/Bar/Widgets/PowerProfile.qml | 1 - Modules/Bar/Widgets/ScreenRecorder.qml | 2 +- Modules/Bar/Widgets/SessionMenu.qml | 1 - Modules/Bar/Widgets/Taskbar.qml | 1 + Modules/Bar/Widgets/WallpaperSelector.qml | 1 - Modules/Bar/Widgets/WiFi.qml | 1 - Modules/ControlCenter/Cards/MediaCard.qml | 5 +++++ Modules/ControlCenter/Cards/PowerProfilesCard.qml | 4 ++++ Modules/ControlCenter/Cards/ProfileCard.qml | 6 ++++-- Modules/ControlCenter/Cards/SystemMonitorCard.qml | 3 +++ Modules/ControlCenter/Cards/UtilitiesCard.qml | 4 ++++ Modules/ControlCenter/Cards/WeatherCard.qml | 1 + Modules/ControlCenter/ControlCenterPanel.qml | 6 ++++++ Widgets/NIconButton.qml | 1 + 20 files changed, 30 insertions(+), 13 deletions(-) diff --git a/Modules/Bar/Widgets/Bluetooth.qml b/Modules/Bar/Widgets/Bluetooth.qml index e76fa234..21fe96c7 100644 --- a/Modules/Bar/Widgets/Bluetooth.qml +++ b/Modules/Bar/Widgets/Bluetooth.qml @@ -10,7 +10,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 baseSize: Style.capsuleHeight diff --git a/Modules/Bar/Widgets/ControlCenter.qml b/Modules/Bar/Widgets/ControlCenter.qml index 65eb3b8c..5fbe7282 100644 --- a/Modules/Bar/Widgets/ControlCenter.qml +++ b/Modules/Bar/Widgets/ControlCenter.qml @@ -9,7 +9,6 @@ import qs.Services NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings diff --git a/Modules/Bar/Widgets/DarkMode.qml b/Modules/Bar/Widgets/DarkMode.qml index b35dd236..1333da05 100644 --- a/Modules/Bar/Widgets/DarkMode.qml +++ b/Modules/Bar/Widgets/DarkMode.qml @@ -6,7 +6,6 @@ import qs.Services NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 icon: "dark-mode" diff --git a/Modules/Bar/Widgets/KeepAwake.qml b/Modules/Bar/Widgets/KeepAwake.qml index ba09d92a..692466a4 100644 --- a/Modules/Bar/Widgets/KeepAwake.qml +++ b/Modules/Bar/Widgets/KeepAwake.qml @@ -8,7 +8,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 baseSize: Style.capsuleHeight diff --git a/Modules/Bar/Widgets/NightLight.qml b/Modules/Bar/Widgets/NightLight.qml index b972d37d..f5ac5770 100644 --- a/Modules/Bar/Widgets/NightLight.qml +++ b/Modules/Bar/Widgets/NightLight.qml @@ -11,7 +11,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 compact: (Settings.data.bar.density === "compact") diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index 2fee32ae..6c53f8b1 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -10,7 +10,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings diff --git a/Modules/Bar/Widgets/PowerProfile.qml b/Modules/Bar/Widgets/PowerProfile.qml index fbd2a719..a89c4e7a 100644 --- a/Modules/Bar/Widgets/PowerProfile.qml +++ b/Modules/Bar/Widgets/PowerProfile.qml @@ -9,7 +9,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 baseSize: Style.capsuleHeight diff --git a/Modules/Bar/Widgets/ScreenRecorder.qml b/Modules/Bar/Widgets/ScreenRecorder.qml index 5149a3a6..a97bc337 100644 --- a/Modules/Bar/Widgets/ScreenRecorder.qml +++ b/Modules/Bar/Widgets/ScreenRecorder.qml @@ -7,7 +7,7 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen + property real scaling: 1.0 icon: "camera-video" diff --git a/Modules/Bar/Widgets/SessionMenu.qml b/Modules/Bar/Widgets/SessionMenu.qml index f8f09929..cb506ad3 100644 --- a/Modules/Bar/Widgets/SessionMenu.qml +++ b/Modules/Bar/Widgets/SessionMenu.qml @@ -8,7 +8,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 compact: (Settings.data.bar.density === "compact") diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 3d2bef1f..7cbc4333 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -10,6 +10,7 @@ import qs.Widgets Rectangle { id: root + property ShellScreen screen property real scaling: 1.0 diff --git a/Modules/Bar/Widgets/WallpaperSelector.qml b/Modules/Bar/Widgets/WallpaperSelector.qml index 4be3e9a1..51188450 100644 --- a/Modules/Bar/Widgets/WallpaperSelector.qml +++ b/Modules/Bar/Widgets/WallpaperSelector.qml @@ -8,7 +8,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 baseSize: Style.capsuleHeight diff --git a/Modules/Bar/Widgets/WiFi.qml b/Modules/Bar/Widgets/WiFi.qml index 00fefab6..58a0e885 100644 --- a/Modules/Bar/Widgets/WiFi.qml +++ b/Modules/Bar/Widgets/WiFi.qml @@ -10,7 +10,6 @@ import qs.Widgets NIconButton { id: root - property ShellScreen screen property real scaling: 1.0 compact: (Settings.data.bar.density === "compact") diff --git a/Modules/ControlCenter/Cards/MediaCard.qml b/Modules/ControlCenter/Cards/MediaCard.qml index be99ef13..af0cf3c7 100644 --- a/Modules/ControlCenter/Cards/MediaCard.qml +++ b/Modules/ControlCenter/Cards/MediaCard.qml @@ -10,6 +10,8 @@ import qs.Widgets NBox { id: root + property ShellScreen screen + ColumnLayout { anchors.fill: parent anchors.margins: Style.marginL * scaling @@ -280,6 +282,7 @@ NBox { // Previous button NIconButton { icon: "media-prev" + screen: root.screen tooltipText: I18n.tr("tooltips.previous-media") visible: MediaService.canGoPrevious onClicked: MediaService.canGoPrevious ? MediaService.previous() : {} @@ -288,6 +291,7 @@ NBox { // Play/Pause button NIconButton { icon: MediaService.isPlaying ? "media-pause" : "media-play" + screen: root.screen tooltipText: MediaService.isPlaying ? I18n.tr("tooltips.pause") : I18n.tr("tooltips.play") visible: (MediaService.canPlay || MediaService.canPause) onClicked: (MediaService.canPlay || MediaService.canPause) ? MediaService.playPause() : {} @@ -296,6 +300,7 @@ NBox { // Next button NIconButton { icon: "media-next" + screen: root.screen tooltipText: I18n.tr("tooltips.next-media") visible: MediaService.canGoNext onClicked: MediaService.canGoNext ? MediaService.next() : {} diff --git a/Modules/ControlCenter/Cards/PowerProfilesCard.qml b/Modules/ControlCenter/Cards/PowerProfilesCard.qml index d93b26ba..dba4573b 100644 --- a/Modules/ControlCenter/Cards/PowerProfilesCard.qml +++ b/Modules/ControlCenter/Cards/PowerProfilesCard.qml @@ -10,6 +10,7 @@ import qs.Widgets // Power Profiles: performance, balanced, eco NBox { + property ShellScreen screen property real spacing: 0 // Centralized service @@ -26,6 +27,7 @@ NBox { // Performance NIconButton { icon: PowerProfileService.getIcon(PowerProfile.Performance) + screen: root.screen tooltipText: I18n.tr("tooltips.set-power-profile", { "profile": PowerProfileService.getName(PowerProfile.Performance) }) @@ -38,6 +40,7 @@ NBox { // Balanced NIconButton { icon: PowerProfileService.getIcon(PowerProfile.Balanced) + screen: root.screen tooltipText: I18n.tr("tooltips.set-power-profile", { "profile": PowerProfileService.getName(PowerProfile.Balanced) }) @@ -50,6 +53,7 @@ NBox { // Eco NIconButton { icon: PowerProfileService.getIcon(PowerProfile.PowerSaver) + screen: root.screen tooltipText: I18n.tr("tooltips.set-power-profile", { "profile": PowerProfileService.getName(PowerProfile.PowerSaver) }) diff --git a/Modules/ControlCenter/Cards/ProfileCard.qml b/Modules/ControlCenter/Cards/ProfileCard.qml index 6728ef7f..c20c7d3e 100644 --- a/Modules/ControlCenter/Cards/ProfileCard.qml +++ b/Modules/ControlCenter/Cards/ProfileCard.qml @@ -14,6 +14,7 @@ import qs.Widgets NBox { id: root + property ShellScreen screen property string uptimeText: "--" RowLayout { @@ -58,6 +59,7 @@ NBox { } NIconButton { icon: "settings" + screen: root.screen tooltipText: I18n.tr("tooltips.open-settings") onClicked: { settingsPanel.requestedTab = SettingsPanel.Tab.General @@ -66,8 +68,8 @@ NBox { } NIconButton { - id: powerButton icon: "power" + screen: root.screen tooltipText: I18n.tr("tooltips.session-menu") onClicked: { sessionMenuPanel.open() @@ -76,8 +78,8 @@ NBox { } NIconButton { - id: closeButton icon: "close" + screen: root.screen tooltipText: I18n.tr("tooltips.close") onClicked: { controlCenterPanel.close() diff --git a/Modules/ControlCenter/Cards/SystemMonitorCard.qml b/Modules/ControlCenter/Cards/SystemMonitorCard.qml index f4c615ce..a7622af1 100644 --- a/Modules/ControlCenter/Cards/SystemMonitorCard.qml +++ b/Modules/ControlCenter/Cards/SystemMonitorCard.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Layouts +import Quickshell import qs.Commons import qs.Services import qs.Widgets @@ -8,6 +9,8 @@ import qs.Widgets NBox { id: root + property ShellScreen screen + ColumnLayout { id: content anchors.left: parent.left diff --git a/Modules/ControlCenter/Cards/UtilitiesCard.qml b/Modules/ControlCenter/Cards/UtilitiesCard.qml index decd9659..d1215905 100644 --- a/Modules/ControlCenter/Cards/UtilitiesCard.qml +++ b/Modules/ControlCenter/Cards/UtilitiesCard.qml @@ -10,6 +10,7 @@ import qs.Widgets // Utilities: record & wallpaper NBox { + property ShellScreen screen property real spacing: 0 RowLayout { @@ -23,6 +24,7 @@ NBox { // Screen Recorder NIconButton { icon: "camera-video" + screen: root.screen enabled: ScreenRecorderService.isAvailable tooltipText: ScreenRecorderService.isAvailable ? (ScreenRecorderService.isRecording ? I18n.tr("tooltips.stop-screen-recording") : I18n.tr("tooltips.start-screen-recording")) : I18n.tr("tooltips.screen-recorder-not-installed") colorBg: ScreenRecorderService.isRecording ? Color.mPrimary : Color.mSurfaceVariant @@ -42,6 +44,7 @@ NBox { // Idle Inhibitor NIconButton { icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off" + screen: root.screen tooltipText: IdleInhibitorService.isInhibited ? I18n.tr("tooltips.disable-keep-awake") : I18n.tr("tooltips.enable-keep-awake") colorBg: IdleInhibitorService.isInhibited ? Color.mPrimary : Color.mSurfaceVariant colorFg: IdleInhibitorService.isInhibited ? Color.mOnPrimary : Color.mPrimary @@ -54,6 +57,7 @@ NBox { NIconButton { visible: Settings.data.wallpaper.enabled icon: "wallpaper-selector" + screen: root.screen tooltipText: I18n.tr("tooltips.wallpaper-selector") onClicked: PanelService.getPanel("wallpaperPanel")?.toggle(this) onRightClicked: WallpaperService.setRandomWallpaper() diff --git a/Modules/ControlCenter/Cards/WeatherCard.qml b/Modules/ControlCenter/Cards/WeatherCard.qml index 778d277b..4a780fa4 100644 --- a/Modules/ControlCenter/Cards/WeatherCard.qml +++ b/Modules/ControlCenter/Cards/WeatherCard.qml @@ -9,6 +9,7 @@ import qs.Widgets NBox { id: root + property ShellScreen screen readonly property bool weatherReady: (LocationService.data.weather !== null) ColumnLayout { diff --git a/Modules/ControlCenter/ControlCenterPanel.qml b/Modules/ControlCenter/ControlCenterPanel.qml index de1e7753..3e926671 100644 --- a/Modules/ControlCenter/ControlCenterPanel.qml +++ b/Modules/ControlCenter/ControlCenterPanel.qml @@ -29,11 +29,13 @@ NPanel { // Cards (consistent inter-card spacing via ColumnLayout spacing) ProfileCard { + screen: root.screen Layout.fillWidth: true Layout.preferredHeight: Math.max(64 * scaling) } WeatherCard { + screen: root.screen Layout.fillWidth: true Layout.preferredHeight: Math.max(220 * scaling) } @@ -46,12 +48,14 @@ NPanel { // Media card MediaCard { + screen: root.screen Layout.fillWidth: true Layout.fillHeight: true } // System monitors combined in one card SystemMonitorCard { + screen: root.screen Layout.preferredWidth: Style.baseWidgetSize * 2.625 * scaling Layout.fillHeight: true } @@ -65,6 +69,7 @@ NPanel { // Power Profiles switcher PowerProfilesCard { + screen: root.screen Layout.fillWidth: true Layout.fillHeight: true spacing: content.cardSpacing @@ -72,6 +77,7 @@ NPanel { // Utilities buttons UtilitiesCard { + screen: root.screen Layout.fillWidth: true Layout.fillHeight: true spacing: content.cardSpacing diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index d533153c..daf4c473 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -7,6 +7,7 @@ import qs.Services Rectangle { id: root + property ShellScreen screen property real baseSize: Style.baseWidgetSize property string icon