Test commit for lefthook.

This commit is contained in:
ItsLemmy
2025-10-17 10:33:46 -04:00
parent 5d821492c9
commit 702cd1d283
+30 -30
View File
@@ -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() {