Skip to content

Commit

Permalink
Rename any_pin_on -> any_grab_on; document assumption on set_grab_dep…
Browse files Browse the repository at this point in the history
…ress
  • Loading branch information
dhardy committed May 30, 2024
1 parent 0dfcd77 commit ee3c3e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/kas-core/src/event/cx/cx_pub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ impl EventState {
/// grabs targets the widget to depress, or when a keyboard binding is used
/// to activate a widget (for the duration of the key-press).
///
/// Assumption: this method will only be called by handlers of a grab (i.e.
/// recipients of [`Event::PressStart`] after initiating a successful grab,
/// [`Event::PressMove`] or [`Event::PressEnd`]).
///
/// Queues a redraw and returns `true` if the depress target changes,
/// otherwise returns `false`.
pub fn set_grab_depress(&mut self, source: PressSource, target: Option<Id>) -> bool {
Expand Down Expand Up @@ -504,8 +508,8 @@ impl EventState {
redraw
}

/// Returns true if `id` or any descendant has a mouse or touch grab
pub fn any_pin_on(&self, id: &Id) -> bool {
/// Returns true if there is a mouse or touch grab on `id` or any descendant of `id`
pub fn any_grab_on(&self, id: &Id) -> bool {
if self
.mouse_grab
.as_ref()
Expand Down

0 comments on commit ee3c3e4

Please sign in to comment.