Skip to content

Commit

Permalink
Clear font style name for new fonts
Browse files Browse the repository at this point in the history
The KDE/Plasma theme plugin (or others) may set the font styleName for a
new font. However we want to match the family name with the bold/italic
attributes instead of the stylename.

See #575
  • Loading branch information
roflcopter4 authored and equalsraf committed Sep 12, 2019
1 parent fdb979a commit 21a28a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/shellwidget/shellwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ void ShellWidget::setDefaultFont()
bool ShellWidget::setShellFont(const QString& family, qreal ptSize, int weight, bool italic, bool force)
{
QFont f(family, -1, weight, italic);
// Issue #575: Clear style name. The KDE/Plasma theme plugin may set this
// but we want to match the family name with the bold/italic attributes.
f.setStyleName(QStringLiteral(""));

f.setPointSizeF(ptSize);
f.setStyleHint(QFont::TypeWriter, QFont::StyleStrategy(QFont::PreferDefault | QFont::ForceIntegerMetrics));
f.setFixedPitch(true);
Expand Down

0 comments on commit 21a28a4

Please sign in to comment.