keymap_editor: Adjust some items of the UI (#42876)
- Only showing the "Create" menu item in the right-click context menu for actions that _do not_ contain a binding already assigned to them - Only show the "Clear Input" icon button in the keystroke modal when the input is focused/in recording mode - Add a subtle hover style to the table rows just to make it easier to navigate Release Notes: - N/A
This commit is contained in:
@@ -636,18 +636,24 @@ impl Render for KeystrokeInput {
|
||||
)
|
||||
}
|
||||
})
|
||||
.child(
|
||||
IconButton::new("clear-btn", IconName::Backspace)
|
||||
.shape(IconButtonShape::Square)
|
||||
.tooltip(Tooltip::for_action_title(
|
||||
"Clear Keystrokes",
|
||||
&ClearKeystrokes,
|
||||
))
|
||||
.when(!is_focused, |this| this.icon_color(Color::Muted))
|
||||
.on_click(cx.listener(|this, _event, window, cx| {
|
||||
this.clear_keystrokes(&ClearKeystrokes, window, cx);
|
||||
})),
|
||||
),
|
||||
.when(is_recording, |this| {
|
||||
this.child(
|
||||
IconButton::new("clear-btn", IconName::Backspace)
|
||||
.shape(IconButtonShape::Square)
|
||||
.tooltip(move |_, cx| {
|
||||
Tooltip::with_meta(
|
||||
"Clear Keystrokes",
|
||||
Some(&ClearKeystrokes),
|
||||
"Hit it three times to execute",
|
||||
cx,
|
||||
)
|
||||
})
|
||||
.when(!is_focused, |this| this.icon_color(Color::Muted))
|
||||
.on_click(cx.listener(|this, _event, window, cx| {
|
||||
this.clear_keystrokes(&ClearKeystrokes, window, cx);
|
||||
})),
|
||||
)
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user