button: Fix button label display has overflow hidden. (#1322)

This commit is contained in:
Jason Lee 2025-10-03 10:18:00 +08:00 committed by GitHub
parent 908c022efe
commit e84e8ebaad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -5,7 +5,7 @@ use gpui::{
use gpui_component::{ use gpui_component::{
button::{Button, ButtonVariant, ButtonVariants}, button::{Button, ButtonVariant, ButtonVariants},
dock::PanelControl, 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; 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"),
),
)
} }
} }

View file

@ -423,7 +423,6 @@ impl RenderOnce for Button {
.tab_stop(self.tab_stop), .tab_stop(self.tab_stop),
) )
}) })
.flex_shrink_0()
.cursor_default() .cursor_default()
.flex() .flex()
.flex_shrink_0() .flex_shrink_0()
@ -534,7 +533,6 @@ impl RenderOnce for Button {
.child({ .child({
h_flex() h_flex()
.id("label") .id("label")
.overflow_hidden()
.items_center() .items_center()
.justify_center() .justify_center()
.button_text_size(self.size) .button_text_size(self.size)