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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user