Skip to content

Commit

Permalink
Spreadsheet: Use shrink-to-fit for cell fg/bg color input layout
Browse files Browse the repository at this point in the history
This fixes an issue where the bottom of both color inputs was cut off
due to insufficient, hardcoded height.
  • Loading branch information
linusg committed May 5, 2021
1 parent 8978325 commit d9702ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Userland/Applications/Spreadsheet/CellTypeDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,14 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, const Vector<Position>& po
{
auto& static_formatting_container = colors_tab.add<GUI::Widget>();
static_formatting_container.set_layout<GUI::VerticalBoxLayout>();
static_formatting_container.set_shrink_to_fit(true);

// Foreground
{
// FIXME: Somehow allow unsetting these.
auto& foreground_container = static_formatting_container.add<GUI::Widget>();
foreground_container.set_layout<GUI::HorizontalBoxLayout>();
foreground_container.layout()->set_margins({ 0, 4, 0, 0 });
foreground_container.set_fixed_height(22);
foreground_container.set_shrink_to_fit(true);

auto& foreground_label = foreground_container.add<GUI::Label>();
foreground_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
Expand All @@ -292,7 +291,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, const Vector<Position>& po
auto& background_container = static_formatting_container.add<GUI::Widget>();
background_container.set_layout<GUI::HorizontalBoxLayout>();
background_container.layout()->set_margins({ 0, 4, 0, 0 });
background_container.set_fixed_height(22);
background_container.set_shrink_to_fit(true);

auto& background_label = background_container.add<GUI::Label>();
background_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
Expand Down

0 comments on commit d9702ff

Please sign in to comment.