Patch for the Bug 352869 shade selector indicator
ClosedPublic

Authored by natalynovak on Feb 27 2016, 8:16 PM.

Details

Summary

For minimal shade selector, this patch adds indications of the first color, and the one that is now selected.

Test Plan

Checking the color selectiom
Checking that when the colour is changed on the wheel, the sliders moves back to the initial position.
Checking the behaviour when the width of the docker is changed.
Checking the behaviour while the mouse goes out of the color selector

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
natalynovak updated this revision to Diff 2481.Feb 27 2016, 8:16 PM
natalynovak retitled this revision from to Patch for the Bug 352869 shade selector indicator.
natalynovak updated this object.
natalynovak edited the test plan for this revision. (Show Details)
natalynovak set the repository for this revision to R37 Krita.
Restricted Application added a subscriber: woltherav. · View Herald TranscriptFeb 27 2016, 8:16 PM

You should add reviewers too :)

I won't be able to build this until monday, but krita:next tags all active commiters.

dkazakov requested changes to this revision.Feb 28 2016, 11:21 AM
dkazakov added a reviewer: dkazakov.
dkazakov added a subscriber: dkazakov.

Hi, Natalya!

I checked your patch and it looks really good! There is one blocker bug still. If you press a mouse button, move the mouse out of the widget and then release the button, the widget will end up in an inconsistent state. I added a comment about how to fix that. The other comments are just styling nit picking :)

We could also talk to Scott and Wolthera about the look of the controls. I guess they should either be XOR'ed over the background (if it is possible by Qt) or just their color should be adjusted according to some rule depending on the average HSV around them (granted we know the color of the background here).

Probably we could also make the shape of the two handles different somehow...

But these two comments are for the future work after the main patch is in master.

plugins/extensions/dockers/advancedcolorselector/kis_shade_selector_line.cpp
163

if (qAbs(i) <= 5) {
...
}

209

m_new.QSize::width() is really excessive here. QSize doesn't have complex operator overloads.

233

You can use this line instead:

if (e->buttons() & Qt::LeftButton)

Using such booleans is dangerous because the user can press/release the mouse while being outsize the widget, so it can get into an inconsistent state. In ideal case, you should catch enterEvent() and leaveEvent() to catch these corner-cases. But in your specific case, testing for buttons() should be enough.

This revision now requires changes to proceed.Feb 28 2016, 11:21 AM
natalynovak updated this revision to Diff 2755.Mar 13 2016, 2:15 PM
natalynovak edited edge metadata.
natalynovak removed R37 Krita as the repository for this revision.

Can't make it not to go out of color selector.

natalynovak updated this revision to Diff 2758.Mar 13 2016, 8:36 PM
natalynovak edited the test plan for this revision. (Show Details)
natalynovak edited edge metadata.

Seems that I fixed all the problems

This revision was automatically updated to reflect the committed changes.