KDoubleNumInput is deprecated in KF5, so it should be ported to get rid of KDELIBS4SUPPORT.
Details
- Reviewers
aacid mkoller - Group Reviewers
KDE Applications
Press Ctrl+M and choose "Histogram Equalizer" or "Hue, Saturation, Value" option from the top-level drop-down list. The behavior should be similar to the unpatched case.
Diff Detail
- Repository
- R374 KolourPaint
- Lint
Lint Skipped - Unit
Unit Tests Skipped
widgets/imagelib/effects/kpEffectWidgetBase.h | ||
---|---|---|
44 | Do you need these two classes to do double<->int conversion in the signals, right? A bit sad :/ Anyway, don't call them QSomething, that's reserved for Qt, call them KpSomething |
widgets/imagelib/effects/kpEffectHSVWidget.cpp | ||
---|---|---|
60 | Something is "not working the same" in the Hue slider, with the old code, when i move the mouse wheel up/down it changes in 1.08 increments, with the new code it changes in 0,03 increments, which make it kind of hard to use since it barely moves. Can you have a look at that? |
widgets/imagelib/effects/kpEffectHSVWidget.cpp | ||
---|---|---|
60 | Actually, I was thinking this will be a funny feature (rough tuning with dragging the slider and finetuning with the wheel-scrolling) but it can be done to mimic the good old behavior. |
With the new code i get 0,10 increments in Hue instead 0,03 but still far away from the 1,08 i get with the old version
Can you reproduce what the same i get?
Sure. Sorry, I did not notice somehow. It is hard to make this magic 1.08 step, but 1.00 step can be easily implemented (see the next iteration of the patch)
You fixed one and broke the other :D
Now Saturation is on 0.10 instead of 0.03 it was before.
Can they not have independent stepping?
I feel like having two classes of each is not the best of the ideas, since it seems the only difference in one you use 10 and in the other 100 in notifyValueChanged.
I'm going to propose two solutions:
- Ideally try to get that 10/100 value calculated from the range, step values, something like (making it totally up range/0.1) or similar
- If that doesn't seem to work out, make that 10, 100 a parameter you pass either in the constructor or as a setter, it'll be much simpler than having two classes that share 99% of the code.
Does it make sense to you?
other than ma comments, I'm ok with it.
widgets/imagelib/effects/kpEffectHSVWidget.cpp | ||
---|---|---|
57 | passing a range of -180..180 in ctor and setting a range of -100..100 in the next line seems odd. | |
64 | same comment as above. Why passing 2 different ranges ? | |
widgets/imagelib/effects/kpEffectWidgetBase.h | ||
73 | There is no advantage in using const & for a double: const double &minimumValue |
widgets/imagelib/effects/kpEffectHSVWidget.cpp | ||
---|---|---|
57 | It appears that creating a connection between two different widgets one of which understands integers and both of them do not know about deficiencies of each other only is a tricky thing. To make the appearance for the different ranges similar I decided to make the ranges equal to [-100, 100]. Should I put it into the header? May it be that some inline lambdas can be useful? May it be that some comments on this will be enough? I just do not know. Now it's a bit cryptic and ugly indeed but kind of working. |
I suggest you create ONE new widget which contains a slider and a spinbox, and you pass the range it shall use.
Now it's very confusing.
widgets/imagelib/effects/kpEffectHSVWidget.cpp | ||
---|---|---|
21 | HUE has -180 .. +180. |