Consistently use KQuickControls.ColorButton in the config UI
ClosedPublic

Authored by kossebau on Apr 18 2018, 5:30 PM.

Details

Summary

For a consistent UX use the same component for config UI elements
showing a currently selected color and allowing to trigger a color picker to
select another color.

Test Plan

All buttons adapt to color changes as well as trigger the color dialog if
activated and take over any chosen color.

Diff Detail

Repository
R114 Plasma Addons
Branch
useconsistentcolorbutton
Lint
No Linters Available
Unit
No Unit Test Coverage
kossebau created this revision.Apr 18 2018, 5:30 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 18 2018, 5:30 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Apr 18 2018, 5:30 PM

Before:



After:


For comparison code which got copied from:

kossebau added inline comments.Apr 18 2018, 5:34 PM
applets/systemloadviewer/package/contents/ui/ColorPicker.qml
2

Open question to developers:
how expensive is it to have an instance of ColorDialog per button, instead of sharing one over all buttons?

That's where the code for both ColorButtons here is yet to be aligned.

There's ColorButton (https://api.kde.org/frameworks/kdeclarative/html/classColorButton.html) inside kquickcontrols

Can't we use that?

applets/systemloadviewer/package/contents/ui/ColorPicker.qml
2

It's open source, you can see what Qt Dialogs does internally.

kossebau updated this revision to Diff 32502.Apr 18 2018, 6:58 PM

use KQuickControls.ColorButton

There's ColorButton (https://api.kde.org/frameworks/kdeclarative/html/classColorButton.html) inside kquickcontrols

Can't we use that?

Ah, I had only grepped for ColorDialog and before also only seen that custom code in the image wallpaper config. From quick testing that one works as well, and is used in Fifteenpuzzle config UI.
Though not anywhere else. Leaves me slightly puzzled why nothing else has used it before and instead did own creations?

With KQuickControls.ColorButton:

Would do similar patches for image wallpaper & similar as well if this one is okayed.

kossebau updated this revision to Diff 32505.Apr 18 2018, 7:27 PM

also update potd wallpaper with KQuickControls.ColorButton

kossebau retitled this revision from Use consistent color button components for color config UI elements to Consistently use KQuickControls.ColorButton in the config UI.Apr 18 2018, 7:29 PM
kossebau edited the summary of this revision. (Show Details)
kossebau edited the test plan for this revision. (Show Details)
davidedmundson accepted this revision.Apr 18 2018, 7:37 PM

So much red!

This revision is now accepted and ready to land.Apr 18 2018, 7:37 PM
This revision was automatically updated to reflect the committed changes.