From cd9c88a0f7b76931d9b7114d8e8201d1c6ac0dba Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Mon, 10 Feb 2025 15:55:08 +0800 Subject: [PATCH] dock: Leave some space between the tabs title and panel (#612) ## Before image ## After image --- crates/ui/src/dock/tab_panel.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui/src/dock/tab_panel.rs b/crates/ui/src/dock/tab_panel.rs index 8c1d0ca7..561f6b9e 100644 --- a/crates/ui/src/dock/tab_panel.rs +++ b/crates/ui/src/dock/tab_panel.rs @@ -761,12 +761,15 @@ impl TabPanel { return Empty {}.into_any_element(); }; + let is_render_in_tabs = self.panels.len() > 1; + v_flex() .id("tab-content") .group("") .overflow_y_scroll() .overflow_x_hidden() .flex_1() + .when(is_render_in_tabs, |this| this.pt_2()) .child( active_panel .view()