mirror of
https://github.com/danbulant/cushy
synced 2026-06-17 13:31:07 +00:00
Added winit accessor
I originally removed this API to ensure no Cushy widgets were using winit directly, but I've reintroduced it so that third party widgets can still interact with winit if needed.
This commit is contained in:
parent
44759d4812
commit
beede55f0a
2 changed files with 7 additions and 3 deletions
|
|
@ -428,9 +428,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// A [`Animate`] implementor that has been boxed as a trait object.
|
||||
pub struct BoxedAnimation(Box<dyn Animate>);
|
||||
|
||||
/// An animation that can be spawned.
|
||||
pub trait Spawn {
|
||||
/// Spawns the animation, returning a handle that tracks the animation.
|
||||
|
|
|
|||
|
|
@ -245,6 +245,9 @@ pub trait PlatformWindow {
|
|||
fn set_min_inner_size(&self, min_size: Option<Size<UPx>>);
|
||||
/// Sets the window's maximum inner size.
|
||||
fn set_max_inner_size(&self, max_size: Option<Size<UPx>>);
|
||||
|
||||
/// Returns a handle to the underlying winit window, if available.
|
||||
fn winit(&self) -> Option<&winit::window::Window>;
|
||||
}
|
||||
|
||||
/// A currently running Cushy window.
|
||||
|
|
@ -436,6 +439,10 @@ where
|
|||
fn set_ime_location(&self, location: Rect<Px>) {
|
||||
self.window.set_ime_location(location);
|
||||
}
|
||||
|
||||
fn winit(&self) -> Option<&winit::window::Window> {
|
||||
self.window.winit()
|
||||
}
|
||||
}
|
||||
|
||||
/// The attributes of a Cushy window.
|
||||
|
|
|
|||
Loading…
Reference in a new issue