Replace Command with a new Task API with chain support

This commit is contained in:
Héctor Ramón Jiménez 2024-06-14 01:47:39 +02:00
parent e6d0b3bda5
commit a25b1af456
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
74 changed files with 1351 additions and 1767 deletions

View file

@ -13,7 +13,7 @@ use crate::core::{
Padding, Pixels, Point, Rectangle, Shadow, Shell, Size, Theme, Vector,
Widget,
};
use crate::runtime::Command;
use crate::runtime::Task;
/// An element decorating some content.
///
@ -258,7 +258,7 @@ where
tree: &mut Tree,
layout: Layout<'_>,
renderer: &Renderer,
operation: &mut dyn Operation<Message>,
operation: &mut dyn Operation<()>,
) {
operation.container(
self.id.as_ref().map(|id| &id.0),
@ -457,9 +457,9 @@ impl From<Id> for widget::Id {
}
}
/// Produces a [`Command`] that queries the visible screen bounds of the
/// Produces a [`Task`] that queries the visible screen bounds of the
/// [`Container`] with the given [`Id`].
pub fn visible_bounds(id: Id) -> Command<Option<Rectangle>> {
pub fn visible_bounds(id: Id) -> Task<Option<Rectangle>> {
struct VisibleBounds {
target: widget::Id,
depth: usize,
@ -538,7 +538,7 @@ pub fn visible_bounds(id: Id) -> Command<Option<Rectangle>> {
}
}
Command::widget(VisibleBounds {
Task::widget(VisibleBounds {
target: id.into(),
depth: 0,
scrollables: Vec::new(),