From e84e8ebaad80f15ef2a2892ce12106782beb9d57 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Fri, 3 Oct 2025 10:18:00 +0800 Subject: [PATCH] button: Fix button label display has overflow hidden. (#1322) --- crates/story/src/icon_story.rs | 12 +++++++++++- crates/ui/src/button/button.rs | 2 -- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/story/src/icon_story.rs b/crates/story/src/icon_story.rs index 574f19b1..68faf1c4 100644 --- a/crates/story/src/icon_story.rs +++ b/crates/story/src/icon_story.rs @@ -5,7 +5,7 @@ use gpui::{ use gpui_component::{ button::{Button, ButtonVariant, ButtonVariants}, dock::PanelControl, - h_flex, neutral_500, v_flex, ActiveTheme as _, Icon, IconName, + h_flex, neutral_500, v_flex, ActiveTheme as _, Icon, IconName, Sizable, }; use crate::section; @@ -111,5 +111,15 @@ impl Render for IconStory { ), ), ) + .child( + section("Button with size").child( + Button::new("button-with-size") + .outline() + .size_5() + .small() + .px_0() + .label("10"), + ), + ) } } diff --git a/crates/ui/src/button/button.rs b/crates/ui/src/button/button.rs index 1b3f1df4..80beee9b 100644 --- a/crates/ui/src/button/button.rs +++ b/crates/ui/src/button/button.rs @@ -423,7 +423,6 @@ impl RenderOnce for Button { .tab_stop(self.tab_stop), ) }) - .flex_shrink_0() .cursor_default() .flex() .flex_shrink_0() @@ -534,7 +533,6 @@ impl RenderOnce for Button { .child({ h_flex() .id("label") - .overflow_hidden() .items_center() .justify_center() .button_text_size(self.size)