1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

LibGUI: Make GUI::Label auto-sizing declarative

You can now set the "autosize" property on a GUI::Label and it will
automatically update its width preference to fit the text.
This commit is contained in:
Andreas Kling 2020-12-20 12:35:10 +01:00
parent de08e7b8c9
commit 64ba41ea13
4 changed files with 18 additions and 5 deletions

View file

@ -300,9 +300,6 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
auto& location_toolbar = (GUI::ToolBar&)*widget.find_descendant_by_name("location_toolbar");
location_toolbar.layout()->set_margins({ 6, 3, 6, 3 });
auto& location_label = (GUI::Label&)*widget.find_descendant_by_name("location_label");
location_label.size_to_fit();
auto& location_textbox = (GUI::TextBox&)*widget.find_descendant_by_name("location_textbox");
auto& breadcrumb_toolbar = (GUI::ToolBar&)*widget.find_descendant_by_name("breadcrumb_toolbar");