From c897cb65377020f5800d1ac4232e8f51582f97a3 Mon Sep 17 00:00:00 2001 From: Artyom Sinyugin Date: Thu, 19 Dec 2024 19:31:14 +0300 Subject: [PATCH] xilem: Condition from ViewMarker rebuild for Button was removed, because 'this check is not needed - the rebuild internally will re-do the same work' --- xilem/src/view/button.rs | 18 ++++++++---------- xilem/src/view/label.rs | 4 +--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/xilem/src/view/button.rs b/xilem/src/view/button.rs index a8f87532a..efc96bd33 100644 --- a/xilem/src/view/button.rs +++ b/xilem/src/view/button.rs @@ -53,6 +53,7 @@ where fn build(&self, ctx: &mut ViewCtx) -> (Self::Element, Self::ViewState) { ctx.with_leaf_action_widget(|ctx| { ctx.new_pod(widget::Button::from_label( + // TODO: Use `Label::build` here - currently impossible because `Pod` uses `WidgetPod` internally widget::Label::new(self.label.label.clone()) .with_brush(self.label.text_brush.clone()) .with_alignment(self.label.alignment) @@ -70,16 +71,13 @@ where ctx: &mut ViewCtx, mut element: Mut, ) { - if prev.label != self.label { - let child = widget::Button::label_mut(&mut element); -