Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "egui-selectable-table"
version = "0.3.0"
edition = "2021"
version = "0.4.0"
edition = "2024"
authors = ["TheRustyPickle <rusty.pickle94@gmail.com>"]
readme = "README.md"
description = """
Expand All @@ -17,6 +17,7 @@ exclude = ["/demo", "/.github"]
[dependencies]
egui = { version = "0.32.0", default-features = false, features = ["rayon"] }
egui_extras = { version = "0.32.0", default-features = false }
nucleo-matcher = { version = "0.3.1", optional = true }
rayon = "1.10.0"

[lints.rust]
Expand All @@ -34,3 +35,6 @@ unwrap_used = { level = "deny", priority = 5 }
expect_used = { level = "allow", priority = 6 }
missing_panics_doc = { level = "allow", priority = 7 }
struct_excessive_bools = { level = "allow", priority = 8 }

[features]
fuzzy-matching = ["dep:nucleo-matcher"]
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ A library for [egui](https://github.com/emilk/egui) to create tables with dragga
- Customizable rows and header UI
- Built-in select all (Ctrl+A) and copy (Ctrl+C) functionality
- Capable of handling a substantial amount of rows (1M+) with proper settings
- Optional fuzzy matching for searching rows (see below)

## Optional Features

This crate includes an optional `fuzzy-matching` feature that enables fuzzy row search using the [nucleo-matcher](https://crates.io/crates/nucleo-matcher) crate.

To enable fuzzy matching:

```toml
[dependencies]
egui-selectable-table = { version = "0.4.0", features = ["fuzzy-matching"] }
```

## Usage

Expand Down Expand Up @@ -43,12 +55,13 @@ enum Column {
// Implement both traits for row and column
impl ColumnOperations<MyRow, ColumnName, Config> for Column {
// The text of a row based on the column
fn column_text(&self, row: &WhiteListRowData) -> String {}
fn column_text(&self, row: &MyRow) -> String {}
// Create your own header or no header
fn create_header(&self, ui: &mut Ui, sort_order: Option<SortOrder>, table: &mut SelectableTable<MyRow, Column, Config>) -> Option<Response> {}
//Create your own table row UI
fn create_table_row(&self, ui: &mut Ui, row: &SelectableRow<MyRow, Column>, selected: bool, table: &mut SelectableTable<MyRow, Column, Config>,) -> Response {}
}

impl ColumnOrdering<MyRow> for Column {
fn order_by(&self, row_1: &MyRow, row_2: &MyRow) -> std::cmp::Ordering {
match self {
Expand Down
Loading
Loading