Use SharedString for Lists

This commit is contained in:
Marshall Bowers 2023-10-18 14:19:26 -04:00
parent 856d23626f
commit 8dad3ad8ea
3 changed files with 25 additions and 23 deletions

View file

@ -3,7 +3,7 @@ use crate::{theme, v_stack, Label, List, ListEntry, ListItem, ListSeparator, Lis
#[derive(Clone)]
pub enum ContextMenuItem<S: 'static + Send + Sync + Clone> {
Header(&'static str),
Header(SharedString),
Entry(Label<S>),
Separator,
}
@ -19,8 +19,8 @@ impl<S: 'static + Send + Sync + Clone> ContextMenuItem<S> {
}
}
pub fn header(label: &'static str) -> Self {
Self::Header(label)
pub fn header(label: impl Into<SharedString>) -> Self {
Self::Header(label.into())
}
pub fn separator() -> Self {