Skip to content

Commit

Permalink
xilem: rebuild method for button fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Artyom Sinyugin committed Dec 19, 2024
1 parent 406641d commit 9866682
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions xilem/src/view/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,19 @@ where
fn rebuild(
&self,
prev: &Self,
_state: &mut Self::ViewState,
_ctx: &mut ViewCtx,
state: &mut Self::ViewState,
ctx: &mut ViewCtx,
mut element: Mut<Self::Element>,
) {
if prev.label != self.label {
widget::Button::set_text(&mut element, self.label.label.clone());
let child = widget::Button::label_mut(&mut element);
<Label as View<State, Action, ViewCtx>>::rebuild(
&self.label,
&prev.label,
state,
ctx,
child,
);
}
}

Expand Down

0 comments on commit 9866682

Please sign in to comment.