Persist window positions when possible
This commit is contained in:
+4
-1
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user