Draft widget operations

This commit is contained in:
Héctor Ramón Jiménez 2022-07-28 02:46:51 +02:00
parent a003e797e8
commit 80688689aa
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
16 changed files with 395 additions and 55 deletions

View file

@ -17,6 +17,7 @@ pub mod column;
pub mod container;
pub mod helpers;
pub mod image;
pub mod operation;
pub mod pane_grid;
pub mod pick_list;
pub mod progress_bar;
@ -26,6 +27,7 @@ pub mod rule;
pub mod scrollable;
pub mod slider;
pub mod space;
pub mod state;
pub mod svg;
pub mod text;
pub mod text_input;
@ -33,6 +35,9 @@ pub mod toggler;
pub mod tooltip;
pub mod tree;
mod action;
mod id;
#[doc(no_inline)]
pub use button::Button;
#[doc(no_inline)]
@ -76,6 +81,10 @@ pub use tooltip::Tooltip;
#[doc(no_inline)]
pub use tree::Tree;
pub use action::Action;
pub use id::Id;
pub use operation::Operation;
use crate::event::{self, Event};
use crate::layout;
use crate::mouse;
@ -159,6 +168,14 @@ where
/// Reconciliates the [`Widget`] with the provided [`Tree`].
fn diff(&self, _tree: &mut Tree) {}
/// Applies an [`Operation`] to the [`Widget`].
fn operate(
&self,
_layout: Layout<'_>,
_operation: &mut dyn Operation<Message>,
) {
}
/// Processes a runtime [`Event`].
///
/// By default, it does nothing.