fix: scroll to correct module when navigating from Quick Access Panel#20306
Conversation
|
Do you have a reproducer? Seems like it needs some special procedure as not reproducing in all cases. As we are at it, while testing I found another issue worth fixing at the same time.
See that it moves to tone tab but all modules (except exposure) are collapsed. Seems like this violate the preference. Can you have a look at this? TIA. |
|
Yes, reproduces here. Will check the second issue too. |
When clicking 'go to full version...' in the Quick Access Panel (QAP), the view sometimes scrolled to the wrong module (e.g. the previously focused one instead of the target). Root causes and fixes: 1. dtgtk_expander_set_expanded() was a no-op when the expander was already in the expanded state. Added an 'else if(expanded)' branch that updates _last_expanded and _start_pos, and calls gtk_widget_queue_resize() to ensure _expander_resize fires. 2. _expander_resize() checked height_changed before _last_expanded, so modules with stale GTK_STATE_FLAG_SELECTED (from previous images) could steal the scroll target. Restructured to check _last_expanded first: when set, only that specific widget can trigger scroll, and we wait until it has a positive allocated height before proceeding. 3. _basics_goto_module() always passed collapse_others=TRUE, ignoring the 'darkroom/ui/single_module' user preference. Now reads the preference and only collapses others when single_module is enabled. Fixes: darktable-org#19692
42bcb1a to
286c3b5
Compare
|
I've updated the PR to address both issues. Reproducer for the scroll-to-wrong-module bug:
The root cause is twofold:
Preference violation fix: Good catch — Testing note: I've tested the scenarios above and they are resolved, but the interaction between async tab switching (
If you find a scenario that still misbehaves, please let me know and I'll investigate. |
TurboGit
left a comment
There was a problem hiding this comment.
Tested with different scenario, working on my side now. Thanks!
When clicking 'go to full version' in the Quick Access Panel, the view would sometimes scroll to a wrong module (though the correct tab was always selected). This happened because dtgtk_expander_set_expanded() was a no-op when the target module was already expanded, leaving stale _last_expanded and _start_pos values from a previous expansion. The _expander_resize callback would then either skip scrolling or scroll to the wrong widget.
Add an 'else if(expanded)' branch that updates scroll tracking even when the expander state hasn't changed. Setting _start_pos.height to 0 ensures _expander_resize detects a size change and triggers scrolling.
Fixes: #19692