mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
committed by
GitHub
parent
2464a135b3
commit
8440091a4e
@@ -42,8 +42,8 @@ const BACKEND_PREFERENCE_ENV_VAR: &str = "WINIT_UNIX_BACKEND";
|
||||
pub struct PlatformSpecificWindowBuilderAttributes {
|
||||
pub visual_infos: Option<XVisualInfo>,
|
||||
pub screen_id: Option<i32>,
|
||||
pub resize_increments: Option<(i32, i32)>,
|
||||
pub base_size: Option<(i32, i32)>,
|
||||
pub resize_increments: Option<(u32, u32)>,
|
||||
pub base_size: Option<(u32, u32)>,
|
||||
}
|
||||
|
||||
lazy_static!(
|
||||
|
||||
@@ -488,6 +488,7 @@ pub struct PlatformSpecificWindowBuilderAttributes {
|
||||
pub titlebar_hidden: bool,
|
||||
pub titlebar_buttons_hidden: bool,
|
||||
pub fullsize_content_view: bool,
|
||||
pub resize_increments: Option<(u32, u32)>,
|
||||
}
|
||||
|
||||
pub struct Window2 {
|
||||
@@ -771,6 +772,13 @@ impl Window2 {
|
||||
if pl_attrs.movable_by_window_background {
|
||||
window.setMovableByWindowBackground_(YES);
|
||||
}
|
||||
|
||||
if let Some((x, y)) = pl_attrs.resize_increments {
|
||||
if x >= 1 && y >= 1 {
|
||||
let size = NSSize::new(x as _, y as _);
|
||||
window.setResizeIncrements_(size);
|
||||
}
|
||||
}
|
||||
|
||||
window.center();
|
||||
window
|
||||
|
||||
Reference in New Issue
Block a user