WrapperWidget::root_behavior default passthrough

This commit is contained in:
Jonathan Johnson 2024-09-11 14:44:47 -07:00
parent 8eaf0f414f
commit 2becb92f04
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 9 additions and 1 deletions

View file

@ -34,6 +34,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Window::focused` now accepts an `IntoValue` implementor instead of
`IntoDynamic`. Additionally, the initial value is now used to control whether
the OS should initially activate the window when it is opened.
- `WrapperWidget::root_behavior`'s provided implementation now returns
`Some(RootBehavior::PassThrough)` to reflect the general intention of what
`WrapperWidget` implementors are generally doing. Previously, `None` was
returned.
### Changed

View file

@ -532,9 +532,13 @@ pub trait WrapperWidget: Debug + Send + 'static {
/// Returns the behavior this widget should apply when positioned at the
/// root of the window.
///
/// The provided implementation for `WrapperWidget` returns
/// [`RootBehavior::PassThrough`]. This is different from the provided
/// implementation for [`Widget`].
#[allow(unused_variables)]
fn root_behavior(&mut self, context: &mut EventContext<'_>) -> Option<RootBehavior> {
None
Some(RootBehavior::PassThrough)
}
/// Draws the background of the widget.