From 39c8590720074baaf7556826ca417aa36cc032ff Mon Sep 17 00:00:00 2001 From: FrHun <28605587+frhun@users.noreply.github.com> Date: Wed, 29 Jun 2022 05:06:56 +0200 Subject: [PATCH] LibGUI: Change Label standard preferred height to opportunistic grow The default size for label is always a compromise, no matter what value is chosen, some layouts will require local manual overrides. Having the preferred size be opportunistic_grow in both directions seems like it's currently the option that works without modification in most cases. --- Userland/Libraries/LibGUI/Label.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Label.cpp b/Userland/Libraries/LibGUI/Label.cpp index eca706597c..c7d2bb7d5c 100644 --- a/Userland/Libraries/LibGUI/Label.cpp +++ b/Userland/Libraries/LibGUI/Label.cpp @@ -23,7 +23,8 @@ Label::Label(String text) REGISTER_TEXT_ALIGNMENT_PROPERTY("text_alignment", text_alignment, set_text_alignment); REGISTER_TEXT_WRAPPING_PROPERTY("text_wrapping", text_wrapping, set_text_wrapping); - set_preferred_size({ SpecialDimension::OpportunisticGrow, 22 }); + set_preferred_size({ SpecialDimension::OpportunisticGrow }); + set_min_height(22); set_frame_thickness(0); set_frame_shadow(Gfx::FrameShadow::Plain);