pub struct FilterPanel {
pub col: usize,
pub anchor: Point<Pixels>,
pub kind: ColumnKind,
pub search: TextInput,
pub op_index: usize,
pub op_menu_open: bool,
pub operand_a: TextInput,
pub operand_b: TextInput,
pub focus: FilterInput,
pub auto_apply: bool,
pub distinct: Vec<FilterValueRow>,
}Expand description
Interactive state backing the Numbers-style per-column filter popover.
This is the working copy that the overlay edits; it is committed to
GridState::filters automatically (auto-apply) as the user interacts
with the panel. Rendered as a deferred + anchored GPUI overlay in
widget.rs, mirroring the context-menu overlay.
Fields§
§col: usizeTarget column index.
anchor: Point<Pixels>Grid-relative anchor point (from the triggering click).
kind: ColumnKindColumn kind; selects the text vs. numeric/date operator set.
search: TextInputThe value-list search box.
op_index: usizeSelected operator index into Self::op_labels; 0 == “Choose One”
(no predicate).
Whether the operator dropdown is expanded.
operand_a: TextInputFirst operand input.
operand_b: TextInputSecond operand input (range upper bound).
focus: FilterInputWhich text field currently has keyboard focus.
auto_apply: boolWhen set, edits apply to GridState::filters immediately.
distinct: Vec<FilterValueRow>All distinct formatted values for the column with their checked state.
Implementations§
Source§impl FilterPanel
impl FilterPanel
Sourcepub fn op_labels(&self) -> &'static [&'static str]
pub fn op_labels(&self) -> &'static [&'static str]
Operator labels appropriate to this column’s kind.
Sourcepub fn current_op_label(&self) -> &'static str
pub fn current_op_label(&self) -> &'static str
The currently selected operator label.
Sourcepub fn needs_operand(&self) -> bool
pub fn needs_operand(&self) -> bool
true when the selected operator needs at least one operand.
Sourcepub fn needs_second_operand(&self) -> bool
pub fn needs_second_operand(&self) -> bool
true when the selected operator is a range needing a second operand.
Sourcepub fn visible_indices(&self) -> Vec<usize>
pub fn visible_indices(&self) -> Vec<usize>
Indices into Self::distinct whose label matches the current search
box (case-insensitive substring). Drives only which rows are rendered
in the checklist; it does not affect the “(Select All)” state.
Sourcepub fn all_checked(&self) -> bool
pub fn all_checked(&self) -> bool
true when every distinct value row is checked. Deliberately
independent of the search box: typing in the search only narrows which
rows are displayed, it must never change the “(Select All)” state.
Trait Implementations§
Source§impl Clone for FilterPanel
impl Clone for FilterPanel
Source§fn clone(&self) -> FilterPanel
fn clone(&self) -> FilterPanel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FilterPanel
impl RefUnwindSafe for FilterPanel
impl Send for FilterPanel
impl Sync for FilterPanel
impl Unpin for FilterPanel
impl UnsafeUnpin for FilterPanel
impl UnwindSafe for FilterPanel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&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> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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