[KFontChooser] Add a checkbox to toggle showing only monospaced fonts
ClosedPublic

Authored by ahmadsamir on Mar 25 2020, 10:40 AM.

Details

Summary

The use case is applications where the user is usually interested in
monospaced/fixe-width fonts, e.g. using Kate to edit source code.

Remove one redundant ++row.

Depends on D28271

Test Plan

See kfontchooserdialogtest app

Diff Detail

Repository
R236 KWidgetsAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Mar 25 2020, 10:40 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 25 2020, 10:40 AM
ahmadsamir requested review of this revision.Mar 25 2020, 10:40 AM
ngraham edited the summary of this revision. (Show Details)Mar 25 2020, 4:04 PM
bport requested changes to this revision.Mar 31 2020, 8:03 AM
bport added inline comments.
src/kfontchooser.cpp
346–347

This comment is still valid ?

384

I think there you can connect directly to setEnabled, you don't need a lambda

This revision now requires changes to proceed.Mar 31 2020, 8:03 AM

Don't use a lambda in connetc() where it's not needed

ahmadsamir marked an inline comment as done.Mar 31 2020, 11:24 AM
ahmadsamir added inline comments.
src/kfontchooser.cpp
346–347

Yes, that's after setting the font family/style/size list views and the size DoubleSpinBox.

bport accepted this revision.Apr 10 2020, 1:04 PM
This revision is now accepted and ready to land.Apr 10 2020, 1:04 PM

Handle the case where KFontChooser::FixedFontsOnly is set, the fixedOnlyCheckBox should be shown as "checked" from the get go.

dfaure accepted this revision.Apr 11 2020, 2:10 PM
dfaure added inline comments.
src/kfontchooser.cpp
394

would true be more readable?

(same for the previous line, actually)

ahmadsamir updated this revision to Diff 79861.Apr 11 2020, 2:50 PM

A better location for onlyFixedCheckbox->setChecked() is next to its siblings

ahmadsamir marked an inline comment as done.Apr 11 2020, 2:51 PM
ahmadsamir added inline comments.
src/kfontchooser.cpp
394

Indeed; however onlyFixedCheckbox->setChecked(usingFixed) doesn't need to be in that if block at all.

This revision was automatically updated to reflect the committed changes.
ahmadsamir marked an inline comment as done.