Skip to content

Commit

Permalink
Fix Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoon committed Jan 2, 2025
1 parent 16f204c commit 8238397
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/home/event_reaction_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,27 @@ impl ReactionListRef {
instance.width_calculated = false;
}
}

/// Handles hover in action and returns the appropriate `RoomScreenTooltipActions`.
///
/// This function checks if there is a widget action associated with the current
/// widget's unique identifier in the provided `actions`. If an action exists,
/// it is cast to `RoomScreenTooltipActions` and returned. Otherwise, it returns
/// `RoomScreenTooltipActions::None`.
///
/// # Arguments
///
/// * `actions` - A reference to the `Actions` that may contain widget actions
/// relevant to this widget.
pub fn hover_in(&self, actions: &Actions) -> RoomScreenTooltipActions {
if let Some(item) = actions.find_widget_action(self.widget_uid()) {
item.cast()
} else {
RoomScreenTooltipActions::None
}
}
/// Handles hover out action
/// Handles widget actions and returns `true` if the hover out action was found in the provided `actions`.
/// Otherwise, returns `false`.
pub fn hover_out(&self, actions: &Actions) -> bool {
if let Some(item) = actions.find_widget_action(self.widget_uid()) {
matches!(item.cast(), RoomScreenTooltipActions::HoverOut)
Expand Down

0 comments on commit 8238397

Please sign in to comment.