From 3c39641486ddb8c21c0023741b029917bf2d1e15 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 16 Sep 2025 21:23:29 +0800 Subject: [PATCH] group_box: Fix incorrect h_full in GroupBox. (#1253) Also fix the notifications example. --- crates/story/src/notification_story.rs | 9 +++++---- crates/ui/src/group_box.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/story/src/notification_story.rs b/crates/story/src/notification_story.rs index c08fe7ac..a9699221 100644 --- a/crates/story/src/notification_story.rs +++ b/crates/story/src/notification_story.rs @@ -1,13 +1,13 @@ use gpui::{ - div, App, AppContext, Context, Entity, FocusHandle, Focusable, InteractiveElement as _, - IntoElement, ParentElement, Render, Styled, Window, + App, AppContext, Context, Entity, FocusHandle, Focusable, InteractiveElement as _, IntoElement, + ParentElement, Render, Styled, Window, }; use gpui_component::{ button::{Button, ButtonVariants}, notification::{Notification, NotificationType}, text::TextView, - ContextModal as _, + v_flex, ContextModal as _, }; use crate::section; @@ -57,10 +57,11 @@ impl Focusable for NotificationStory { impl Render for NotificationStory { fn render(&mut self, _: &mut Window, cx: &mut Context) -> impl IntoElement { - div() + v_flex() .id("notification-story") .track_focus(&self.focus_handle) .size_full() + .gap_3() .child( section("Simple Notification").child( Button::new("show-notify-0") diff --git a/crates/ui/src/group_box.rs b/crates/ui/src/group_box.rs index b293b4e4..c3bce333 100644 --- a/crates/ui/src/group_box.rs +++ b/crates/ui/src/group_box.rs @@ -107,7 +107,7 @@ impl RenderOnce for GroupBox { v_flex() .id(self.id.unwrap_or("group-box".into())) - .size_full() + .w_full() .when(has_paddings, |this| this.gap_3()) .when(!has_paddings, |this| this.gap_4()) .refine_style(&self.style)