Expose reusable Button logic
... and reuse it in `iced_pure`!
This commit is contained in:
parent
01c5004959
commit
ecb3df8e01
5 changed files with 228 additions and 247 deletions
|
|
@ -58,4 +58,18 @@ impl Tree {
|
|||
*self = Self::new(new);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn state<T>(&self) -> &T
|
||||
where
|
||||
T: 'static,
|
||||
{
|
||||
self.state.downcast_ref().expect("Downcast widget state")
|
||||
}
|
||||
|
||||
pub fn state_mut<T>(&mut self) -> &mut T
|
||||
where
|
||||
T: 'static,
|
||||
{
|
||||
self.state.downcast_mut().expect("Downcast widget state")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue