diff --git a/app/gui/main.qml b/app/gui/main.qml index 3a204f94..54aefe8f 100644 --- a/app/gui/main.qml +++ b/app/gui/main.qml @@ -69,9 +69,19 @@ ApplicationWindow { } } + // It would be better to use TextMetrics here, but it always lays out + // the text slightly more compactly than real Text does in ToolTip, + // causing unexpected line breaks to be inserted + Text { + id: tooltipTextLayoutHelper + visible: false + font: ToolTip.toolTip.font + text: ToolTip.toolTip.text + } + // This configures the maximum width of the singleton attached QML ToolTip. If left unconstrained, // it will never insert a line break and just extend on forever. - ToolTip.toolTip.contentWidth: ToolTip.toolTip.implicitContentWidth < 400 ? ToolTip.toolTip.implicitContentWidth : 400 + ToolTip.toolTip.contentWidth: Math.min(tooltipTextLayoutHelper.width, 400) function goBack() { if (clearOnBack) {