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

Authored by ngraham on Apr 24 2020, 4:48 PM.

Details

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

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Apr 24 2020, 4:48 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 24 2020, 4:48 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Apr 24 2020, 4:48 PM
ahmadsamir added inline comments.Apr 28 2020, 2:51 PM
kcms/fonts/fonts.cpp
266

But if the user selects a very small size, then size - 2 will be even tinier. Maybe make it conditional for size >= 6 or 8?

ngraham updated this revision to Diff 81437.Apr 28 2020, 3:05 PM
ngraham marked an inline comment as done.

Only do it when the general font is 9pt or larger

ahmadsamir added inline comments.Apr 28 2020, 3:09 PM
kcms/fonts/fonts.cpp
270

Nit-pick: I'd store font.pointSize() in a const int, and use that instead of calling pointSize() more than once.

ngraham updated this revision to Diff 81438.Apr 28 2020, 3:20 PM
ngraham marked an inline comment as done.

Store it in a variable

ahmadsamir accepted this revision.Apr 28 2020, 3:22 PM

The change makes sense; but please wait for @bport review too.

This revision is now accepted and ready to land.Apr 28 2020, 3:22 PM
bport accepted this revision.Apr 29 2020, 1:57 PM

OK for me, as long as VDG is ok with this behavior

kcms/fonts/fonts.cpp
271

Nit-pick can we align comment and code either higher than 8pt (comment) or >= 9 on the code

ngraham updated this revision to Diff 81515.Apr 29 2020, 2:00 PM
ngraham marked an inline comment as done.

Align code and comment

cblack accepted this revision as: cblack.Apr 29 2020, 3:07 PM
cblack added a subscriber: cblack.

+1 from a design standpoint here.

This revision was automatically updated to reflect the committed changes.