]> git.lyx.org Git - features.git/commitdiff
Avoid extra space in tooltips
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 4 Nov 2018 23:53:36 +0000 (13:53 -1000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 21 Nov 2018 13:47:04 +0000 (14:47 +0100)
When using QTextDocument to check the natutal size of a text, one has
to remove the text margin, which is not useful here.

Fixes bug #11353.

(cherry picked from commit 7db99672e6838535d837096ab2344e7ecedb47e3)

src/frontends/qt4/qt_helpers.cpp
status.23x

index d2285101195527d6b4b189fb617d7f13b1ef32a1..d23ae9c2f93147560af88f42fb798cf11d2dec52 100644 (file)
@@ -645,6 +645,7 @@ QString formatToolTip(QString text, int em)
        QTextDocument td("");
        td.setHtml(text);
        td.setDefaultFont(QToolTip::font());
+       td.setDocumentMargin(0);
        td.setTextWidth(px_width);
        double best_width = td.idealWidth();
        // Set the line wrapping with appropriate width
index 6a85ae5d18deb805b8c332cff476e0007d185a02..3c6bac77da0c5c02b0cc0942b195ba28e320c649 100644 (file)
@@ -181,6 +181,8 @@ What's new
 
 - Fix display of overset, underset, and stackrel insets (bug 11367).
 
+- Avoid extra space at the end of tooltips (bug 11353).
+
 
 * INTERNALS