Skip to content

Commit

Permalink
Added winit accessor
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ecton committed Apr 3, 2024
1 parent 44759d4 commit beede55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/animation.rs
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/window.rs
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit beede55

Please sign in to comment.