From 3c4a563415f053e1b51e52938c782137775f182b Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Mon, 28 Nov 2022 17:49:10 -0500 Subject: LibGUI: Add Banner concept to AbstractScrollableWidget Banners are abstract widgets which can house additional controls and information on a temporary basis, popping in from the top of their parent when needed. --- Userland/Libraries/LibGUI/AbstractScrollableWidget.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Userland/Libraries/LibGUI/AbstractScrollableWidget.h') diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h index 4c521ecae2..7f16066093 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h @@ -50,6 +50,10 @@ public: Widget& corner_widget() { return *m_corner_widget; } Widget const& corner_widget() const { return *m_corner_widget; } + void set_banner_widget(Widget*); + Widget* banner_widget() { return m_banner_widget; } + Widget const* banner_widget() const { return m_banner_widget; } + void scroll_to_top(); void scroll_to_bottom(); @@ -58,6 +62,7 @@ public: int width_occupied_by_vertical_scrollbar() const; int height_occupied_by_horizontal_scrollbar() const; + int height_occupied_by_banner_widget() const; virtual Margins content_margins() const override; @@ -111,6 +116,7 @@ private: RefPtr m_vertical_scrollbar; RefPtr m_horizontal_scrollbar; RefPtr m_corner_widget; + WeakPtr m_banner_widget; Gfx::IntSize m_content_size; Gfx::IntSize m_min_content_size; Gfx::IntSize m_size_occupied_by_fixed_elements; -- cgit v1.2.3