add window::Id to view

This commit is contained in:
Richard 2022-07-21 09:52:32 -03:00 committed by bungoboingo
parent 01bad4f896
commit 2fe58e1261
2 changed files with 35 additions and 12 deletions

View file

@ -88,7 +88,10 @@ pub trait Application: Sized {
/// Returns the widgets to display in the [`Application`].
///
/// These widgets can produce __messages__ based on user interaction.
fn view(&self) -> Element<'_, Self::Message, crate::Renderer<Self::Theme>>;
fn view(
&self,
window: window::Id,
) -> Element<'_, Self::Message, crate::Renderer<Self::Theme>>;
/// Returns the scale factor of the [`Application`].
///
@ -178,8 +181,11 @@ where
self.0.update(message)
}
fn view(&self) -> Element<'_, Self::Message, Self::Renderer> {
self.0.view()
fn view(
&self,
window: window::Id,
) -> Element<'_, Self::Message, Self::Renderer> {
self.0.view(window)
}
fn theme(&self) -> A::Theme {