Table
ヘッダー、行、セルのパーツを持つ仮想化テーブルコレクションです。
デモを読み込み中…
TableState::new(rows, columns)
.element("issues")#インポート
quickgui から Table をインポートします。
use quickgui::*;#使い方
TableState::new(rows, columns)
.element("issues")#構成
Table::rootTable::headerTable::rowTable::cell_part
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
TableState
ソースを見るpub fn new(row_count: usize) -> Selfwith_selection_modepub fn with_selection_mode(mut self, mode: TableSelectionMode) -> Self—
Allow Shift ranges, platform-modified toggles, and Select All.
pub fn with_selection_mode(mut self, mode: TableSelectionMode) -> Selfソースを見るwith_layoutpub fn with_layout(mut self, layout: TableLayout) -> Self—
Configures with layout for this part.
pub fn with_layout(mut self, layout: TableLayout) -> Selfソースを見るlayoutpub const fn layout(&self) -> TableLayout—
set_layoutpub fn set_layout(&mut self, layout: TableLayout) -> bool—
row_countpub const fn row_count(&self) -> usize—
set_row_countpub fn set_row_count(&mut self, row_count: usize) -> bool—
Configures set row count for this part.
pub fn set_row_count(&mut self, row_count: usize) -> boolソースを見るselection_modepub const fn selection_mode(&self) -> TableSelectionMode—
Configures selection mode for this part.
pub const fn selection_mode(&self) -> TableSelectionModeソースを見るset_selection_modepub fn set_selection_mode(&mut self, mode: TableSelectionMode) -> bool—
Configures set selection mode for this part.
pub fn set_selection_mode(&mut self, mode: TableSelectionMode) -> boolソースを見るselectionpub const fn selection(&self) -> &TableSelection—
selection_versionpub const fn selection_version(&self) -> u64—
A counter bumped once every time the retained selection actually changes. Comparing this across a frame is cheaper than cloning the selection, and it is what the table itself uses to decide whether to dispatch [`TableSelectionChanged`].
pub const fn selection_version(&self) -> u64ソースを見るset_selectionpub fn set_selection(&mut self, selection: TableSelection) -> bool—
Replace the retained row selection, dropping rows past the current row count.
pub fn set_selection(&mut self, selection: TableSelection) -> boolソースを見るselection_anchorpub const fn selection_anchor(&self) -> Option<usize>—
is_row_selectedpub fn is_row_selected(&self, row: usize) -> bool—
select_rowpub fn select_row(&mut self, row: usize) -> bool—
Select exactly one row and anchor future Shift ranges there.
pub fn select_row(&mut self, row: usize) -> boolソースを見るtoggle_row_selectionpub fn toggle_row_selection(&mut self, row: usize) -> bool—
Add or remove one row from a multiple selection. A single-selection table selects the row instead of toggling it, so the platform-modified click of a single-selection list behaves like an ordinary click.
pub fn toggle_row_selection(&mut self, row: usize) -> boolソースを見るselect_row_rangepub fn select_row_range(&mut self, row: usize) -> bool—
Replace the selection with the range between the anchor and `row`.
pub fn select_row_range(&mut self, row: usize) -> boolソースを見るselect_all_rowspub fn select_all_rows(&mut self) -> bool—
clear_row_selectionpub fn clear_row_selection(&mut self) -> bool—
editing_cellpub const fn editing_cell(&self) -> Option<TableCellPosition>—
begin_editpub fn begin_edit(&mut self, position: TableCellPosition, column_count: usize) -> bool—
Open an inline editor over one cell and make it the active cell. The application owns the editor element and its draft value; QuickGUI retains only which cell is being edited, gives that cell its own key context, and reports Return and Escape.
pub fn begin_edit(&mut self, position: TableCellPosition, column_count: usize) -> boolソースを見るend_editpub fn end_edit(&mut self) -> Option<TableCellPosition>—
Close the open editor. Returns the cell that was being edited.
pub fn end_edit(&mut self) -> Option<TableCellPosition>ソースを見るcolumn_widthpub fn column_width(&self, column: ElementId) -> Option<f32>—
The retained width of a resizable column.
pub fn column_width(&self, column: ElementId) -> Option<f32>ソースを見るset_column_widthpub fn set_column_width(&mut self, column: ElementId, width: f32) -> bool—
Replace one resizable column's width, clamped to its declared minimum and the table's maximum. A column that is not resizable is ignored.
pub fn set_column_width(&mut self, column: ElementId, width: f32) -> boolソースを見るresize_columnpub fn resize_column(&mut self, column: ElementId, delta: f32) -> bool—
Move one resizable column's trailing edge by a logical-pixel delta.
pub fn resize_column(&mut self, column: ElementId, delta: f32) -> boolソースを見るcolumn_orderpub fn column_order(&self) -> &[u16]—
The declared column indices in their current display order.
pub fn column_order(&self) -> &[u16]ソースを見るmove_columnpub fn move_column(&mut self, column_index: usize, delta: isize) -> bool—
Move one declared column to a different position in the display order.
pub fn move_column(&mut self, column_index: usize, delta: isize) -> boolソースを見るselected_cellpub const fn selected_cell(&self) -> Option<TableCellPosition>—
Configures selected cell for this part.
pub const fn selected_cell(&self) -> Option<TableCellPosition>ソースを見るselected_rowpub fn selected_row(&self) -> Option<usize>—
sortpub const fn sort(&self) -> Option<TableSort>—
set_sortpub fn set_sort(&mut self, sort: Option<TableSort>) -> bool—
clear_selectionpub fn clear_selection(&mut self) -> bool—
select_cellpub fn select_cell(&mut self, position: TableCellPosition, column_count: usize) -> bool—
Make one cell active and collapse the row selection onto its row. This is the unmodified click and arrow-key behavior of every desktop list. Use [`Self::set_selection`] or [`Self::toggle_row_selection`] to change selection without moving the active cell.
pub fn select_cell(&mut self, position: TableCellPosition, column_count: usize) -> boolソースを見るvisible_rowspub fn visible_rows(&self) -> std::ops::Range<usize>—
list_statepub fn list_state(&self) -> &ListState—
focus_handlepub fn focus_handle(id: impl Into<ElementId>) -> FocusHandle—
Configures focus handle for this part.
pub fn focus_handle(id: impl Into<ElementId>) -> FocusHandleソースを見るrow_idpub fn row_id(id: impl Into<ElementId>, row: usize) -> ElementId—
Configures row id for this part.
pub fn row_id(id: impl Into<ElementId>, row: usize) -> ElementIdソースを見るcell_idpub fn cell_id(id: impl Into<ElementId>, position: TableCellPosition) -> ElementId—
Configures cell id for this part.
pub fn cell_id(id: impl Into<ElementId>, position: TableCellPosition) -> ElementIdソースを見るcolumn_header_idpub fn column_header_id(id: impl Into<ElementId>, column: ElementId) -> ElementId—
Configures column header id for this part.
pub fn column_header_id(id: impl Into<ElementId>, column: ElementId) -> ElementIdソースを見るresize_handle_idpub fn resize_handle_id(id: impl Into<ElementId>, column: ElementId) -> ElementId—
The stable identity of one column's resize handle.
pub fn resize_handle_id(id: impl Into<ElementId>, column: ElementId) -> ElementIdソースを見るTableState::element
ソースを見るpub fn element<V, H, E, RenderHeader, RenderCell, Activate>( &mut self, cx: &mut ViewContext<'_, V>, id: impl Into<ElementId>, columns: &[TableColumn], access: fn(&mut V) -> &mut TableState, render_header: RenderHeader, render_cell: RenderCell, activate: Activate, ) -> Element where V: 'static, H: IntoElement, E: IntoElement, RenderHeader: FnMut(TableHeaderState<'_>) -> H, RenderCell: FnMut(TableCellState<'_>) -> E, Activate: Fn(&mut V, TableCellPosition, &mut EventContext) + Clone + 'static,Build a complete unstyled virtualized, sortable, keyboard-navigable table. `render_header` owns every visible header declaration, including label, sort indicator, and the placement of the resize handle QuickGUI hands it. `render_cell` owns every visible cell declaration, including the inline editor it mounts while `editing` is set, and runs only for mounted rows. QuickGUI decorates those elements with fixed grid geometry, identities, pointer/keyboard behavior, and accessibility semantics but adds no paint. `activate` receives the current logical cell when Return is dispatched outside an editor; selection, sort, width, order, and editing state remain directly readable from `access`.
TableState::element_with
ソースを見るpub fn element_with<V, H, E, RenderHeader, RenderCell, Activate>( &mut self, cx: &mut ViewContext<'_, V>, id: impl Into<ElementId>, columns: &[TableColumn], access_source: StateAccessor<V, TableState>, render_header: RenderHeader, render_cell: RenderCell, activate: Activate, ) -> Element where V: 'static, H: IntoElement, E: IntoElement, RenderHeader: FnMut(TableHeaderState<'_>) -> H, RenderCell: FnMut(TableCellState<'_>) -> E, Activate: Fn(&mut V, TableCellPosition, &mut EventContext) + Clone + 'static,Build the table against a per-instance retained-state accessor. A host that renders many declared tables through one view passes an accessor that captures which [`TableState`] each registered listener resolves. Every row is a plain container; [`Self::element_with_rows`] lets the caller paint the rows too.
TableState::element_with_rows
ソースを見るpub fn element_with_rows<V, R, H, E, RenderRow, RenderHeader, RenderCell, Activate>( &mut self, cx: &mut ViewContext<'_, V>, id: impl Into<ElementId>, columns: &[TableColumn], access_source: StateAccessor<V, TableState>, mut render_row: RenderRow, mut render_header: RenderHeader, mut render_cell: RenderCell, activate: Activate, ) -> Element where V: 'static, R: IntoElement, H: IntoElement, E: IntoElement, RenderRow: FnMut(TableRowState) -> R, RenderHeader: FnMut(TableHeaderState<'_>) -> H, RenderCell: FnMut(TableCellState<'_>) -> E, Activate: Fn(&mut V, TableCellPosition, &mut EventContext) + Clone + 'static,Build the table with a caller-owned container for every mounted row. `render_row` returns the element a row's cells are laid out in. QuickGUI adds the grid tracks, the row height, the row identity, and the collection semantics on top of it, so the caller declares only the row's paint — a background, a divider, a hover state, or a [`selected_style`](Element::selected_style) that paints while the row is selected — never its layout. The renderer runs only for mounted rows.
