Revert "Added custom widget version of table"
This reverts commit 825792e367.
This commit is contained in:
parent
6958a4cc36
commit
0e29b6b226
3 changed files with 13 additions and 26 deletions
|
|
@ -8,12 +8,12 @@ pub trait ItemCategory:
|
|||
Default + std::fmt::Display + Clone + Copy + PartialEq + Eq + std::hash::Hash
|
||||
{
|
||||
/// Function that gets the width of the data
|
||||
fn width(&self) -> u16;
|
||||
fn width(&self) -> iced::Length;
|
||||
}
|
||||
|
||||
pub trait ItemInterface<Category: ItemCategory>: Default {
|
||||
fn get_icon(&self, category: Category) -> Option<Icon>;
|
||||
fn get_text(&self, category: Category) -> Option<String>;
|
||||
fn get_text(&self, category: Category) -> Cow<'static, str>;
|
||||
|
||||
fn compare(&self, other: &Self, category: Category) -> std::cmp::Ordering;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,8 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use iced::Size;
|
||||
use slotmap::SecondaryMap;
|
||||
|
||||
use crate::widget::table::{Entity, ItemCategory};
|
||||
use crate::widget::table::Entity;
|
||||
|
||||
pub struct State<Category>
|
||||
where
|
||||
Category: ItemCategory + 'static,
|
||||
{
|
||||
pub struct State {
|
||||
pub(super) num_items: usize,
|
||||
pub(super) selected: SecondaryMap<Entity, bool>,
|
||||
pub(super) paragraphs: SecondaryMap<Entity, HashMap<Category, crate::Plain>>,
|
||||
pub(super) text_hashes: SecondaryMap<Entity, u64>,
|
||||
pub(super) item_layout: Vec<Size>,
|
||||
|
||||
pub(super) sort_hash: HashMap<Category, u64>,
|
||||
pub(super) header_paragraphs: HashMap<Category, crate::Plain>,
|
||||
pub(super) category_layout: Vec<Size>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue