Fix/3958 dock tooltip & app icon perf (#3962)

port 2.0
This commit is contained in:
hecate cantus authored and GitHub committed 2026-10-27 13:14:29 -04:00
1 parent b2e1817aad
commit fa62bf2868
3 files changed
+20 -6

No files matched your search

+13 -3
View File
@@ -1,6 +1,5 @@
import QtQuick
import QtQuick.Effects
import Quickshell.Widgets
import qs.Common
import qs.Services
import qs.DCommon.Widgets
@@ -28,6 +27,12 @@ Item {
property bool showTooltip: mouseArea.containsMouse && !dragging
property var cachedDesktopEntry: dockApps?.desktopEntries[appData?.appId] ?? null
property real actualIconSize: 40
readonly property real iconLoadScale: {
const config = dockApps?.surfaceContext?.config;
const magnified = config?.magnification ? config.magnificationScale / 100 : 1;
const enlarged = options?.enlargeOnHover ? (options?.enlargePercentage ?? 125) / 100 : 1;
return Math.max(1, magnified * enlarged);
}
readonly property bool indicatorAtFarEdge: root.options.position === SettingsData.Position.Bottom || root.options.position === SettingsData.Position.Right
readonly property bool indicatorInPadding: !(root.dockApps?.barHosted ?? false)
readonly property real indicatorThickness: indicatorInPadding ? root.options.spacing : Math.max(0, ((isVertical ? width : height) - actualIconSize) / 2)
@@ -462,11 +467,16 @@ Item {
visible: iconValue !== ""
}
IconImage {
Image {
id: iconImg
readonly property real displaySize: appData && Paths.isDmsAppId(appData.appId) ? actualIconSize * 0.85 : actualIconSize
anchors.centerIn: parent
implicitSize: appData && Paths.isDmsAppId(appData.appId) ? actualIconSize * 0.85 : actualIconSize
width: displaySize
height: displaySize
fillMode: Image.PreserveAspectFit
sourceSize: Qt.size(displaySize * root.iconLoadScale, displaySize * root.iconLoadScale)
source: {
if (!appData || appData.appId === "__SEPARATOR__") {
return "";
+1
View File
@@ -581,6 +581,7 @@ FocusScope {
DTooltip {
id: dockTooltip
targetScreen: dock.screen
persistent: dock.config.enabled && (dock.hostWindow?.visible ?? false) && !dock.fullscreenOnScreen
}
Timer {
+6 -3
View File
@@ -16,6 +16,8 @@ PanelWindow {
property var targetScreen: null
property bool alignLeft: false
property bool alignRight: false
property bool persistent: false
property bool shown: false
function show(text, x, y, screen, leftAlign, rightAlign) {
root.text = text;
@@ -24,11 +26,11 @@ PanelWindow {
targetY = y;
alignLeft = leftAlign ?? false;
alignRight = rightAlign ?? false;
visible = true;
shown = true;
}
function hide() {
visible = false;
shown = false;
}
screen: targetScreen
@@ -36,7 +38,7 @@ PanelWindow {
implicitHeight: textContent.implicitHeight + Theme.spacingS * 2
color: "transparent"
mask: Region {}
visible: false
visible: persistent || shown
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1
@@ -68,6 +70,7 @@ PanelWindow {
Rectangle {
anchors.fill: parent
visible: root.shown
color: Theme.inverseSurface
radius: Theme.cornerRadiusXS