Dock: one tooltip per app instead of a shared tooltip. avoid a few glitches when hovering.

This commit is contained in:
LemmyCook 2025-09-06 15:25:57 -04:00
parent ac43b6d78a
commit 1bb1015fdf

View file

@ -194,12 +194,6 @@ Variants {
height: parent.height - (Style.marginM * 2 * scaling) height: parent.height - (Style.marginM * 2 * scaling)
anchors.centerIn: parent anchors.centerIn: parent
NTooltip {
id: appTooltip
visible: false
positionAbove: true
}
function getAppIcon(toplevel: Toplevel): string { function getAppIcon(toplevel: Toplevel): string {
if (!toplevel) if (!toplevel)
return "" return ""
@ -226,6 +220,14 @@ Variants {
property string appId: modelData ? modelData.appId : "" property string appId: modelData ? modelData.appId : ""
property string appTitle: modelData ? modelData.title : "" property string appTitle: modelData ? modelData.title : ""
// Individual tooltip for this app
NTooltip {
id: appTooltip
target: appButton
positionAbove: true
visible: false
}
// The icon with better quality settings // The icon with better quality settings
Image { Image {
id: appIcon id: appIcon
@ -282,7 +284,6 @@ Variants {
onEntered: { onEntered: {
anyAppHovered = true anyAppHovered = true
const appName = appButton.appTitle || appButton.appId || "Unknown" const appName = appButton.appTitle || appButton.appId || "Unknown"
appTooltip.target = appButton
appTooltip.text = appName.length > 40 ? appName.substring(0, 37) + "..." : appName appTooltip.text = appName.length > 40 ? appName.substring(0, 37) + "..." : appName
appTooltip.isVisible = true appTooltip.isVisible = true
if (autoHide) { if (autoHide) {