Fix resizeable panel sometime will not fill parent. (#176)

<img width="1202" alt="image"
src="https://github.com/user-attachments/assets/dbffde88-fc1d-409b-8795-15c405cc4ce9">
This commit is contained in:
Jason Lee 2024-08-23 22:15:52 +08:00 committed by GitHub
parent 5533a8b72c
commit 409f597100
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
use std::sync::Arc;
use crate::{
h_flex,
resizable::{h_resizable, resizable_panel, v_resizable, ResizablePanel, ResizablePanelGroup},
theme::ActiveTheme,
Placement,
@ -8,7 +9,7 @@ use crate::{
use super::{DockArea, Panel, PanelEvent, PanelView, TabPanel};
use gpui::{
div, prelude::FluentBuilder as _, px, Axis, DismissEvent, Entity, EventEmitter, FocusHandle,
prelude::FluentBuilder as _, px, Axis, DismissEvent, Entity, EventEmitter, FocusHandle,
FocusableView, IntoElement, ParentElement, Pixels, Render, Styled, View, ViewContext,
VisualContext, WeakView,
};
@ -263,7 +264,7 @@ impl EventEmitter<PanelEvent> for StackPanel {}
impl EventEmitter<DismissEvent> for StackPanel {}
impl Render for StackPanel {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
div()
h_flex()
.size_full()
.flex_grow()
.flex_shrink()