Merge branch 'master' into feature/test-recorder

This commit is contained in:
Héctor Ramón Jiménez 2025-07-08 00:29:55 +02:00
commit 98d8f466bb
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
98 changed files with 643 additions and 204 deletions

View file

@ -6,6 +6,8 @@ use crate::time::Instant;
use crate::window;
use crate::{Element, Program, Settings, Subscription, Task};
use iced_debug as debug;
/// Creates an [`Application`] with an `update` function that also
/// takes the [`Instant`] of each `Message`.
///
@ -101,10 +103,12 @@ where
state: &mut Self::State,
(message, now): Self::Message,
) -> Task<Self::Message> {
self.update
.update(state, message, now)
.into()
.map(|message| (message, Instant::now()))
debug::hot(move || {
self.update
.update(state, message, now)
.into()
.map(|message| (message, Instant::now()))
})
}
fn view<'a>(
@ -112,16 +116,21 @@ where
state: &'a Self::State,
_window: window::Id,
) -> Element<'a, Self::Message, Self::Theme, Self::Renderer> {
self.view
.view(state)
.map(|message| (message, Instant::now()))
debug::hot(|| {
self.view
.view(state)
.map(|message| (message, Instant::now()))
})
}
fn subscription(
&self,
state: &Self::State,
) -> self::Subscription<Self::Message> {
(self.subscription)(state).map(|message| (message, Instant::now()))
debug::hot(|| {
(self.subscription)(state)
.map(|message| (message, Instant::now()))
})
}
}