dock: Leave some space between the tabs title and panel (#612)

## Before
<img width="541" alt="image"
src="https://github.com/user-attachments/assets/a41390ec-a86b-4ca2-bcf4-a2b368c1e2e0"
/>

## After
<img width="518" alt="image"
src="https://github.com/user-attachments/assets/0896abe5-d499-4052-aa84-0864029c0346"
/>
This commit is contained in:
Floyd Wang 2025-02-10 15:55:08 +08:00 committed by GitHub
parent 7ceae0acff
commit cd9c88a0f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -761,12 +761,15 @@ impl TabPanel {
return Empty {}.into_any_element(); return Empty {}.into_any_element();
}; };
let is_render_in_tabs = self.panels.len() > 1;
v_flex() v_flex()
.id("tab-content") .id("tab-content")
.group("") .group("")
.overflow_y_scroll() .overflow_y_scroll()
.overflow_x_hidden() .overflow_x_hidden()
.flex_1() .flex_1()
.when(is_render_in_tabs, |this| this.pt_2())
.child( .child(
active_panel active_panel
.view() .view()