mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Circumvent odd stmary font metrics (part of #9990).
The stmary font has an unusual large descent that was causing a large gap between lines in the math delimiter dialog because of the \llbracket and \rrbracket delimiters. The solution is to force Qt using the same size for all elements of the QlistWidget widget instead of letting it compute the size of each element.
This commit is contained in:
parent
8d088df4df
commit
0430132aa0
@ -181,6 +181,11 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
|
||||
|
||||
initMathSymbols();
|
||||
|
||||
FontInfo lyxfont;
|
||||
lyxfont.setFamily(CMR_FAMILY);
|
||||
QFontMetrics fm(frontend::getFont(lyxfont));
|
||||
QSize item_size(fm.maxWidth(), fm.height() + 8);
|
||||
|
||||
typedef map<char_type, QListWidgetItem *> ListItems;
|
||||
ListItems list_items;
|
||||
// The last element is the empty one.
|
||||
@ -191,11 +196,12 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
|
||||
QString symbol(ms.fontcode?
|
||||
QChar(ms.fontcode) : toqstr(docstring(1, ms.unicode)));
|
||||
QListWidgetItem * lwi = new QListWidgetItem(symbol);
|
||||
FontInfo lyxfont;
|
||||
lyxfont.setFamily(ms.fontfamily);
|
||||
QFont font = frontend::getFont(lyxfont);
|
||||
lwi->setFont(font);
|
||||
lwi->setToolTip(toqstr(delim));
|
||||
lwi->setSizeHint(item_size);
|
||||
lwi->setTextAlignment(Qt::AlignTop);
|
||||
list_items[ms.unicode] = lwi;
|
||||
leftLW->addItem(lwi);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@
|
||||
<enum>QListView::Adjust</enum>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="currentRow" >
|
||||
<number>-1</number>
|
||||
@ -123,7 +123,7 @@
|
||||
<enum>QListView::Adjust</enum>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user