diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/BoxLayout.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/UIDimensions.h | 19 |
3 files changed, 6 insertions, 23 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp index 22f1567c05..c0d7730b48 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp @@ -75,8 +75,8 @@ void AbstractScrollableWidget::mousewheel_event(MouseEvent& event) void AbstractScrollableWidget::custom_layout() { auto inner_rect = frame_inner_rect_for_size(size()); - int height_wanted_by_horizontal_scrollbar = m_horizontal_scrollbar->is_visible() ? int(m_horizontal_scrollbar->min_height()) : 0; - int width_wanted_by_vertical_scrollbar = m_vertical_scrollbar->is_visible() ? int(m_vertical_scrollbar->min_width()) : 0; + int height_wanted_by_horizontal_scrollbar = m_horizontal_scrollbar->is_visible() ? m_horizontal_scrollbar->effective_min_size().height().as_int() : 0; + int width_wanted_by_vertical_scrollbar = m_vertical_scrollbar->is_visible() ? m_vertical_scrollbar->effective_min_size().width().as_int() : 0; { int vertical_scrollbar_width = m_vertical_scrollbar->effective_min_size().width().as_int(); diff --git a/Userland/Libraries/LibGUI/BoxLayout.cpp b/Userland/Libraries/LibGUI/BoxLayout.cpp index bf1e875cc2..49ec9f2cd0 100644 --- a/Userland/Libraries/LibGUI/BoxLayout.cpp +++ b/Userland/Libraries/LibGUI/BoxLayout.cpp @@ -36,9 +36,9 @@ UISize BoxLayout::preferred_size() const if (!entry.widget || !entry.widget->is_visible()) continue; - UISize min_size = entry.widget->min_size(); + UISize min_size = entry.widget->effective_min_size(); UISize max_size = entry.widget->max_size(); - UISize preferred_size = entry.widget->preferred_size(); + UISize preferred_size = entry.widget->effective_preferred_size(); if (result_primary != SpecialDimension::Grow) { UIDimension item_primary_size = clamp( @@ -98,7 +98,7 @@ UISize BoxLayout::min_size() const if (!entry.widget || !entry.widget->is_visible()) continue; - UISize min_size = entry.widget->min_size(); + UISize min_size = entry.widget->effective_min_size(); { UIDimension primary_min_size = min_size.primary_size_for_orientation(orientation()); diff --git a/Userland/Libraries/LibGUI/UIDimensions.h b/Userland/Libraries/LibGUI/UIDimensions.h index 257ac1a6ae..97eba9de55 100644 --- a/Userland/Libraries/LibGUI/UIDimensions.h +++ b/Userland/Libraries/LibGUI/UIDimensions.h @@ -42,12 +42,6 @@ public: { } - // This is a temporary hack to get this compiling - operator int() const - { - return m_value; - } - [[nodiscard]] inline bool is_special_value() const { return m_value < 0; @@ -154,11 +148,6 @@ public: VERIFY_NOT_REACHED(); } - operator AK::JsonValue() const - { - return this->as_json_value(); - } - [[nodiscard]] static Optional<UIDimension> construct_from_json_value(AK::JsonValue const value) { if (value.is_string()) { @@ -181,12 +170,6 @@ public: } } - // FIXME: Remove these following methods when the move to the new layout system is completed - [[nodiscard]] inline bool operator==(int other) const - { - return m_value == other; - } - private: int m_value; }; @@ -235,7 +218,7 @@ public: return (width() == to_match || height() == to_match); } - operator Gfx::IntSize() const + explicit operator Gfx::IntSize() const { return Gfx::IntSize(width().as_int(), height().as_int()); } |