]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/qt_helpers.cpp
Avoid extra space in tooltips
[lyx.git] / src / frontends / qt4 / qt_helpers.cpp
index 3d3e36819f615b5b4b97c4b89c3281e0cbe8ce08..d23ae9c2f93147560af88f42fb798cf11d2dec52 100644 (file)
@@ -91,7 +91,7 @@ double locstringToDouble(QString const & str)
        return res;
 }
 
-} // namespace anon
+} // namespace
 
 
 namespace frontend {
@@ -214,6 +214,12 @@ QString formatLocFPNumber(double d)
 }
 
 
+bool SortLocaleAware(QString const & lhs, QString const & rhs)
+{
+       return QString::localeAwareCompare(lhs, rhs) < 0;
+}
+
+
 bool ColorSorter(ColorCode lhs, ColorCode rhs)
 {
        return compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
@@ -639,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