Update keybinding rendering
This commit is contained in:
parent
124604c019
commit
127acede25
1 changed files with 7 additions and 5 deletions
|
@ -23,9 +23,9 @@ impl RenderOnce for KeyBinding {
|
||||||
h_stack()
|
h_stack()
|
||||||
.flex_none()
|
.flex_none()
|
||||||
.gap_0p5()
|
.gap_0p5()
|
||||||
.bg(cx.theme().colors().element_background)
|
|
||||||
.p_0p5()
|
.p_0p5()
|
||||||
.rounded_sm()
|
.rounded_sm()
|
||||||
|
.text_color(cx.theme().colors().text_muted)
|
||||||
.when(keystroke.modifiers.function, |el| el.child(Key::new("fn")))
|
.when(keystroke.modifiers.function, |el| el.child(Key::new("fn")))
|
||||||
.when(keystroke.modifiers.control, |el| {
|
.when(keystroke.modifiers.control, |el| {
|
||||||
el.child(KeyIcon::new(Icon::Control))
|
el.child(KeyIcon::new(Icon::Control))
|
||||||
|
@ -111,7 +111,7 @@ impl RenderOnce for Key {
|
||||||
.h(rems(14. / 16.))
|
.h(rems(14. / 16.))
|
||||||
.text_ui()
|
.text_ui()
|
||||||
.line_height(relative(1.))
|
.line_height(relative(1.))
|
||||||
.text_color(cx.theme().colors().text)
|
.text_color(cx.theme().colors().text_muted)
|
||||||
.child(self.key.clone())
|
.child(self.key.clone())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,9 +131,11 @@ impl RenderOnce for KeyIcon {
|
||||||
type Output = Div;
|
type Output = Div;
|
||||||
|
|
||||||
fn render(self, _cx: &mut WindowContext) -> Self::Output {
|
fn render(self, _cx: &mut WindowContext) -> Self::Output {
|
||||||
div()
|
div().w(rems(14. / 16.)).child(
|
||||||
.w(rems(14. / 16.))
|
IconElement::new(self.icon)
|
||||||
.child(IconElement::new(self.icon).size(IconSize::Small))
|
.size(IconSize::Small)
|
||||||
|
.color(Color::Muted),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue