commit c1df5fb6efab2f8744a4052638f5e24fe88a7014
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Sun Nov 4 13:53:36 2018 -1000

    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.
    
    (cherry picked from commit 7db99672e6838535d837096ab2344e7ecedb47e3)
---
 src/frontends/qt4/qt_helpers.cpp |    1 +
 status.23x                       |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp
index d228510..d23ae9c 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
diff --git a/status.23x b/status.23x
index 6a85ae5..3c6bac7 100644
--- a/status.23x
+++ b/status.23x
@@ -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
 

Reply via email to