summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/SeparatorWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGUI/SeparatorWidget.cpp')
-rw-r--r--Userland/Libraries/LibGUI/SeparatorWidget.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/SeparatorWidget.cpp b/Userland/Libraries/LibGUI/SeparatorWidget.cpp
index 91bd6b137b..b60221de2f 100644
--- a/Userland/Libraries/LibGUI/SeparatorWidget.cpp
+++ b/Userland/Libraries/LibGUI/SeparatorWidget.cpp
@@ -17,10 +17,7 @@ namespace GUI {
SeparatorWidget::SeparatorWidget(Gfx::Orientation orientation)
: m_orientation(orientation)
{
- if (m_orientation == Gfx::Orientation::Vertical)
- set_fixed_width(8);
- else
- set_fixed_height(8);
+ set_preferred_size(SpecialDimension::Fit);
}
void SeparatorWidget::paint_event(PaintEvent& event)
@@ -39,4 +36,11 @@ void SeparatorWidget::paint_event(PaintEvent& event)
}
}
+Optional<UISize> SeparatorWidget::calculated_preferred_size() const
+{
+ if (m_orientation == Gfx::Orientation::Vertical)
+ return UISize { 8, SpecialDimension::OpportunisticGrow };
+ return UISize { SpecialDimension::OpportunisticGrow, 8 };
+}
+
}