Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt: Fix font family updates #3746

Merged
merged 3 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,7 @@ QString fontFamilyToString(FontFamily family)
void setFontFamily(FontFamily family)
{
fontFamily = family;
setApplicationFont();
updateFonts();
}

Expand Down
9 changes: 3 additions & 6 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TxViewDelegate : public QAbstractItemDelegate
QRect rectBottomHalf(mainRect.left() + xspace, mainRect.top() + ypad + halfheight + 5, mainRect.width() - xspace, halfheight);
QRect rectBounding;
QColor colorForeground;
QFont fontInitial = painter->font();
qreal initialFontSize = painter->font().pointSizeF();

// Grab model indexes for desired data from TransactionTableModel
QModelIndex indexDate = index.sibling(index.row(), TransactionTableModel::Date);
Expand All @@ -61,9 +61,7 @@ class TxViewDelegate : public QAbstractItemDelegate

// Draw first line (with slightly bigger font than the second line will get)
// Content: Date/Time, Optional IS indicator, Amount
QFont font = fontInitial;
font.setPointSizeF(GUIUtil::getScaledFontSize(font.pointSizeF() * 1.17));
painter->setFont(font);
painter->setFont(GUIUtil::getFont(GUIUtil::FontWeight::Normal, false, GUIUtil::getScaledFontSize(initialFontSize * 1.17)));
// Date/Time
colorForeground = qvariant_cast<QColor>(indexDate.data(Qt::ForegroundRole));
QString strDate = indexDate.data(Qt::DisplayRole).toString();
Expand All @@ -83,8 +81,7 @@ class TxViewDelegate : public QAbstractItemDelegate

// Draw second line (with the initial font)
// Content: Address/label, Optional Watchonly indicator
fontInitial.setPointSizeF(GUIUtil::getScaledFontSize(fontInitial.pointSizeF()));
painter->setFont(fontInitial);
painter->setFont(GUIUtil::getFont(GUIUtil::FontWeight::Normal, false, GUIUtil::getScaledFontSize(initialFontSize)));
// Address/Label
colorForeground = qvariant_cast<QColor>(indexAddress.data(Qt::ForegroundRole));
QString address = indexAddress.data(Qt::DisplayRole).toString();
Expand Down