Skip to content

Commit

Permalink
Don't save style name for regular font
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and detiam committed Oct 17, 2024
1 parent 1c8b332 commit 5b652d2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/qt6ct/fontspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@ void FontsPage::onFontChangeRequested(QWidget *widget)
{
bool ok = false;
QFont font = QFontDialog::getFont (&ok, widget->font(), this);
if(ok)
{
widget->setFont(font);
qobject_cast<QLabel*>(widget)->setText(font.family () + " " + QString::number(font.pointSize ()));
}
if(!ok)
return;

if(font.weight() == QFont::Normal
&& (font.styleName() == QLatin1String("Regular")
|| font.styleName() == QLatin1String("Normal")
|| font.styleName() == QLatin1String("Book")
|| font.styleName() == QLatin1String("Roman")))
font.setStyleName(QString());

widget->setFont(font);
qobject_cast<QLabel*>(widget)->setText(font.family () + " " + QString::number(font.pointSize ()));
}

void FontsPage::readSettings()
Expand Down

0 comments on commit 5b652d2

Please sign in to comment.