Tooltips: fixed a bunch of tooltips which where not following the screen's scaling

This commit is contained in:
ItsLemmy
2025-10-01 16:50:54 -04:00
parent 88871e3fbe
commit 49a0c8449f
13 changed files with 31 additions and 2 deletions
+5
View File
@@ -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
+6
View File
@@ -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
+5
View File
@@ -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
+1
View File
@@ -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)
+1
View File
@@ -77,6 +77,7 @@ Item {
BarPill {
id: pill
screen: root.screen
compact: (Settings.data.bar.density === "compact")
rightOpen: BarService.getPillDirection(root)
icon: getIcon()
+1
View File
@@ -47,6 +47,7 @@ Item {
BarPill {
id: pill
screen: root.screen
rightOpen: BarService.getPillDirection(root)
icon: customIcon
text: _dynamicText
+1
View File
@@ -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)
+2
View File
@@ -89,6 +89,8 @@ Item {
BarPill {
id: pill
screen: root.screen
rightOpen: BarService.getPillDirection(root)
icon: getIcon()
compact: (Settings.data.bar.density === "compact")
+1
View File
@@ -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))
+3
View File
@@ -53,6 +53,9 @@ Rectangle {
IconImage {
id: trayIcon
property ShellScreen screen: root.screen
anchors.centerIn: parent
width: Style.marginL * scaling
height: Style.marginL * scaling
+1
View File
@@ -75,6 +75,7 @@ Item {
BarPill {
id: pill
screen: root.screen
compact: (Settings.data.bar.density === "compact")
rightOpen: BarService.getPillDirection(root)
icon: getIcon()
+2
View File
@@ -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)
}
}
+2 -2
View File
@@ -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()
})
}
}