Persist window positions when possible

This commit is contained in:
2026-04-07 22:32:43 -04:00
parent c96368da0e
commit ec1fe6e0d3
2 changed files with 40 additions and 13 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
use anyhow::Result;
use clap::Parser;
use egui::{Color32, Vec2};
use egui::{Color32, Pos2, Vec2};
use serde::{Deserialize, Serialize};
use crate::{emulator::SimId, persistence::Persistence, window::DisplayMode};
@@ -75,6 +75,8 @@ pub struct SimConfig {
pub dimensions: Vec2,
#[serde(default = "default_audio_enabled")]
pub audio_enabled: bool,
#[serde(default)]
pub position: Option<Pos2>,
}
impl SimConfig {
@@ -87,6 +89,7 @@ impl SimConfig {
colors: COLOR_PRESETS[0],
dimensions: DisplayMode::Anaglyph.proportions() + Vec2::new(0.0, 22.0),
audio_enabled: true,
position: None,
}
}