debugger: Tighten up breakpoint list (#33645)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-06-30 14:49:09 +02:00 committed by GitHub
parent aa7ccecc49
commit 8c04f12499
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 6 deletions

View file

@ -1298,6 +1298,11 @@ impl Render for DebugPanel {
} }
v_flex() v_flex()
.when_else(
self.position(window, cx) == DockPosition::Bottom,
|this| this.max_h(self.size),
|this| this.max_w(self.size),
)
.size_full() .size_full()
.key_context("DebugPanel") .key_context("DebugPanel")
.child(h_flex().children(self.top_controls_strip(window, cx))) .child(h_flex().children(self.top_controls_strip(window, cx)))

View file

@ -877,9 +877,27 @@ impl LineBreakpoint {
}) })
.cursor_pointer() .cursor_pointer()
.child( .child(
Label::new(format!("{}:{}", self.name, self.line)) h_flex()
.size(LabelSize::Small) .gap_0p5()
.line_height_style(ui::LineHeightStyle::UiLabel), .child(
Label::new(format!("{}:{}", self.name, self.line))
.size(LabelSize::Small)
.line_height_style(ui::LineHeightStyle::UiLabel),
)
.children(self.dir.as_ref().and_then(|dir| {
let path_without_root = Path::new(dir.as_ref())
.components()
.skip(1)
.collect::<PathBuf>();
path_without_root.components().next()?;
Some(
Label::new(path_without_root.to_string_lossy().into_owned())
.color(Color::Muted)
.size(LabelSize::Small)
.line_height_style(ui::LineHeightStyle::UiLabel)
.truncate(),
)
})),
) )
.when_some(self.dir.as_ref(), |this, parent_dir| { .when_some(self.dir.as_ref(), |this, parent_dir| {
this.tooltip(Tooltip::text(format!("Worktree parent path: {parent_dir}"))) this.tooltip(Tooltip::text(format!("Worktree parent path: {parent_dir}")))
@ -1227,14 +1245,15 @@ impl RenderOnce for BreakpointOptionsStrip {
}; };
h_flex() h_flex()
.gap_2() .gap_1()
.child( .child(
div() .map(self.add_border(ActiveBreakpointStripMode::Log, supports_logs, window, cx)) div().map(self.add_border(ActiveBreakpointStripMode::Log, supports_logs, window, cx))
.child( .child(
IconButton::new( IconButton::new(
SharedString::from(format!("{id}-log-toggle")), SharedString::from(format!("{id}-log-toggle")),
IconName::ScrollText, IconName::ScrollText,
) )
.icon_size(IconSize::XSmall)
.style(style_for_toggle(ActiveBreakpointStripMode::Log, has_logs)) .style(style_for_toggle(ActiveBreakpointStripMode::Log, has_logs))
.icon_color(color_for_toggle(has_logs)) .icon_color(color_for_toggle(has_logs))
.disabled(!supports_logs) .disabled(!supports_logs)
@ -1254,6 +1273,7 @@ impl RenderOnce for BreakpointOptionsStrip {
SharedString::from(format!("{id}-condition-toggle")), SharedString::from(format!("{id}-condition-toggle")),
IconName::SplitAlt, IconName::SplitAlt,
) )
.icon_size(IconSize::XSmall)
.style(style_for_toggle( .style(style_for_toggle(
ActiveBreakpointStripMode::Condition, ActiveBreakpointStripMode::Condition,
has_condition has_condition
@ -1267,7 +1287,7 @@ impl RenderOnce for BreakpointOptionsStrip {
.when(!has_condition && !self.is_selected, |this| this.invisible()), .when(!has_condition && !self.is_selected, |this| this.invisible()),
) )
.child( .child(
div() .map(self.add_border( div().map(self.add_border(
ActiveBreakpointStripMode::HitCondition, ActiveBreakpointStripMode::HitCondition,
supports_hit_condition,window, cx supports_hit_condition,window, cx
)) ))
@ -1276,6 +1296,7 @@ impl RenderOnce for BreakpointOptionsStrip {
SharedString::from(format!("{id}-hit-condition-toggle")), SharedString::from(format!("{id}-hit-condition-toggle")),
IconName::ArrowDown10, IconName::ArrowDown10,
) )
.icon_size(IconSize::XSmall)
.style(style_for_toggle( .style(style_for_toggle(
ActiveBreakpointStripMode::HitCondition, ActiveBreakpointStripMode::HitCondition,
has_hit_condition, has_hit_condition,