Label text update methods
This commit is contained in:
parent
1e43b0a2c4
commit
4a091bd206
|
@ -48,6 +48,12 @@ impl RoundButton {
|
|||
icon,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_text(&mut self, text: &str) {
|
||||
if let Some(icon) = self.icon.as_mut() {
|
||||
icon.set_text(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Button for RoundButton {
|
||||
|
|
|
@ -128,6 +128,14 @@ impl Icon {
|
|||
offset: Vec2::ZERO,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_text(&mut self, text: &str) {
|
||||
if self.text.text != text {
|
||||
self.text.text = text.to_string();
|
||||
self.layout = None;
|
||||
self.dirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Widget for Icon {
|
||||
|
|
Loading…
Reference in New Issue