mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
fix Symbols dialog box grid size in case of broken QFontMetrics::maxWidth()
This commit is contained in:
parent
b73c6462d6
commit
358e9ab31b
@ -277,12 +277,16 @@ GuiSymbols::GuiSymbols(GuiView & lv)
|
|||||||
|
|
||||||
symbolsLW->setViewMode(QListView::IconMode);
|
symbolsLW->setViewMode(QListView::IconMode);
|
||||||
// increase the display size of the symbols a bit
|
// increase the display size of the symbols a bit
|
||||||
QFont font= symbolsLW->font();
|
QFont font = symbolsLW->font();
|
||||||
int size = font.pointSize() + 3;
|
const int size = font.pointSize() + 3;
|
||||||
font.setPointSize(size);
|
font.setPointSize(size);
|
||||||
symbolsLW->setFont(font);
|
symbolsLW->setFont(font);
|
||||||
QFontMetrics fm(font);
|
QFontMetrics fm(font);
|
||||||
symbolsLW->setGridSize(QSize(fm.maxWidth() + 2, fm.height() + 2));
|
const int cellHeight = fm.height() + 2;
|
||||||
|
// FIXME: using at least cellHeight because of
|
||||||
|
// QFontMetrics::maxWidth() is returning 0 with Qt/Cocoa on Mac OS
|
||||||
|
const int cellWidth = max(cellHeight, fm.maxWidth() + 2);
|
||||||
|
symbolsLW->setGridSize(QSize(cellWidth, cellHeight));
|
||||||
symbolsLW->setModel(model_);
|
symbolsLW->setModel(model_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user