use egui::{Color32, Context, Frame, Id, Ui};
use std::borrow::Cow;
pub trait ItemTrait {
type Data<'a>;
fn id(&self, _data: &Self::Data<'_>) -> Id;
fn style_normal(&self, frame: &mut Frame) {}
fn style_clicked(&self, frame: &mut Frame) {
frame.fill = Color32::LIGHT_GREEN;
}
fn style_hovered(&self, frame: &mut Frame) {
frame.fill = Color32::LIGHT_YELLOW;
}
fn show(
&self,
selected: bool,
hovered: bool,
ctx: &Context,
ui: &mut Ui,
_data: &Self::Data<'_>,
);
fn hovered_text(&self) -> Option<Cow<'_, str>> {
None
}
fn selected_item(&self, _data: &Self::Data<'_>) {}
fn on_search(&self, text: &str, _data: &Self::Data<'_>) -> bool;
}