-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore slider digits where lost in introspection changes #5721
Conversation
|
This is for 3.2 right? I'm not sure to understand your last sentence (I'm not native English). |
|
Yes, sorry; I meant the other meanderings about a long term solution/approach are for after 3.2. Therefore the short-term fixes in this PR should go into 3.2 to not cause regressions. |
| @@ -2347,22 +2347,26 @@ void gui_init(struct dt_iop_module_t *self) | |||
| GtkWidget *page2 = self->widget = GTK_WIDGET(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0)); | |||
|
|
|||
| g->cx = dt_bauhaus_slider_from_params(self, "cx"); | |||
| dt_bauhaus_slider_set_digits(g->cx, 4); | |||
| dt_bauhaus_slider_set_factor(g->cx, 100.0); | |||
| dt_bauhaus_slider_set_format(g->cx, "%0.f %%"); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need %0.2 here ? Otherwise the values are displayed as plain integer in the interface. Likewise below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to. There are many places where there are more digits than are visible. I didn't intend to "clean" all of those up, as it may not be a bad thing anyway. As i said, i think we could get rid of rounding to nearest "digit" completely, except for integers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's merge this then. I understand that there is probably many cases like this. I think it makes sense to at least fix this one for the release. I'll issue a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, I didn't consider this a bug and that's why I didn't "fix" it. Rather than showing a lot of digits in the format, the user should just look at the image to see if the cropping is correct.
If you do for some reason want to enforce "consistency" between the number of digits and the format, the cases where they don't match are fairly easy to spot in the spreadsheet I attached. The fixes are all trivial. Again, I didn't do that because I didn't consider it a good idea, but it is up to you.
The number of digits itself (not the format) is important, because the slider is rounding to them, so if not enough digits are set, the user is unable (even invisibly) to get more precision. That's why I submitted this PR to fix such regressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do for some reason want to enforce "consistency" between the number of digits and the format,
That's not about consistency. What I want is also a fix, on the crop&rotate if you ctrl-scroll on any slider in margin tab, you have no feedback about the change in the value. You need to do 10 changes to see the value go from 0% to 1% for example. I consider this a bug. And this is a regression (due to this PR) as previously the scroll or ctrl-scroll was both changing the value by step of 1%, so always having a visual feedback.
Also, if you edit the slider and enter .5 the value displayed is still 0%. Really a bug to me.
Hope this clarify my thinking.
|
This list may be helpful. Only some of those are actual regressions vs 3.0.2. What I intended to do for 3.4 was to explicitly link digits and format in all cases. Now that only works for the standard format ("%.1f"; setting number of digits also changes the format) but if there needs to be an extension, it needs to be set (again) with a full format ("%.1f%%", "%.2f EV") and it will be overwritten if the number of digits is changed. If instead going forward the format were set with ..._set_format("%%") it could just be concatenated. Actually, I wanted to do this in The question is, should the number of digits automatically be adjusted if the step size is set/changed. dt_bauhause_slider_from_params does this, but it doesn't take "small" steps (holding CTRL) into account (and is overwritten if an explicit format with extension is set). Maybe it would be nice to dynamically adjust I think this could work well (also when users set a custom multiplication factor for ctrl-scroll). Except for values that are calculated by formula and that would have infinite digits... |
|
To be clear; this would be a larger refactor again, touching quite a few bits in bauhaus and needing changes in all modules in setting formats/steps/digits. As part of that I would also like to make soft-min/-max user configurable (both by UI and via lua). And this should be based on a revised input layer exposing this functionality, so quite a few dependencies here. I'll of course write all of this up for discussion/commenting before I start. |
|
Understood, so maybe we should live with the "issue" I reported until 3.4 is out and close #5724 ? |
|
Either way. I have no objection to #5724. I was basically just explaining why I hadn't made that change myself. (So that you didn't think I was just lazy ;-) ) But now that the PR is there, you might as well merge it if you think it looks ok. |
Closes #5707
Hopefully this resolves any serious regressions people experience; nothing more jumps out at me in slider_params.xlsx
This should still be revisited as part of a larger input layer review:
But since this will lead to changes people won't like, there needs to be a way to configure granularly (via lua?) which might be relatively easy/free to achieve as part of a new input layer approach.
All way past 3.2, hence this quick fix for the release.