Persist advanced options expand/collapse state per section

Each ExpanderRow now remembers its expanded state between sessions
using a per-section key stored in SessionState. Replaces the global
detailed_mode toggle with granular per-section persistence.
This commit is contained in:
2026-03-06 17:49:07 +02:00
parent d8bb1a726a
commit afabdf3548
7 changed files with 58 additions and 4 deletions

View File

@@ -372,9 +372,16 @@ pub fn build_resize_page(state: &AppState) -> adw::NavigationPage {
.title("Advanced Options")
.subtitle("Resize algorithm, DPI, upscale behavior")
.show_enable_switch(false)
.expanded(state.detailed_mode)
.expanded(state.is_section_expanded("resize-advanced"))
.build();
{
let st = state.clone();
advanced_expander.connect_expanded_notify(move |row| {
st.set_section_expanded("resize-advanced", row.is_expanded());
});
}
let upscale_row = adw::SwitchRow::builder()
.title("Allow Upscaling")
.subtitle("Enlarge images smaller than target size")