diff --git a/CHANGELOG.md b/CHANGELOG.md index 3144090c3..28157f914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `appit::App`. The previously exported type wasn't able to be used beyond passing it as a parameter for opening additional windows. This new type exposes additional winit information including monitor configurations. +- `Window::ocluded` has had its spelling fixed and is now `Window::occluded`. ### Fixed @@ -28,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 about the monitor configurations available to the application. This information can be retrieved from an `App` or `ExecutingApp`. - `WindowBehavior::moved` is invoked when the window is repositioned. +- `Window::outer_size` is a new function that returns the window's size + including decorations. ## v0.10.0 (2024-08-20) diff --git a/Cargo.lock b/Cargo.lock index c0a1ffd45..cec222294 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,7 +106,7 @@ checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" [[package]] name = "appit" version = "0.3.2" -source = "git+https://github.com/khonsulabs/appit#90669b6b8ab18978955a2d148ccdd1abb0b38c49" +source = "git+https://github.com/khonsulabs/appit#35e011dc9299d037539b7e48b1f61be5c07d528c" dependencies = [ "winit", ] diff --git a/src/app.rs b/src/app.rs index 19a46ba79..7fafed28a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -302,6 +302,12 @@ where self.window.set_inner_size(inner_size.into()); } + /// Returns the size of the window, including decorations. + #[must_use] + pub fn outer_size(&self) -> Size { + self.window.outer_size().into() + } + /// Returns true if the window is currently focused for keyboard input. #[must_use] pub const fn focused(&self) -> bool { @@ -317,7 +323,7 @@ where /// Returns true if the window is currenly not visible because it is /// completely hidden behind other windows, offcreen, or minimized. #[must_use] - pub const fn ocluded(&self) -> bool { + pub const fn occluded(&self) -> bool { self.window.occluded() } @@ -576,8 +582,8 @@ where /// /// # Errors /// - /// The only errors this funciton can return arise from - /// [`winit::window::WindowBuilder::build`]. + /// The only errors this funciton can return arise from winit's + /// `create_window`. fn open(app: &mut App) -> Result>, OsError> where App: AsApplication> + ?Sized, @@ -596,8 +602,8 @@ where /// /// # Errors /// - /// The only errors this funciton can return arise from - /// [`winit::window::WindowBuilder::build`]. + /// The only errors this funciton can return arise from winit's + /// `create_window`. fn open_with( app: &mut App, context: Self::Context, @@ -624,33 +630,33 @@ where true } - /// The window has gained or lost keyboard focus. - /// [`RunningWindow::focused()`] returns the current state. + /// The window has gained or lost keyboard focus. [`Window::focused()`] + /// returns the current state. #[allow(unused_variables)] fn focus_changed(&mut self, window: Window<'_, WindowEvent>, kludgine: &mut Kludgine) {} - /// The window has been occluded or revealed. [`RunningWindow::occluded()`] - /// returns the current state. + /// The window has been occluded or revealed. [`Window::occluded()`] returns + /// the current state. #[allow(unused_variables)] fn occlusion_changed(&mut self, window: Window<'_, WindowEvent>, kludgine: &mut Kludgine) {} - /// The window's scale factor has changed. [`RunningWindow::scale()`] - /// returns the current scale. + /// The window's scale factor has changed. [`Window::scale()`] returns the + /// current scale. #[allow(unused_variables)] fn scale_factor_changed(&mut self, window: Window<'_, WindowEvent>, kludgine: &mut Kludgine) {} - /// The window has been resized. [`RunningWindow::inner_size()`] - /// returns the current size. + /// The window has been resized. [`Window::inner_size()`] returns the + /// current size. #[allow(unused_variables)] fn resized(&mut self, window: Window<'_, WindowEvent>, kludgine: &mut Kludgine) {} - /// The window has been moved. [`RunningWindow::position()`] returns the - /// current position. + /// The window has been moved. [`Window::position()`] returns the current + /// position. #[allow(unused_variables)] fn moved(&mut self, window: Window<'_, WindowEvent>, kludgine: &mut Kludgine) {} - /// The window's theme has been updated. [`RunningWindow::theme()`] - /// returns the current theme. + /// The window's theme has been updated. [`Window::theme()`] returns the + /// current theme. #[allow(unused_variables)] fn theme_changed(&mut self, window: Window<'_, WindowEvent>, kludgine: &mut Kludgine) {} @@ -701,8 +707,8 @@ where ) { } - /// The keyboard modifier keys have changed. [`RunningWindow::modifiers()`] - /// returns the current modifier keys state. + /// The keyboard modifier keys have changed. [`Window::modifiers()`] returns + /// the current modifier keys state. #[allow(unused_variables)] fn modifiers_changed(&mut self, window: Window<'_, WindowEvent>, kludgine: &mut Kludgine) {} diff --git a/src/lib.rs b/src/lib.rs index 16e92a3f4..5b981f973 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -307,7 +307,7 @@ impl Frame<'_> { /// - [`Texture::prepare`] /// - [`Texture::prepare_partial`] /// - [`CollectedTexture::prepare`] - /// - [`Drawing::new_frame`](render::Drawing::new_frame) + /// - [`Drawing::new_frame`](drawing::Drawing::new_frame) /// /// The returned graphics provides access to the various types to update /// their representation on the GPU so that they can be rendered later. @@ -324,7 +324,7 @@ impl Frame<'_> { /// /// - [`PreparedGraphic`] /// - [`PreparedText`](text::PreparedText) - /// - [`Drawing`](render::Drawing) + /// - [`Drawing`](drawing::Drawing) #[must_use] pub fn render<'gfx, 'pass>( &'pass mut self, @@ -353,7 +353,7 @@ impl Frame<'_> { /// /// - [`PreparedGraphic`] /// - [`PreparedText`](text::PreparedText) - /// - [`Drawing`](render::Drawing) + /// - [`Drawing`](drawing::Drawing) pub fn render_into<'gfx, 'pass>( &'pass mut self, texture: &'pass Texture, @@ -544,7 +544,7 @@ impl ClipStack { /// - [`Texture::prepare`] /// - [`Texture::prepare_partial`] /// - [`CollectedTexture::prepare`] -/// - [`Drawing::new_frame`](render::Drawing::new_frame) +/// - [`Drawing::new_frame`](drawing::Drawing::new_frame) #[derive(Debug)] pub struct Graphics<'gfx> { kludgine: &'gfx mut Kludgine, @@ -658,7 +658,7 @@ impl sealed::Clipped for Graphics<'_> {} /// /// - [`PreparedGraphic`] /// - [`PreparedText`](text::PreparedText) -/// - [`Drawing`](render::Drawing) +/// - [`Drawing`](drawing::Drawing) pub struct RenderingGraphics<'gfx, 'pass> { pass: wgpu::RenderPass<'pass>, kludgine: &'pass Kludgine,