Skip to content

Commit

Permalink
Supporting inner and outer positions
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Sep 7, 2024
1 parent e725838 commit 7d2d0da
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
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`.
- `Window::position` has been renamed to `Window::outer_position`
- `Window::set_position` has been renamed to `Window::set_outer_position`.

### Fixed

Expand All @@ -31,6 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `WindowBehavior::moved` is invoked when the window is repositioned.
- `Window::outer_size` is a new function that returns the window's size
including decorations.
- `Window::inner_position` returns the position of the top-left of the content
area of the window.

## v0.10.0 (2024-08-20)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,21 @@ where
self.window.close();
}

/// Returns the current position of the window.
/// Returns the current inner position of the window.
#[must_use]
pub fn position(&self) -> Point<Px> {
self.window.position().into()
pub fn inner_position(&self) -> Point<Px> {
self.window.inner_position().into()
}

/// Returns the current outer position of the window.
#[must_use]
pub fn outer_position(&self) -> Point<Px> {
self.window.outer_position().into()
}

/// Sets the current position of the window.
pub fn set_position(&self, position: Point<Px>) {
self.window.set_position(position.into());
/// Sets the current outer position of the window.
pub fn set_outer_position(&self, position: Point<Px>) {
self.window.set_outer_position(position.into());
}

/// Returns the current DPI scale of the window.
Expand Down

0 comments on commit 7d2d0da

Please sign in to comment.