[Digital Clock] Fix 24h tri-state button broken in port to QQC2
ClosedPublic

Authored by Zren on Feb 14 2019, 8:38 PM.

Details

Reviewers
ngraham
Group Reviewers
Plasma
Summary

In 12h system locales (eg: en_US), checked=1 is cast as
Qt::PartiallyChecked=1 which defaults to the system locale (12h).
Since it's no longer a tri-state button, the user can't select
Qt::Checked=2 which forces the 24h state.

BUG: 404292

FIXED-IN: 5.15.1

Test Plan
  • Run LC_TIME="en_US.UTF-8" plasmoidviewer -a org.kde.plasma.digitalclock and confirm it's a 2 state button that doesn't enable 24h clock.
  • Patch /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/configAppearance.qml
  • Run LC_TIME="en_US.UTF-8" plasmoidviewer -a org.kde.plasma.digitalclock and confirm it's a 3 state button that does force the 24h clock.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
Zren created this revision.Feb 14 2019, 8:38 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 14 2019, 8:38 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Zren requested review of this revision.Feb 14 2019, 8:38 PM
ngraham accepted this revision.Feb 14 2019, 8:51 PM
ngraham added a subscriber: ngraham.

+1 for fixing the bug, but this should really have a better UI. Using a checkbox for more something that has more than just binary on/off states is a poor practice because it's never apparent what the third "half checked" state actually means. We should more towards turning this into a combobox or radio buttons with the options "System locale default", "Force 12 hour", and "Force 24 hour" (or something like that).

This revision is now accepted and ready to land.Feb 14 2019, 8:51 PM
Zren closed this revision.Feb 15 2019, 2:02 PM

Shoot, I accidentally forgot the Phab Rev link in the commit message (though I remembered the bugzilla tags). I've setup a .git/hook/prepare-commit-msg -like thing for Sublime Text to prevent this happening in the future.