From 702cd1d283e5ffec8db63b84ac70535ec0327360 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Fri, 17 Oct 2025 10:33:46 -0400 Subject: [PATCH] Test commit for lefthook. --- Modules/Tooltip/Tooltip.qml | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Modules/Tooltip/Tooltip.qml b/Modules/Tooltip/Tooltip.qml index 3f5e6ca4..00c139b6 100644 --- a/Modules/Tooltip/Tooltip.qml +++ b/Modules/Tooltip/Tooltip.qml @@ -321,38 +321,38 @@ PopupWindow { completeHide() } -// Update text function for binding support -function updateText(newText) { - if (visible && targetItem) { - text = newText - - // Recalculate dimensions - const tipWidth = Math.min(tooltipText.implicitWidth + (padding * 2), maxWidth) - root.implicitWidth = tipWidth - - const tipHeight = tooltipText.implicitHeight + (padding * 2) - root.implicitHeight = tipHeight - - // Reposition if necessary - var targetGlobal = targetItem.mapToItem(null, 0, 0) - const targetWidth = targetItem.width - - // Adjust horizontal position to keep tooltip on screen if needed - const globalX = targetGlobal.x + anchorX - if (globalX < 0) { - anchorX = -targetGlobal.x + margin - } else if (globalX + tipWidth > screenWidth) { - anchorX = screenWidth - targetGlobal.x - tipWidth - margin - } - - // Force anchor update - Qt.callLater(() => { - if (root.anchor && root.visible) { - root.anchor.updateAnchor() + // Update text function + function updateText(newText) { + if (visible && targetItem) { + text = newText + + // Recalculate dimensions + const tipWidth = Math.min(tooltipText.implicitWidth + (padding * 2), maxWidth) + root.implicitWidth = tipWidth + + const tipHeight = tooltipText.implicitHeight + (padding * 2) + root.implicitHeight = tipHeight + + // Reposition if necessary + var targetGlobal = targetItem.mapToItem(null, 0, 0) + const targetWidth = targetItem.width + + // Adjust horizontal position to keep tooltip on screen if needed + const globalX = targetGlobal.x + anchorX + if (globalX < 0) { + anchorX = -targetGlobal.x + margin + } else if (globalX + tipWidth > screenWidth) { + anchorX = screenWidth - targetGlobal.x - tipWidth - margin } - }) + + // Force anchor update + Qt.callLater(() => { + if (root.anchor && root.visible) { + root.anchor.updateAnchor() + } + }) + } } -} // Reset function to clean up state function reset() {