-
-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Labels
enhancement 🔥New feature or requestNew feature or request
Description
Essentially, having a simple config in LaunchConfig for making the application start centered would be pretty nice.
Currently this does the job.
use winit::dpi::LogicalPosition;
use winit::dpi::Position;
use winapi::um::winuser::{GetSystemMetrics, SM_CXSCREEN, SM_CYSCREEN};
...
#[cfg(target_os = "windows")]
{
let screen_w = unsafe { GetSystemMetrics(SM_CXSCREEN) };
let screen_h = unsafe { GetSystemMetrics(SM_CYSCREEN) };
let x = (screen_w - 1020) / 2;
let y = (screen_h - 620) / 2;
let pos = LogicalPosition::new(x as f64, y as f64);
attrs = attrs.with_position(Position::Logical(pos));
}Metadata
Metadata
Assignees
Labels
enhancement 🔥New feature or requestNew feature or request
Projects
Status
Todo