Skip to content

Commit

Permalink
Tweak: use EventState::resize / redraw over action
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Feb 7, 2025
1 parent 02c9047 commit 9f6c62a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/kas-widgets/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/kas-widgets/src/scroll_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions crates/kas-widgets/src/splitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/kas-widgets/src/tab_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f6c62a

Please sign in to comment.