From 9f6c62a5a91246424284fc49ec6eafa398397ff7 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Fri, 7 Feb 2025 11:49:00 +0000 Subject: [PATCH] Tweak: use EventState::resize / redraw over action --- crates/kas-widgets/src/list.rs | 4 ++-- crates/kas-widgets/src/scroll_label.rs | 2 +- crates/kas-widgets/src/splitter.rs | 4 ++-- crates/kas-widgets/src/tab_stack.rs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/kas-widgets/src/list.rs b/crates/kas-widgets/src/list.rs index ee510feb4..acbd25aab 100644 --- a/crates/kas-widgets/src/list.rs +++ b/crates/kas-widgets/src/list.rs @@ -269,8 +269,8 @@ impl_scope! { } self.direction = direction; - // Note: most of the time SET_RECT would be enough, but margins can be different - cx.action(self, Action::RESIZE); + // Note: most of the time Action::SET_RECT would be enough, but margins can be different + cx.resize(self); } } diff --git a/crates/kas-widgets/src/scroll_label.rs b/crates/kas-widgets/src/scroll_label.rs index 0f8a0c3f4..896524e4d 100644 --- a/crates/kas-widgets/src/scroll_label.rs +++ b/crates/kas-widgets/src/scroll_label.rs @@ -118,7 +118,7 @@ impl_scope! { self.selection.set_max_len(self.text.str_len()); - cx.action(self, Action::REDRAW); + cx.redraw(self); } fn set_edit_pos_from_coord(&mut self, cx: &mut EventCx, coord: Coord) { diff --git a/crates/kas-widgets/src/splitter.rs b/crates/kas-widgets/src/splitter.rs index 365164fe5..e188eccd9 100644 --- a/crates/kas-widgets/src/splitter.rs +++ b/crates/kas-widgets/src/splitter.rs @@ -77,8 +77,8 @@ impl_scope! { } self.direction = direction; - // Note: most of the time SET_RECT would be enough, but margins can be different - cx.action(self, Action::RESIZE); + // Note: most of the time Action::SET_RECT would be enough, but margins can be different + cx.resize(self); } } diff --git a/crates/kas-widgets/src/tab_stack.rs b/crates/kas-widgets/src/tab_stack.rs index b667810ea..4be72db1c 100644 --- a/crates/kas-widgets/src/tab_stack.rs +++ b/crates/kas-widgets/src/tab_stack.rs @@ -137,8 +137,8 @@ impl_scope! { } self.direction = direction; - // Note: most of the time SET_RECT would be enough, but margins can be different - cx.action(self, Action::RESIZE); + // Note: most of the time Action::SET_RECT would be enough, but margins can be different + cx.resize(self); } /// Call the handler `f` on page change