mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
modeldelegates: use font metrics for dive list row height
Include font metrics as part of the height in DiveListDelegate::sizeHint(). When 22px is hardcoded, this handles small fonts, but for larger fonts it seem that the bottom of the dive list row text is cut on Windows. Keep 22px as the minimum size hint, but for larger fonts use QFontMetric::height(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
eaf1bdbe5f
commit
5aa55e7ed5
1 changed files with 2 additions and 1 deletions
|
@ -24,7 +24,8 @@
|
|||
|
||||
QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const
|
||||
{
|
||||
return QSize(50, 22);
|
||||
const QFontMetrics metrics(qApp->font());
|
||||
return QSize(50, qMax(22, metrics.height()));
|
||||
}
|
||||
|
||||
// Gets the index of the model in the currentRow and column.
|
||||
|
|
Loading…
Reference in a new issue