From 7442aa1fbaf1fe60d808930b2b8ce4db44439c95 Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Fri, 14 Mar 2025 15:55:51 +0800 Subject: [PATCH] dock: Fixed panels will lose height when dragged to minimum (#718) ## Before https://github.com/user-attachments/assets/c49464bf-6106-422b-b948-83c5b4c4de60 ## After https://github.com/user-attachments/assets/b83fba18-ecfd-458f-8f25-5d59a60a66cb --- crates/ui/src/dock/dock.rs | 2 +- crates/ui/src/dock/tab_panel.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui/src/dock/dock.rs b/crates/ui/src/dock/dock.rs index b57b719b..5599bc9f 100644 --- a/crates/ui/src/dock/dock.rs +++ b/crates/ui/src/dock/dock.rs @@ -371,7 +371,7 @@ impl Render for Dock { return div(); } - let cache_style = StyleRefinement::default().v_flex().size_full(); + let cache_style = StyleRefinement::default().absolute().size_full(); div() .relative() diff --git a/crates/ui/src/dock/tab_panel.rs b/crates/ui/src/dock/tab_panel.rs index a74f5223..6dec807e 100644 --- a/crates/ui/src/dock/tab_panel.rs +++ b/crates/ui/src/dock/tab_panel.rs @@ -14,7 +14,7 @@ use crate::{ h_flex, popup_menu::{PopupMenu, PopupMenuExt}, tab::{Tab, TabBar}, - v_flex, ActiveTheme, AxisExt, IconName, Placement, Selectable, Sizable, StyledExt as _, + v_flex, ActiveTheme, AxisExt, IconName, Placement, Selectable, Sizable, }; use super::{ @@ -799,7 +799,7 @@ impl TabPanel { .child( active_panel .view() - .cached(StyleRefinement::default().v_flex().size_full()), + .cached(StyleRefinement::default().absolute().size_full()), ), ) .when(state.droppable, |this| {