From: Jean-Marc Lasgouttes Date: Sun, 4 Nov 2018 23:53:36 +0000 (-1000) Subject: Avoid extra space in tooltips X-Git-Tag: lyx-2.4.0dev-acb2ca7b~2931 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7db99672e6838535d837096ab2344e7ecedb47e3;p=features.git Avoid extra space in tooltips 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. --- diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp index bc15bc7d01..0311b8b25f 100644 --- a/src/frontends/qt4/qt_helpers.cpp +++ b/src/frontends/qt4/qt_helpers.cpp @@ -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