Skip to main content

GridState

Struct GridState 

Source
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,
}
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§context_menu: Option<ContextMenu>§filter_prompt: Option<FilterPrompt>§pending_action: Option<(MenuAction, usize)>§scrollbar_drag: Option<ScrollbarAxis>§scrollbar_drag_start_offset: f32§scrollbar_drag_start_pos: f32

Implementations§

Source§

impl GridState

Source

pub fn new( data: GridData, config: GridConfig, focus_handle: FocusHandle, ) -> Self

Source

pub fn set_config(&mut self, config: GridConfig)

Source

pub fn recompute(&mut self)

Source

pub fn toggle_sort(&mut self, col: usize)

Source

pub fn handle_mouse_down(&mut self, pos: Point<Pixels>, shift: bool)

Source

pub fn execute_action(&mut self, action: MenuAction, col: usize, cx: &mut App)

Source

pub fn drag_screen_rect(&self) -> Option<(Point<Pixels>, Point<Pixels>)>

Source

pub fn handle_mouse_move( &mut self, pos: Point<Pixels>, pressed_button: Option<MouseButton>, )

Source

pub fn handle_scroll_drag(&mut self)

Source

pub fn handle_mouse_up(&mut self)

Source

pub fn apply_edge_scroll(&mut self) -> bool

Source

pub fn select_all(&mut self)

Source

pub fn copy_selection(&self, with_headers: bool, cx: &mut App)

Source

pub fn page_up(&mut self)

Source

pub fn page_down(&mut self)

Source

pub fn handle_key(&mut self, keystroke: &Keystroke)

Source

pub fn wants_edge_scroll_tick(&self) -> bool

Trait Implementations§

Source§

impl Debug for GridState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more