Use SharedString
for Keybinding
s
This commit is contained in:
parent
6e3393c93f
commit
f0b9e9a89d
1 changed files with 3 additions and 6 deletions
|
@ -45,7 +45,7 @@ impl<S: 'static + Send + Sync + Clone> Keybinding<S> {
|
||||||
.gap_1()
|
.gap_1()
|
||||||
.children(ModifierKey::iter().filter_map(|modifier| {
|
.children(ModifierKey::iter().filter_map(|modifier| {
|
||||||
if modifiers.0.contains(&modifier) {
|
if modifiers.0.contains(&modifier) {
|
||||||
Some(Key::new(modifier.glyph()))
|
Some(Key::new(modifier.glyph().to_string()))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
@ -58,14 +58,11 @@ impl<S: 'static + Send + Sync + Clone> Keybinding<S> {
|
||||||
#[derive(Element)]
|
#[derive(Element)]
|
||||||
pub struct Key<S: 'static + Send + Sync> {
|
pub struct Key<S: 'static + Send + Sync> {
|
||||||
state_type: PhantomData<S>,
|
state_type: PhantomData<S>,
|
||||||
key: String,
|
key: SharedString,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S: 'static + Send + Sync> Key<S> {
|
impl<S: 'static + Send + Sync> Key<S> {
|
||||||
pub fn new<K>(key: K) -> Self
|
pub fn new(key: impl Into<SharedString>) -> Self {
|
||||||
where
|
|
||||||
K: Into<String>,
|
|
||||||
{
|
|
||||||
Self {
|
Self {
|
||||||
state_type: PhantomData,
|
state_type: PhantomData,
|
||||||
key: key.into(),
|
key: key.into(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue