fix(dock): dynamically adjust tooltip direction based on dock position

This commit is contained in:
tibssy
2026-02-20 19:42:17 +00:00
parent a1aeeb116f
commit 3d8de77453
+3 -2
View File
@@ -19,6 +19,7 @@ Item {
required property int extraRight required property int extraRight
property alias dockContainer: dockContainer property alias dockContainer: dockContainer
readonly property bool isStaticMode: Settings.data.dock.dockType === "static" readonly property bool isStaticMode: Settings.data.dock.dockType === "static"
readonly property string tooltipDirection: dockRoot.dockPosition === "top" ? "bottom" : "top"
Rectangle { Rectangle {
id: dockContainer id: dockContainer
@@ -288,7 +289,7 @@ Item {
onEntered: { onEntered: {
dockRoot.anyAppHovered = true; dockRoot.anyAppHovered = true;
TooltipService.show(launcherButton, I18n.tr("actions.open-launcher"), "top"); TooltipService.show(launcherButton, I18n.tr("actions.open-launcher"), tooltipDirection);
if (dockRoot.autoHide) { if (dockRoot.autoHide) {
dockRoot.showTimer.stop(); dockRoot.showTimer.stop();
dockRoot.hideTimer.stop(); dockRoot.hideTimer.stop();
@@ -664,7 +665,7 @@ Item {
const appName = appButton.appTitle || appButton.appId || "Unknown"; const appName = appButton.appTitle || appButton.appId || "Unknown";
const tooltipText = appName.length > 40 ? appName.substring(0, 37) + "..." : appName; const tooltipText = appName.length > 40 ? appName.substring(0, 37) + "..." : appName;
if (!contextMenu.visible) { if (!contextMenu.visible) {
TooltipService.show(appButton, tooltipText, "top"); TooltipService.show(appButton, tooltipText, tooltipDirection);
} }
if (dockRoot.autoHide) { if (dockRoot.autoHide) {
dockRoot.showTimer.stop(); dockRoot.showTimer.stop();