fix: refresh lighttable layout buttons when leaving full preview - #21785
Open
Arecsu wants to merge 1 commit into
Open
fix: refresh lighttable layout buttons when leaving full preview#21785Arecsu wants to merge 1 commit into
Arecsu wants to merge 1 commit into
Conversation
Closing the main window while in full preview exits preview instead of quitting darktable, but left the full-preview layout icon stuck in its active state: _preview_quit() cleared the preview flag and restored the file manager thumbtable without refreshing the layout buttons. The icons are driven declaratively from the view state via _lib_lighttable_update_btn(), so they only corrected themselves after the next layout button interaction. Refresh the buttons from _preview_quit() -- the single canonical "preview off" path -- so every exit route (window close, layout buttons, accelerators) keeps the toolbar icons in sync. Reported as a side observation in darktable-org#21782.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the side observation in #21782 — closing the main window while in full preview (which exits preview instead of quitting darktable) left the full-preview layout icon stuck in its active state, even though the view had dropped back to the file manager. The icon only corrected itself after the next layout button interaction.
The icons are driven declaratively from the view state:
dt_view_lighttable_update_layout_buttons()→_lib_lighttable_update_btn()re-declares the active button from the layout and preview flags, so any state change that skips that refresh leaves the icons stale._preview_quit()clears the preview flag and restores the thumbtable but never refreshed the buttons.The fix calls
dt_view_lighttable_update_layout_buttons()from_preview_quit()— the single canonical "preview off" path — so window close, the layout buttons and the accelerators all keep the toolbar in sync.Note: the buggy code path exists identically in 5.6, so this predates the event-controller conversion; the conversion (where the icons became purely declarative) just made the missing refresh observable.
CC @wpferguson