Introduce black_box and chain in widget::operation
This commit is contained in:
parent
d5ffe98ce9
commit
422568dee4
31 changed files with 232 additions and 67 deletions
|
|
@ -59,7 +59,7 @@ pub enum Action<T> {
|
|||
},
|
||||
|
||||
/// Run a widget operation.
|
||||
Widget(Box<dyn widget::Operation<()>>),
|
||||
Widget(Box<dyn widget::Operation>),
|
||||
|
||||
/// Run a clipboard action.
|
||||
Clipboard(clipboard::Action),
|
||||
|
|
@ -79,7 +79,7 @@ pub enum Action<T> {
|
|||
|
||||
impl<T> Action<T> {
|
||||
/// Creates a new [`Action::Widget`] with the given [`widget::Operation`].
|
||||
pub fn widget(operation: impl widget::Operation<()> + 'static) -> Self {
|
||||
pub fn widget(operation: impl widget::Operation + 'static) -> Self {
|
||||
Self::Widget(Box::new(operation))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ where
|
|||
pub fn operate(
|
||||
&mut self,
|
||||
renderer: &mut P::Renderer,
|
||||
operations: impl Iterator<Item = Box<dyn Operation<()>>>,
|
||||
operations: impl Iterator<Item = Box<dyn Operation>>,
|
||||
bounds: Size,
|
||||
debug: &mut Debug,
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -131,13 +131,13 @@ where
|
|||
&mut self,
|
||||
layout: Layout<'_>,
|
||||
renderer: &Renderer,
|
||||
operation: &mut dyn widget::Operation<()>,
|
||||
operation: &mut dyn widget::Operation,
|
||||
) {
|
||||
fn recurse<Message, Theme, Renderer>(
|
||||
element: &mut overlay::Element<'_, Message, Theme, Renderer>,
|
||||
layout: Layout<'_>,
|
||||
renderer: &Renderer,
|
||||
operation: &mut dyn widget::Operation<()>,
|
||||
operation: &mut dyn widget::Operation,
|
||||
) where
|
||||
Renderer: renderer::Renderer,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ where
|
|||
pub fn operate(
|
||||
&mut self,
|
||||
renderer: &mut P::Renderer,
|
||||
operations: impl Iterator<Item = Box<dyn Operation<()>>>,
|
||||
operations: impl Iterator<Item = Box<dyn Operation>>,
|
||||
bounds: Size,
|
||||
debug: &mut Debug,
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ where
|
|||
pub fn operate(
|
||||
&mut self,
|
||||
renderer: &Renderer,
|
||||
operation: &mut dyn widget::Operation<()>,
|
||||
operation: &mut dyn widget::Operation,
|
||||
) {
|
||||
self.root.as_widget().operate(
|
||||
&mut self.state,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue