From f521f447d2d6efd1d06a2e02b9ad028c8c43358b Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Thu, 21 Aug 2025 09:32:15 -0400 Subject: [PATCH] Potential fix for #123, tooltip bounding box --- Widgets/NTooltip.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Widgets/NTooltip.qml b/Widgets/NTooltip.qml index 00b59c7..ea86090 100644 --- a/Widgets/NTooltip.qml +++ b/Widgets/NTooltip.qml @@ -29,6 +29,11 @@ Window { } } + onTextChanged: { + // Compute new dimensions everytime the text changes + _updateDimensions() + } + function show() { isVisible = true } @@ -37,10 +42,16 @@ Window { timerShow.running = false } - function _showNow() { + function _updateDimensions() { // Compute new size everytime we show the tooltip width = Math.max(50 * scaling, tooltipText.implicitWidth + Style.marginL * 2 * scaling) height = Math.max(40 * scaling, tooltipText.implicitHeight + Style.marginM * 2 * scaling) + } + + + function _showNow() { + // Compute new dimensions everytime we show the tooltip + _updateDimensions() if (!target) { return