Assign each IconButton an ID based on the icon

This commit is contained in:
Marshall Bowers 2023-10-19 16:50:33 -04:00
parent 28b29d0985
commit 94f0140f62
2 changed files with 3 additions and 3 deletions

View file

@ -88,8 +88,8 @@ impl<S: 'static + Send + Sync> IconButton<S> {
}; };
let mut button = h_stack() let mut button = h_stack()
// TODO: We need to pass the ID in so that `IconButton`s can be differentiated from one another. // TODO: We probably need a more robust method for differentiating `IconButton`s from one another.
.id("icon_button") .id(SharedString::from(format!("{:?}", self.icon)))
.justify_center() .justify_center()
.rounded_md() .rounded_md()
.py(ui_size(cx, 0.25)) .py(ui_size(cx, 0.25))

View file

@ -44,7 +44,7 @@ impl IconColor {
} }
} }
#[derive(Default, PartialEq, Copy, Clone, EnumIter)] #[derive(Debug, Default, PartialEq, Copy, Clone, EnumIter)]
pub enum Icon { pub enum Icon {
Ai, Ai,
ArrowLeft, ArrowLeft,