pub struct GridState {Show 34 fields
pub data: GridData,
pub config: GridConfig,
pub resolved_formats: Vec<ResolvedColumnFormat>,
pub display_indices: Vec<usize>,
pub selection: Selection,
pub sort: Option<(usize, SortDirection)>,
pub filters: Vec<String>,
pub scroll_handle: ScrollHandle,
pub focus_handle: FocusHandle,
pub bounds: Bounds<Pixels>,
pub row_height: f32,
pub header_height: f32,
pub row_header_width: f32,
pub font_size: f32,
pub char_width: f32,
pub theme: GridTheme,
pub is_dragging: bool,
pub drag_start: Option<Point<Pixels>>,
pub drag_start_hit: Option<HitResult>,
pub scroll_at_click: Option<Point<Pixels>>,
pub last_mouse_pos: Option<Point<Pixels>>,
pub status_bar_height: f32,
pub click_pos: Option<Point<Pixels>>,
pub click_hit: Option<HitResult>,
pub hover_hit: Option<HitResult>,
pub resizing_col: Option<usize>,
pub resize_start_x: f32,
pub resize_start_width: f32,
pub context_menu: Option<ContextMenu>,
pub filter_prompt: Option<FilterPrompt>,
pub pending_action: Option<(MenuAction, usize)>,
pub scrollbar_drag: Option<ScrollbarAxis>,
pub scrollbar_drag_start_offset: f32,
pub scrollbar_drag_start_pos: f32,
/* private fields */
}Expand description
Complete grid state owned by a GPUI Entity<GridState>.
Fields§
§data: GridData§config: GridConfig§resolved_formats: Vec<ResolvedColumnFormat>Cached resolved-format list, kept in sync with data.columns and
config. Paint, copy, and filter read this directly instead of
recomputing per cell.
display_indices: Vec<usize>§selection: Selection§sort: Option<(usize, SortDirection)>§filters: Vec<String>§scroll_handle: ScrollHandle§focus_handle: FocusHandle§bounds: Bounds<Pixels>§row_height: f32§header_height: f32§row_header_width: f32§font_size: f32§char_width: f32§theme: GridTheme§is_dragging: bool§drag_start: Option<Point<Pixels>>§drag_start_hit: Option<HitResult>§scroll_at_click: Option<Point<Pixels>>§last_mouse_pos: Option<Point<Pixels>>§status_bar_height: f32§click_pos: Option<Point<Pixels>>§click_hit: Option<HitResult>§hover_hit: Option<HitResult>§resizing_col: Option<usize>§resize_start_x: f32§resize_start_width: f32§filter_prompt: Option<FilterPrompt>§pending_action: Option<(MenuAction, usize)>§scrollbar_drag: Option<ScrollbarAxis>§scrollbar_drag_start_offset: f32§scrollbar_drag_start_pos: f32Implementations§
Source§impl GridState
impl GridState
pub fn new( data: GridData, config: GridConfig, focus_handle: FocusHandle, ) -> Self
pub fn set_config(&mut self, config: GridConfig)
pub fn recompute(&mut self)
pub fn toggle_sort(&mut self, col: usize)
pub fn handle_mouse_down(&mut self, pos: Point<Pixels>, shift: bool)
pub fn execute_action(&mut self, action: MenuAction, col: usize, cx: &mut App)
pub fn drag_screen_rect(&self) -> Option<(Point<Pixels>, Point<Pixels>)>
pub fn handle_mouse_move( &mut self, pos: Point<Pixels>, pressed_button: Option<MouseButton>, )
pub fn handle_scroll_drag(&mut self)
pub fn handle_mouse_up(&mut self)
pub fn apply_edge_scroll(&mut self) -> bool
pub fn select_all(&mut self)
pub fn copy_selection(&self, with_headers: bool, cx: &mut App)
pub fn page_up(&mut self)
pub fn page_down(&mut self)
pub fn handle_key(&mut self, keystroke: &Keystroke)
pub fn wants_edge_scroll_tick(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GridState
impl !Send for GridState
impl !Sync for GridState
impl !UnwindSafe for GridState
impl Freeze for GridState
impl Unpin for GridState
impl UnsafeUnpin for GridState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more