debugger: Refine session modal design (#33004)
This PR makes all footer elements in the debugger session modal more consistent, as well as fixes some weird UI quirks with leaking borders and whatnot. Took the opportunity to do some light style clean up and use `prelude::*` for UI imports. Release Notes: - N/A
This commit is contained in:
parent
804b91aa8c
commit
0e94ca2a1a
2 changed files with 122 additions and 136 deletions
|
@ -13,10 +13,9 @@ use picker::{Picker, PickerDelegate, highlighted_match_with_paths::HighlightedMa
|
|||
use project::{TaskSourceKind, task_store::TaskStore};
|
||||
use task::{DebugScenario, ResolvedTask, RevealTarget, TaskContext, TaskTemplate};
|
||||
use ui::{
|
||||
ActiveTheme, Button, ButtonCommon, ButtonSize, Clickable, Color, FluentBuilder as _, Icon,
|
||||
IconButton, IconButtonShape, IconName, IconSize, IconWithIndicator, Indicator, IntoElement,
|
||||
KeyBinding, Label, LabelSize, ListItem, ListItemSpacing, RenderOnce, Toggleable, Tooltip, div,
|
||||
h_flex, v_flex,
|
||||
ActiveTheme, Clickable, FluentBuilder as _, IconButtonShape, IconWithIndicator, Indicator,
|
||||
IntoElement, KeyBinding, ListItem, ListItemSpacing, RenderOnce, Toggleable, Tooltip, div,
|
||||
prelude::*,
|
||||
};
|
||||
|
||||
use util::{ResultExt, truncate_and_trailoff};
|
||||
|
@ -660,11 +659,8 @@ impl PickerDelegate for TasksModalDelegate {
|
|||
Some(
|
||||
h_flex()
|
||||
.w_full()
|
||||
.h_8()
|
||||
.p_2()
|
||||
.p_1p5()
|
||||
.justify_between()
|
||||
.rounded_b_sm()
|
||||
.bg(cx.theme().colors().ghost_element_selected)
|
||||
.border_t_1()
|
||||
.border_color(cx.theme().colors().border_variant)
|
||||
.child(
|
||||
|
@ -673,7 +669,6 @@ impl PickerDelegate for TasksModalDelegate {
|
|||
let keybind = KeyBinding::for_action(&*action, window, cx);
|
||||
|
||||
Button::new("edit-current-task", label)
|
||||
.label_size(LabelSize::Small)
|
||||
.when_some(keybind, |this, keybind| this.key_binding(keybind))
|
||||
.on_click(move |_, window, cx| {
|
||||
window.dispatch_action(action.boxed_clone(), cx);
|
||||
|
@ -697,7 +692,6 @@ impl PickerDelegate for TasksModalDelegate {
|
|||
};
|
||||
|
||||
Button::new("spawn-onehshot", spawn_oneshot_label)
|
||||
.label_size(LabelSize::Small)
|
||||
.key_binding(keybind)
|
||||
.on_click(move |_, window, cx| {
|
||||
window.dispatch_action(action.boxed_clone(), cx)
|
||||
|
@ -712,15 +706,14 @@ impl PickerDelegate for TasksModalDelegate {
|
|||
} else {
|
||||
"Spawn Without History"
|
||||
};
|
||||
Button::new("spawn", label)
|
||||
.label_size(LabelSize::Small)
|
||||
.key_binding(keybind)
|
||||
.on_click(move |_, window, cx| {
|
||||
Button::new("spawn", label).key_binding(keybind).on_click(
|
||||
move |_, window, cx| {
|
||||
window.dispatch_action(
|
||||
menu::SecondaryConfirm.boxed_clone(),
|
||||
cx,
|
||||
)
|
||||
})
|
||||
},
|
||||
)
|
||||
},
|
||||
),
|
||||
)
|
||||
|
@ -731,7 +724,6 @@ impl PickerDelegate for TasksModalDelegate {
|
|||
if is_recent_selected { "Rerun" } else { "Spawn" };
|
||||
|
||||
Button::new("spawn", run_entry_label)
|
||||
.label_size(LabelSize::Small)
|
||||
.key_binding(keybind)
|
||||
.on_click(|_, window, cx| {
|
||||
window.dispatch_action(menu::Confirm.boxed_clone(), cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue