Struct gpui2::Interactivity
source · pub struct Interactivity {Show 27 fields
pub element_id: Option<ElementId>,
pub key_context: KeyContext,
pub focusable: bool,
pub tracked_focus_handle: Option<FocusHandle>,
pub focus_listeners: FocusListeners,
pub group: Option<SharedString>,
pub base_style: StyleRefinement,
pub focus_style: StyleRefinement,
pub in_focus_style: StyleRefinement,
pub hover_style: StyleRefinement,
pub group_hover_style: Option<GroupStyle>,
pub active_style: StyleRefinement,
pub group_active_style: Option<GroupStyle>,
pub drag_over_styles: SmallVec<[(TypeId, StyleRefinement); 2]>,
pub group_drag_over_styles: SmallVec<[(TypeId, GroupStyle); 2]>,
pub mouse_down_listeners: SmallVec<[MouseDownListener; 2]>,
pub mouse_up_listeners: SmallVec<[MouseUpListener; 2]>,
pub mouse_move_listeners: SmallVec<[MouseMoveListener; 2]>,
pub scroll_wheel_listeners: SmallVec<[ScrollWheelListener; 2]>,
pub key_down_listeners: SmallVec<[KeyDownListener; 2]>,
pub key_up_listeners: SmallVec<[KeyUpListener; 2]>,
pub action_listeners: SmallVec<[(TypeId, ActionListener); 8]>,
pub drop_listeners: SmallVec<[(TypeId, Box<dyn Fn(AnyView, &mut WindowContext<'_>) + 'static>); 2]>,
pub click_listeners: SmallVec<[ClickListener; 2]>,
pub drag_listener: Option<DragListener>,
pub hover_listener: Option<Box<dyn Fn(&bool, &mut WindowContext<'_>)>>,
pub tooltip_builder: Option<TooltipBuilder>,
}
Fields§
§element_id: Option<ElementId>
§key_context: KeyContext
§focusable: bool
§tracked_focus_handle: Option<FocusHandle>
§focus_listeners: FocusListeners
§group: Option<SharedString>
§base_style: StyleRefinement
§focus_style: StyleRefinement
§in_focus_style: StyleRefinement
§hover_style: StyleRefinement
§group_hover_style: Option<GroupStyle>
§active_style: StyleRefinement
§group_active_style: Option<GroupStyle>
§drag_over_styles: SmallVec<[(TypeId, StyleRefinement); 2]>
§group_drag_over_styles: SmallVec<[(TypeId, GroupStyle); 2]>
§mouse_down_listeners: SmallVec<[MouseDownListener; 2]>
§mouse_up_listeners: SmallVec<[MouseUpListener; 2]>
§mouse_move_listeners: SmallVec<[MouseMoveListener; 2]>
§scroll_wheel_listeners: SmallVec<[ScrollWheelListener; 2]>
§key_down_listeners: SmallVec<[KeyDownListener; 2]>
§key_up_listeners: SmallVec<[KeyUpListener; 2]>
§action_listeners: SmallVec<[(TypeId, ActionListener); 8]>
§drop_listeners: SmallVec<[(TypeId, Box<dyn Fn(AnyView, &mut WindowContext<'_>) + 'static>); 2]>
§click_listeners: SmallVec<[ClickListener; 2]>
§drag_listener: Option<DragListener>
§hover_listener: Option<Box<dyn Fn(&bool, &mut WindowContext<'_>)>>
§tooltip_builder: Option<TooltipBuilder>
Implementations§
source§impl Interactivity
impl Interactivity
pub fn layout( &mut self, element_state: Option<InteractiveElementState>, cx: &mut WindowContext<'_>, f: impl FnOnce(Style, &mut WindowContext<'_>) -> LayoutId ) -> (LayoutId, InteractiveElementState)
pub fn paint( self, bounds: Bounds<Pixels>, content_size: Size<Pixels>, element_state: &mut InteractiveElementState, cx: &mut WindowContext<'_>, f: impl FnOnce(Style, Point<Pixels>, &mut WindowContext<'_>) )
pub fn compute_style( &self, bounds: Option<Bounds<Pixels>>, element_state: &mut InteractiveElementState, cx: &mut WindowContext<'_> ) -> Style
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Interactivity
impl !Send for Interactivity
impl !Sync for Interactivity
impl Unpin for Interactivity
impl !UnwindSafe for Interactivity
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more