mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(tooltip): limit tooltip radius when box is too small, larger horizontal padding for grid mode.
This commit is contained in:
@@ -257,10 +257,11 @@ PopupWindow {
|
||||
contentHeight = tooltipText.implicitHeight;
|
||||
}
|
||||
|
||||
const tipWidth = Math.ceil(Math.min(contentWidth + (padding * 2), maxWidth));
|
||||
const extraPad = isGridMode ? gridPaddingVertical : 0;
|
||||
const tipWidth = Math.ceil(Math.min(contentWidth + ((padding + extraPad) * 2), maxWidth));
|
||||
root.implicitWidth = tipWidth;
|
||||
|
||||
const tipHeight = Math.ceil(contentHeight + (padding * 2));
|
||||
const tipHeight = Math.ceil(contentHeight + ((padding + extraPad) * 2));
|
||||
root.implicitHeight = tipHeight;
|
||||
|
||||
// Get target's global position and convert to screen-relative
|
||||
@@ -498,10 +499,11 @@ PopupWindow {
|
||||
contentHeight = tooltipText.implicitHeight;
|
||||
}
|
||||
|
||||
const tipWidth = Math.ceil(Math.min(contentWidth + (padding * 2), maxWidth));
|
||||
const extraPad = isGridMode ? gridPaddingVertical : 0;
|
||||
const tipWidth = Math.ceil(Math.min(contentWidth + ((padding + extraPad) * 2), maxWidth));
|
||||
root.implicitWidth = tipWidth;
|
||||
|
||||
const tipHeight = Math.ceil(contentHeight + (padding * 2));
|
||||
const tipHeight = Math.ceil(contentHeight + ((padding + extraPad) * 2));
|
||||
root.implicitHeight = tipHeight;
|
||||
|
||||
// Reposition based on current direction (screen-relative)
|
||||
@@ -643,7 +645,7 @@ PopupWindow {
|
||||
color: Color.mSurface
|
||||
border.color: Color.mOutline
|
||||
border.width: Style.borderS
|
||||
radius: Style.radiusS
|
||||
radius: Math.min(Style.radiusS, Math.min(width, height) / 3)
|
||||
|
||||
// Only show content when we have content
|
||||
visible: root.text !== "" || root.isGridMode
|
||||
|
||||
Reference in New Issue
Block a user