Skip to content

f42h/wscreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Window Positioning Helper Structure for the Iced GUI Library

Dependencies

Example

fn main() -> iced::Result {
    let resolution = WScreen::new();
    let (pos_x, pos_y) = resolution.coordinates_of(
        ScreenLocations::Center, 
        Some(ApplicationSize {
            width: 350.0,
            height: 370.0,
            ..Default::default()
        })
    );

    iced::application("MyApp", MyApp::update, MyApp::view)
        .window(Settings {
            min_size: Some(iced::Size::new(350.0, 370.0)),
            max_size: Some(iced::Size::new(400.0, 900.0)),
            size: iced::Size::new(350.0, 370.0),
            position: window::Position::Specific(Point::new(pos_x, pos_y)),
            ..Settings::default()
        })
        .run()
}

About

Window Positioning Helper Structure for the Iced GUI Library

Topics

Resources

License

Stars

Watchers

Forks

Languages