Avoid using such small font sizes
This commit is contained in:
parent
03adb9a893
commit
f395d1a560
|
@ -56,8 +56,7 @@ void DeviceItemDelegate::paint(QPainter* p, const QStyleOptionViewItem& opt, con
|
|||
|
||||
// Font for the status line
|
||||
QFont status_font(opt.font);
|
||||
status_font.setItalic(true);
|
||||
status_font.setPointSize(status_font.pointSize() - 2);
|
||||
status_font.setPointSize(status_font.pointSize() - 1);
|
||||
|
||||
const int text_height = QFontMetrics(opt.font).height() +
|
||||
QFontMetrics(status_font).height();
|
||||
|
@ -81,8 +80,6 @@ void DeviceItemDelegate::paint(QPainter* p, const QStyleOptionViewItem& opt, con
|
|||
p->drawText(line1, Qt::AlignLeft | Qt::AlignTop, index.data().toString());
|
||||
|
||||
// Draw the second line (status)
|
||||
p->setFont(status_font);
|
||||
|
||||
DeviceManager::State state =
|
||||
static_cast<DeviceManager::State>(index.data(DeviceManager::Role_State).toInt());
|
||||
QVariant progress = index.data(DeviceManager::Role_UpdatingPercentage);
|
||||
|
@ -106,6 +103,11 @@ void DeviceItemDelegate::paint(QPainter* p, const QStyleOptionViewItem& opt, con
|
|||
}
|
||||
}
|
||||
|
||||
if (opt.state & QStyle::State_Selected)
|
||||
p->setPen(opt.palette.color(QPalette::HighlightedText));
|
||||
else
|
||||
p->setPen(opt.palette.color(QPalette::Dark));
|
||||
p->setFont(status_font);
|
||||
p->drawText(line2, Qt::AlignLeft | Qt::AlignTop, status_text);
|
||||
|
||||
p->restore();
|
||||
|
|
|
@ -156,7 +156,7 @@ void FreeSpaceBar::DrawBar(QPainter* p, const QRect& r) {
|
|||
|
||||
void FreeSpaceBar::DrawText(QPainter* p, const QRect& r) {
|
||||
QFont small_font(font());
|
||||
small_font.setPointSize(small_font.pointSize() - 2);
|
||||
small_font.setPointSize(small_font.pointSize() - 1);
|
||||
small_font.setBold(true);
|
||||
QFontMetrics small_metrics(small_font);
|
||||
p->setFont(small_font);
|
||||
|
|
Loading…
Reference in New Issue