mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
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.
This commit is contained in:
parent
70e2f09c4f
commit
7db99672e6
@ -645,6 +645,7 @@ QString formatToolTip(QString text, int em)
|
|||||||
QTextDocument td("");
|
QTextDocument td("");
|
||||||
td.setHtml(text);
|
td.setHtml(text);
|
||||||
td.setDefaultFont(QToolTip::font());
|
td.setDefaultFont(QToolTip::font());
|
||||||
|
td.setDocumentMargin(0);
|
||||||
td.setTextWidth(px_width);
|
td.setTextWidth(px_width);
|
||||||
double best_width = td.idealWidth();
|
double best_width = td.idealWidth();
|
||||||
// Set the line wrapping with appropriate width
|
// Set the line wrapping with appropriate width
|
||||||
|
Loading…
Reference in New Issue
Block a user