Tooltip: fix newline detection

This commit is contained in:
Ly-sec
2025-11-21 13:02:50 +01:00
parent ddd3ae364c
commit 5ed4c97ee5

View File

@@ -122,8 +122,11 @@ PopupWindow {
hideImmediately();
}
// Convert \n to <br> for RichText format
const processedText = tipText.replace(/\n/g, '<br>');
// Set properties
text = tipText;
text = processedText;
targetItem = target;
// Find the correct screen dimensions based on target's global position
@@ -326,7 +329,9 @@ PopupWindow {
// Update text function
function updateText(newText) {
if (visible && targetItem) {
text = newText;
// Convert \n to <br> for RichText format
const processedText = newText.replace(/\n/g, '<br>');
text = processedText;
// Recalculate dimensions
const tipWidth = Math.min(tooltipText.implicitWidth + (padding * 2), maxWidth);