Merge pull request #512 from sanyamsingh001/fix/settings-info-return

This commit is contained in:
Claude
2026-10-10 12:49:17 +00:00
3 changed files with 125 additions and 1 deletions
+6 -1
View File
@@ -879,6 +879,11 @@ pub fn show_form(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) {
}
}
/// Close the information dialog without abandoning a pending Settings transaction.
pub(crate) fn close_info(app: &mut EffectcraftApp) {
app.dialog = app.dialog_state.prefs_snapshot.is_some().then_some(Dialog::Settings);
}
pub fn show_info(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) {
let (title, body) = app.dialog_state.info.clone();
let mut close = false;
@@ -892,7 +897,7 @@ pub fn show_info(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) {
});
});
if close {
app.dialog = None;
close_info(app);
}
}