Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

debugger_ui: Add button to close the panel when docked to bottom (#43409)

Danilo Leald6c550c83824
diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs
index 0a5dc744cde..3890fa63263 100644
--- a/crates/debugger_ui/src/debugger_panel.rs
+++ b/crates/debugger_ui/src/debugger_panel.rs
@@ -651,6 +651,17 @@ impl DebugPanel {
.tooltip(Tooltip::text("Open Debug Adapter Logs"))
};
+ let close_bottom_panel_button = {
+ h_flex().pl_0p5().gap_1().child(Divider::vertical()).child(
+ IconButton::new("debug-close-panel", IconName::Close)
+ .icon_size(IconSize::Small)
+ .on_click(move |_, window, cx| {
+ window.dispatch_action(workspace::ToggleBottomDock.boxed_clone(), cx)
+ })
+ .tooltip(Tooltip::text("Close Panel")),
+ )
+ };
+
Some(
div.w_full()
.py_1()
@@ -658,7 +669,7 @@ impl DebugPanel {
.justify_between()
.border_b_1()
.border_color(cx.theme().colors().border)
- .when(is_side, |this| this.gap_1())
+ .when(is_side, |this| this.gap_1().h(Tab::container_height(cx)))
.child(
h_flex()
.justify_between()
@@ -957,6 +968,7 @@ impl DebugPanel {
.child(edit_debug_json_button())
.child(documentation_button())
.child(logs_button())
+ .child(close_bottom_panel_button)
}),
),
),