]> 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>
Mon, 5 Nov 2018 00:02:42 +0000 (14:02 -1000)
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.

src/frontends/qt4/qt_helpers.cpp

index bc15bc7d01fa29b316f9e00fc2337625225a1881..0311b8b25f45e6f0a8b1852fe14f6553615e12e8 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