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

Ahmad Samir noreply at phabricator.kde.org
Wed Mar 4 11:49:15 GMT 2020


ahmadsamir created this revision.
ahmadsamir added reviewers: Plasma, davidedmundson, broulik, ervin, meven.
Herald added a project: Plasma.
ahmadsamir requested review of this revision.

REVISION 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 <https://phabricator.kde.org/D27808>
  Depends on D27785 <https://phabricator.kde.org/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

REPOSITORY
  R119 Plasma Desktop

BRANCH
  l-qfontdlg-fix-initial (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D27830

AFFECTED FILES
  kcms/fonts/fonts.cpp
  kcms/fonts/fonts.h
  kcms/fonts/package/contents/ui/FontWidget.qml
  kcms/fonts/package/contents/ui/main.qml

To: ahmadsamir, #plasma, davidedmundson, broulik, ervin, meven
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200304/c6bea999/attachment-0001.html>


More information about the Plasma-devel mailing list