[Fonts KCM] Make the font selection dialog highlight the correct style
AbandonedPublic

Authored by ahmadsamir on Mar 4 2020, 11:49 AM.

Details

Reviewers
davidedmundson
broulik
ervin
meven
bport
Group Reviewers
Plasma
Summary

KConfig will clear the styleName font property for "Regular"-like font
styles (so that setBold(true) can work properly); this means that when
opening the font selection dialog it may highlight the wrong style for
the font currently set in kdeglobals, i.e. if the styleName property is
empty, QFontDialog will always select the first style in the list.

Workaround the issue by setting the "Regular"-like font style of the
initial font.

adjustAllFonts() doesn't take any arguments, change the QML code accordingly.

Depends on D27808
Depends on D27785

See also https://phabricator.kde.org/D27735 (KConfig)

Test Plan
  • Apply this diff and the other two it depends on
  • Edit kdeglobals and remove ",Regular|Normal|Book|Roman" from the *font*= entries; append e.g. ",Bold" to one of those entries (pick a font family that has a bold style)
  • Open the fonts kcm, and open the font selection dialog for a font, the correct "Regular"-like style should be selected
  • Open the font selection dialog for the font you set as Bold; Bold should be highlighted
  • Open the "Adjust all fonts" dialog, again the correct style should be selected

Diff Detail

Repository
R119 Plasma Desktop
Branch
l-qfontdlg-fix-initial (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 23245
Build 23263: arc lint + arc unit
ahmadsamir created this revision.Mar 4 2020, 11:49 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 4 2020, 11:49 AM
ahmadsamir requested review of this revision.Mar 4 2020, 11:49 AM
ervin added a reviewer: bport.Mar 5 2020, 3:31 PM
ahmadsamir planned changes to this revision.Mar 9 2020, 10:41 PM