Tooltip: different approach to get the current screen.

This commit is contained in:
ItsLemmy
2025-10-03 23:27:07 -04:00
parent b85576653a
commit 86127660fe
33 changed files with 32 additions and 83 deletions
-4
View File
@@ -8,8 +8,6 @@ import qs.Widgets
Item {
id: root
property ShellScreen screen
property string icon: ""
property string text: ""
property string suffix: ""
@@ -46,7 +44,6 @@ Item {
Component {
id: verticalPillComponent
BarPillVertical {
screen: root.screen
icon: root.icon
text: root.text
suffix: root.suffix
@@ -72,7 +69,6 @@ Item {
Component {
id: horizontalPillComponent
BarPillHorizontal {
screen: root.screen
icon: root.icon
text: root.text
suffix: root.suffix
+1 -3
View File
@@ -59,8 +59,6 @@ Item {
Rectangle {
id: pill
property ShellScreen screen: root.screen
width: revealed ? pillMaxWidth : 1
height: pillHeight
@@ -225,7 +223,7 @@ Item {
onEntered: {
hovered = true
root.entered()
TooltipService.show(pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong)
TooltipService.show(Screen, pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong)
if (disableOpen || forceClose) {
return
}
+1 -4
View File
@@ -8,7 +8,6 @@ import qs.Widgets
Item {
id: root
property ShellScreen screen
property string icon: ""
property string text: ""
property string suffix: ""
@@ -70,8 +69,6 @@ Item {
Rectangle {
id: pill
property ShellScreen screen: root.screen
width: revealed ? maxPillWidth : 1
height: revealed ? maxPillHeight : 1
@@ -265,7 +262,7 @@ Item {
onEntered: {
hovered = true
root.entered()
TooltipService.show(pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong)
TooltipService.show(Screen, pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong)
if (disableOpen || forceClose) {
return
}
+1 -1
View File
@@ -329,7 +329,7 @@ Item {
acceptedButtons: Qt.LeftButton
onEntered: {
if ((windowTitle !== "") && (barPosition === "left" || barPosition === "right") || (scrollingMode === "never")) {
TooltipService.show(root, windowTitle, BarService.getTooltipDirection())
TooltipService.show(Screen, root, windowTitle, BarService.getTooltipDirection())
}
}
onExited: {
-1
View File
@@ -87,7 +87,6 @@ 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,7 +77,6 @@ Item {
BarPill {
id: pill
screen: root.screen
compact: (Settings.data.bar.density === "compact")
rightOpen: BarService.getPillDirection(root)
icon: getIcon()
+1 -1
View File
@@ -115,7 +115,7 @@ Rectangle {
hoverEnabled: true
onEntered: {
if (!PanelService.getPanel("calendarPanel")?.active) {
TooltipService.show(root, I18n.tr("clock.tooltip"), BarService.getTooltipDirection())
TooltipService.show(Screen, root, I18n.tr("clock.tooltip"), BarService.getTooltipDirection())
}
}
onExited: {
-1
View File
@@ -47,7 +47,6 @@ Item {
BarPill {
id: pill
screen: root.screen
rightOpen: BarService.getPillDirection(root)
icon: customIcon
text: _dynamicText
-1
View File
@@ -42,7 +42,6 @@ Item {
BarPill {
id: pill
screen: root.screen
anchors.verticalCenter: parent.verticalCenter
compact: (Settings.data.bar.density === "compact")
rightOpen: BarService.getPillDirection(root)
+1 -1
View File
@@ -390,7 +390,7 @@ Item {
onEntered: {
var textToShow = hasActivePlayer ? tooltipText : placeholderText
if ((textToShow !== "") && (barPosition === "left" || barPosition === "right") || (scrollingMode === "never")) {
TooltipService.show(root, textToShow, BarService.getTooltipDirection())
TooltipService.show(Screen, root, textToShow, BarService.getTooltipDirection())
}
}
onExited: {
-1
View File
@@ -90,7 +90,6 @@ Item {
BarPill {
id: pill
screen: root.screen
rightOpen: BarService.getPillDirection(root)
icon: getIcon()
compact: (Settings.data.bar.density === "compact")
+1 -1
View File
@@ -117,7 +117,7 @@ Rectangle {
}
}
}
onEntered: TooltipService.show(taskbarItem, taskbarItem.modelData.title || taskbarItem.modelData.appId || "Unknown app.", BarService.getTooltipDirection())
onEntered: TooltipService.show(Screen, taskbarItem, taskbarItem.modelData.title || taskbarItem.modelData.appId || "Unknown app.", BarService.getTooltipDirection())
onExited: TooltipService.hide()
}
}
+1 -1
View File
@@ -140,7 +140,7 @@ Rectangle {
}
onEntered: {
trayPanel.close()
TooltipService.show(trayIcon, modelData.tooltipTitle || modelData.name || modelData.id || "Tray Item", BarService.getTooltipDirection())
TooltipService.show(Screen, trayIcon, modelData.tooltipTitle || modelData.name || modelData.id || "Tray Item", BarService.getTooltipDirection())
}
onExited: TooltipService.hide()
}
-1
View File
@@ -75,7 +75,6 @@ Item {
BarPill {
id: pill
screen: root.screen
compact: (Settings.data.bar.density === "compact")
rightOpen: BarService.getPillDirection(root)
icon: getIcon()