mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(dock): dynamically adjust tooltip direction based on dock position
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user