wip rebase updates
This commit is contained in:
parent
86dcf8af6c
commit
e10459fb37
68 changed files with 1776 additions and 1544 deletions
|
|
@ -11,62 +11,62 @@ pub trait Dropdown {
|
|||
fn open(&mut self);
|
||||
}
|
||||
|
||||
/// Produces a [`Task`] that closes a [`Dropdown`] popup.
|
||||
pub fn close<T>(id: Id) -> impl Operation<T> {
|
||||
struct Close(Id);
|
||||
// /// Produces a [`Task`] that closes a [`Dropdown`] popup.
|
||||
// pub fn close<T>(id: Id) -> impl Operation<T> {
|
||||
// struct Close(Id);
|
||||
|
||||
impl<T> Operation<T> for Close {
|
||||
fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
|
||||
if id.map_or(true, |id| id != &self.0) {
|
||||
return;
|
||||
}
|
||||
// impl<T> Operation<T> for Close {
|
||||
// fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
|
||||
// if id.map_or(true, |id| id != &self.0) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
let Some(state) = state.downcast_mut::<State>() else {
|
||||
return;
|
||||
};
|
||||
// let Some(state) = state.downcast_mut::<State>() else {
|
||||
// return;
|
||||
// };
|
||||
|
||||
state.close();
|
||||
}
|
||||
// state.close();
|
||||
// }
|
||||
|
||||
fn container(
|
||||
&mut self,
|
||||
_id: Option<&Id>,
|
||||
_bounds: Rectangle,
|
||||
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
|
||||
) {
|
||||
operate_on_children(self)
|
||||
}
|
||||
}
|
||||
// fn container(
|
||||
// &mut self,
|
||||
// _id: Option<&Id>,
|
||||
// _bounds: Rectangle,
|
||||
// operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
|
||||
// ) {
|
||||
// operate_on_children(self)
|
||||
// }
|
||||
// }
|
||||
|
||||
Close(id)
|
||||
}
|
||||
// Close(id)
|
||||
// }
|
||||
|
||||
/// Produces a [`Task`] that opens a [`Dropdown`] popup.
|
||||
pub fn open<T>(id: Id) -> impl Operation<T> {
|
||||
struct Open(Id);
|
||||
// /// Produces a [`Task`] that opens a [`Dropdown`] popup.
|
||||
// pub fn open<T>(id: Id) -> impl Operation<T> {
|
||||
// struct Open(Id);
|
||||
|
||||
impl<T> Operation<T> for Open {
|
||||
fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
|
||||
if id.map_or(true, |id| id != &self.0) {
|
||||
return;
|
||||
}
|
||||
// impl<T> Operation<T> for Open {
|
||||
// fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
|
||||
// if id.map_or(true, |id| id != &self.0) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
let Some(state) = state.downcast_mut::<State>() else {
|
||||
return;
|
||||
};
|
||||
// let Some(state) = state.downcast_mut::<State>() else {
|
||||
// return;
|
||||
// };
|
||||
|
||||
state.open();
|
||||
}
|
||||
// state.open();
|
||||
// }
|
||||
|
||||
fn container(
|
||||
&mut self,
|
||||
_id: Option<&Id>,
|
||||
_bounds: Rectangle,
|
||||
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
|
||||
) {
|
||||
operate_on_children(self)
|
||||
}
|
||||
}
|
||||
// fn container(
|
||||
// &mut self,
|
||||
// _id: Option<&Id>,
|
||||
// _bounds: Rectangle,
|
||||
// operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
|
||||
// ) {
|
||||
// operate_on_children(self)
|
||||
// }
|
||||
// }
|
||||
|
||||
Open(id)
|
||||
}
|
||||
// Open(id)
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue