mirror of
https://github.com/danbulant/appit
synced 2026-07-05 11:00:47 +00:00
WindowBehavior::moved
This commit is contained in:
parent
4cab6aedd1
commit
90669b6b8a
2 changed files with 10 additions and 1 deletions
|
|
@ -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
|
- `PendingApp::on_startup` accepts a callback that will be invoked once the
|
||||||
event loop is executing.
|
event loop is executing.
|
||||||
|
- `WindowBehavior::moved` is called when the window moves.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -581,7 +581,10 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WindowEvent::Moved(position) => {
|
WindowEvent::Moved(position) => {
|
||||||
self.position = position;
|
if self.position != position {
|
||||||
|
self.position = position;
|
||||||
|
behavior.moved(self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
WindowEvent::Destroyed => {
|
WindowEvent::Destroyed => {
|
||||||
return HandleMessageResult::Destroyed;
|
return HandleMessageResult::Destroyed;
|
||||||
|
|
@ -979,6 +982,11 @@ where
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
fn resized(&mut self, window: &mut RunningWindow<AppMessage>) {}
|
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()`]
|
/// The window's theme has been updated. [`RunningWindow::theme()`]
|
||||||
/// returns the current theme.
|
/// returns the current theme.
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue