gui: apply previous screen size before launch
This commit is contained in:
parent
2dc838f85c
commit
b696f50f8c
@ -14,6 +14,7 @@ use liana::miniscript::bitcoin;
|
||||
use liana_ui::{component::text, font, image, theme};
|
||||
|
||||
use liana_gui::{
|
||||
app::settings::global::{GlobalSettings, WindowConfig},
|
||||
dir::LianaDirectory,
|
||||
gui::{Config, GUI},
|
||||
node::bitcoind::delete_all_bitcoind_locks_for_process,
|
||||
@ -106,8 +107,20 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
fonts: font::load(),
|
||||
};
|
||||
|
||||
let global_config_path = GlobalSettings::path(&config.liana_directory);
|
||||
let initial_size = if let Ok(Some(GlobalSettings {
|
||||
window_config: Some(WindowConfig { width, height }),
|
||||
..
|
||||
})) = GlobalSettings::load(&global_config_path)
|
||||
{
|
||||
Size { width, height }
|
||||
} else {
|
||||
iced::window::Settings::default().size
|
||||
};
|
||||
|
||||
#[allow(unused_mut)]
|
||||
let mut window_settings = iced::window::Settings {
|
||||
size: initial_size,
|
||||
icon: Some(image::liana_app_icon()),
|
||||
position: iced::window::Position::Default,
|
||||
min_size: Some(Size {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user