Commit 24e4e15b authored by Nate Graham's avatar Nate Graham 🔩

[kcms/fonts] When adjusting all fonts, keep Small font size smaller

Summary:
By default, the "Small" font is 2 points smaller than the "Normal" one. However when you
adjust the size of all fonts, this 2-pts-smaller relationship is not preserved, so the
Small font is set to the same size of the Normal font, defeating its reason for existence.

This patch preserves the "2px smaller" relationship between the Small and Normal fonts
when adjusting all of them at once.

BUG: 261344
FIXED-IN: 5.19.0

Test Plan: {F8258008}

Reviewers: #plasma, ahmadsamir, bport, cblack

Reviewed By: ahmadsamir, bport, cblack

Subscribers: cblack, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29156
parent f96c1058
......@@ -261,7 +261,17 @@ void KFonts::adjustAllFonts()
m_settings->setMenuFont(applyFontDiff(m_settings->menuFont(), font, fontDiffFlags));
m_settings->setToolBarFont(applyFontDiff(m_settings->toolBarFont(), font, fontDiffFlags));
m_settings->setActiveFont(applyFontDiff(m_settings->activeFont(), font, fontDiffFlags));
m_settings->setSmallestReadableFont(applyFontDiff(m_settings->smallestReadableFont(), font, fontDiffFlags));
QFont smallestFont = font;
// Make the small font 2 points smaller than the general font, but only
// if the general font is 9pt or higher or else the small font would be
// borderline unreadable. Assume that if the user is making the font
// tiny, they want a tiny font everywhere.
const int generalFontPointSize = font.pointSize();
if (generalFontPointSize >= 9) {
smallestFont.setPointSize(generalFontPointSize - 2);
}
m_settings->setSmallestReadableFont(applyFontDiff(m_settings->smallestReadableFont(), smallestFont, fontDiffFlags));
const QFont adjustedFont = applyFontDiff(m_settings->fixed(), font, fontDiffFlags);
if (QFontInfo(adjustedFont).fixedPitch()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment