Activate 100% zoom limit again#21031
Conversation
b3f01dc to
a47afa2
Compare
|
It would be great to receive a review from @dterrahe, as he wrote most of the GTK touchpad / mouse input code and introduced the I'm not sure if we use the
Please correct me if this assumption was wrong. |
1c57c30 to
06965f7
Compare
|
@TurboGit let's wait merging this PR, I wanted to know if there is a simpler solution to re-activating the zoom limit, see message: #21027 (comment) I'm not very happy with the current approach in this PR, which is a kind of a hack to limit zooming. It does not work well, when you do the following:
I believe only reverting #21011 will bring back the old behavior. CC: @masterpiga |
|
I pushed a proper fix by revering #21011 and reverting my previous approach of introducing a hard limit and break the soft-steps. The more I deal with this functionality and code, the less I like it. But let's keep this well-known behavior for release 5.6 and keep the discussion in #21027 going ;) |
d66abf9 to
1061f9c
Compare
|
Works for me, will do.
Ah, I see, I didn't pay attention to this little detail in the
Also sounds good, but I think this should be scoped out for this PR into a separate one, right? |
|
@da-phil : Do not squash the revert though. |
yup. |
This reverts commit b04e36e.
* make scroll limit configurable through config parameter `darkroom/ui/constrain_zoom`, which is TRUE by default, keeping the previous behavior. * refactored the soft-step zooming logic in order to re-use it for pinch-zoom gestures.
1061f9c to
62af432
Compare
|
@TurboGit is the PR tag "default-behavior-change" even correct, given that we keep the same behavior as in the previous release? |
|
@TurboGit @jenshannoschwalm I pushed a new commit with the |
db791d2 to
1bb2a00
Compare
|
Let me have a look... |
| // connect to preference change for module header button hiding | ||
| DT_CONTROL_SIGNAL_HANDLE(DT_SIGNAL_PREFERENCES_CHANGE, _preference_changed_button_hide); | ||
| // keep cached constrain_zoom flag in sync with runtime preference changes | ||
| DT_CONTROL_SIGNAL_HANDLE(DT_SIGNAL_PREFERENCES_CHANGE, _preference_changed_constrain_zoom); |
There was a problem hiding this comment.
You need a DT_CONTROL_SIGNAL_CONNECT and passing as third argument &darktable or DT_CONTROL_SIGNAL_HANDLE as above but in _preference_changed_constrain_zoom use darktable.dev->....
If the later solution is used, it probably make sense to use _preference_changed_button_hide as callback. Just renaming it to something more generic : _preference_changed.
There was a problem hiding this comment.
Thanks, I probably just didn't fully understand how it works and that those settings are already part of the preferences menu.
Please have a look again.
There was a problem hiding this comment.
We can simplify this... As outlined above a single _preference_changed callback can be used. How it works:
- After editing any preferences the signal
DT_SIGNAL_PREFERENCES_CHANGEis emitted. - We don't know what has been changed, but we need to reset all the needed preferences to their new value.
- So we connect to
DT_SIGNAL_PREFERENCES_CHANGEin darkroom.c (a single callback, a single connect of you prefer). - Inside this callback we read all the used preferences and we set the corresponding values in darktable global struct, the pattern is
darktable.develop-><FIELD> = dt_conf_get_<TYPE>(<KEY>);.
Let me know if this clarifies things and if the changes to be done is clear to you. TIA.
There was a problem hiding this comment.
Yes, I thought so too, but that very callback is called twice every time, because it is registered for 2 color intent widgets. I didn't want to also completely refactor this code. But I agree that ideally we should only have one _preference_changed callback per module, as we have way to many unnecessary callbacks all over the place, as also outlined in my comment below:
#21031 (comment)
I'd prefer a separate PR to clean up this and do it properly. But if you think it's fine to extend the scope of this PR, I can already do it in this PR. Your call 😉
There was a problem hiding this comment.
I'd prefer a separate PR to clean up this and do it properly.
I'd prefer in this PR because to me the complexity added here should not be and we can do a clean implementation directly in this PR. Just adding the setting in a current DT_SIGNAL_PREFERENCES_CHANGE callback (just renaming it to be more generic). If I did not missed something it should be as simple as done currently and clean without the need for another PR.
There was a problem hiding this comment.
Alrighty, will do once I'm back at my computer 👌
1bb2a00 to
2106a49
Compare
After another look and knowing how it works I fully agree and would propose the following steps:
|
How about we make that a separate PR? PRs that grow in scope tend to not end well. EDIT: Also, if we are talking about messing with callbacks this should probably be for 5.8 and not something we try and shoehorn into 5.6. |
I never said this should be part of this PR, as I agree with you about not blowing up the scope of this PR, it seems @TurboGit is in favour of doing it though: #21031 (comment) I'm fine either way but would also prefer a separate PR. |
Yes, this change should be part of another PR and probably for 5.8. |
Activate 100% scroll limit again and also make scroll limit configurable through config parameter
darkroom/ui/constrain_zoom, which is TRUE by default, keeping the previousbehavior:
This is an effort to satisfy both use-cases discussed in #21027.
Disclaimer: this work was co-created with Claude.