mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Test commit for lefthook.
This commit is contained in:
+30
-30
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user