G2: return to Settings after dismissing GPU Information

Preserve pending preference edits through the existing OK and Cancel actions.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
sanyamsingh001
2026-10-10 08:46:03 +10:00
co-authored by Codex
parent 9144eef269
commit e4ca1e919a
3 changed files with 125 additions and 1 deletions
+6 -1
View File
@@ -866,6 +866,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;
@@ -879,7 +884,7 @@ pub fn show_info(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) {
});
});
if close {
app.dialog = None;
close_info(app);
}
}