Center window in game_of_life example

This commit is contained in:
Héctor Ramón Jiménez 2021-07-21 19:10:11 +07:00
parent 72b3bf95de
commit 39b8f7de50
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -9,6 +9,7 @@ use iced::executor;
use iced::pick_list::{self, PickList};
use iced::slider::{self, Slider};
use iced::time;
use iced::window;
use iced::{
Align, Application, Checkbox, Clipboard, Column, Command, Container,
Element, Length, Row, Settings, Subscription, Text,
@ -19,6 +20,10 @@ use std::time::{Duration, Instant};
pub fn main() -> iced::Result {
GameOfLife::run(Settings {
antialiasing: true,
window: window::Settings {
position: window::Position::Centered,
..window::Settings::default()
},
..Settings::default()
})
}