mirror of
https://github.com/danbulant/appit
synced 2026-05-19 04:08:34 +00:00
Added min/max window size
This commit is contained in:
parent
91c540c2a2
commit
043bfe2c78
1 changed files with 12 additions and 2 deletions
|
|
@ -195,7 +195,7 @@ where
|
|||
// avoid a "frozen" window causing massive memory allocations, we'll use
|
||||
// a fixed-size channel and be cautious to not block the main event loop
|
||||
// by always using try_send.
|
||||
let (sender, receiver) = mpsc::sync_channel(1024);
|
||||
let (sender, receiver) = mpsc::sync_channel(65536);
|
||||
let Some(winit) = self.owner.open(self.attributes, sender.clone())? else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
|
@ -317,10 +317,20 @@ where
|
|||
}
|
||||
|
||||
/// Sets the window's title to `new_title`.
|
||||
pub fn set_title(&mut self, new_title: &str) {
|
||||
pub fn set_title(&self, new_title: &str) {
|
||||
self.window.set_title(new_title);
|
||||
}
|
||||
|
||||
/// Sets the window's minimum inner size.
|
||||
pub fn set_min_inner_size(&self, min_size: Option<PhysicalSize<u32>>) {
|
||||
self.window.set_min_inner_size(min_size);
|
||||
}
|
||||
|
||||
/// Sets the window's maximum inner size.
|
||||
pub fn set_max_inner_size(&self, max_size: Option<PhysicalSize<u32>>) {
|
||||
self.window.set_max_inner_size(max_size);
|
||||
}
|
||||
|
||||
/// Returns the current size of the interior of the window, in pixels.
|
||||
#[must_use]
|
||||
pub const fn inner_size(&self) -> PhysicalSize<u32> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue