WindowBehavior::moved

This commit is contained in:
Jonathan Johnson 2024-09-07 07:05:43 -07:00
parent 4cab6aedd1
commit 90669b6b8a
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 10 additions and 1 deletions

View file

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `PendingApp::on_startup` accepts a callback that will be invoked once the
event loop is executing.
- `WindowBehavior::moved` is called when the window moves.
### Changed

View file

@ -581,7 +581,10 @@ where
}
}
WindowEvent::Moved(position) => {
self.position = position;
if self.position != position {
self.position = position;
behavior.moved(self);
}
}
WindowEvent::Destroyed => {
return HandleMessageResult::Destroyed;
@ -979,6 +982,11 @@ where
#[allow(unused_variables)]
fn resized(&mut self, window: &mut RunningWindow<AppMessage>) {}
/// The window has been moved. [`RunningWindow::position()`] returns the
/// current position.
#[allow(unused_variables)]
fn moved(&mut self, window: &mut RunningWindow<AppMessage>) {}
/// The window's theme has been updated. [`RunningWindow::theme()`]
/// returns the current theme.
#[allow(unused_variables)]