summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Applications/Browser/Tab.cpp2
-rw-r--r--Userland/Applications/Browser/Tab.h2
-rw-r--r--Userland/Applications/FontEditor/GlyphMapWidget.cpp2
-rw-r--r--Userland/Applications/FontEditor/GlyphMapWidget.h4
-rw-r--r--Userland/Applications/HexEditor/HexEditor.h4
-rw-r--r--Userland/Applications/Piano/RollWidget.cpp2
-rw-r--r--Userland/Applications/Piano/RollWidget.h4
-rw-r--r--Userland/Applications/Spreadsheet/ConditionalFormatting.h2
-rw-r--r--Userland/DevTools/HackStudio/FormEditorWidget.h4
-rw-r--r--Userland/DevTools/HackStudio/Git/DiffViewer.cpp2
-rw-r--r--Userland/DevTools/HackStudio/Git/DiffViewer.h4
-rw-r--r--Userland/Libraries/LibGUI/AbstractScrollableWidget.h (renamed from Userland/Libraries/LibGUI/ScrollableWidget.h)23
-rw-r--r--Userland/Libraries/LibGUI/AbstractTableView.cpp2
-rw-r--r--Userland/Libraries/LibGUI/AbstractView.cpp22
-rw-r--r--Userland/Libraries/LibGUI/AbstractView.h4
-rw-r--r--Userland/Libraries/LibGUI/Forward.h2
-rw-r--r--Userland/Libraries/LibGUI/IconView.cpp4
-rw-r--r--Userland/Libraries/LibGUI/ListView.cpp2
-rw-r--r--Userland/Libraries/LibGUI/ScrollableWidget.cpp52
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.cpp8
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.h4
-rw-r--r--Userland/Libraries/LibGUI/TreeView.cpp2
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.cpp14
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.h6
-rw-r--r--Userland/Libraries/LibWeb/OutOfProcessWebView.cpp6
-rw-r--r--Userland/Libraries/LibWeb/OutOfProcessWebView.h6
26 files changed, 95 insertions, 94 deletions
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp
index 011ecf2801..c1587f7e6b 100644
--- a/Userland/Applications/Browser/Tab.cpp
+++ b/Userland/Applications/Browser/Tab.cpp
@@ -680,7 +680,7 @@ void Tab::context_menu_requested(const Gfx::IntPoint& screen_position)
m_tab_context_menu->popup(screen_position);
}
-GUI::ScrollableWidget& Tab::view()
+GUI::AbstractScrollableWidget& Tab::view()
{
if (m_type == Type::InProcessWebView)
return *m_page_view;
diff --git a/Userland/Applications/Browser/Tab.h b/Userland/Applications/Browser/Tab.h
index e02a097998..cade9ccfc7 100644
--- a/Userland/Applications/Browser/Tab.h
+++ b/Userland/Applications/Browser/Tab.h
@@ -61,7 +61,7 @@ public:
const String& title() const { return m_title; }
const Gfx::Bitmap* icon() const { return m_icon; }
- GUI::ScrollableWidget& view();
+ GUI::AbstractScrollableWidget& view();
private:
explicit Tab(Type);
diff --git a/Userland/Applications/FontEditor/GlyphMapWidget.cpp b/Userland/Applications/FontEditor/GlyphMapWidget.cpp
index 51a1161415..a30b34b30a 100644
--- a/Userland/Applications/FontEditor/GlyphMapWidget.cpp
+++ b/Userland/Applications/FontEditor/GlyphMapWidget.cpp
@@ -39,7 +39,7 @@ void GlyphMapWidget::resize_event(GUI::ResizeEvent& event)
int content_height = rows() * (font().glyph_height() + m_vertical_spacing) + frame_thickness();
set_content_size({ content_width, content_height });
- ScrollableWidget::resize_event(event);
+ AbstractScrollableWidget::resize_event(event);
}
void GlyphMapWidget::set_selected_glyph(int glyph)
diff --git a/Userland/Applications/FontEditor/GlyphMapWidget.h b/Userland/Applications/FontEditor/GlyphMapWidget.h
index 949582b8b7..a2dbcb4897 100644
--- a/Userland/Applications/FontEditor/GlyphMapWidget.h
+++ b/Userland/Applications/FontEditor/GlyphMapWidget.h
@@ -6,10 +6,10 @@
#pragma once
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGfx/BitmapFont.h>
-class GlyphMapWidget final : public GUI::ScrollableWidget {
+class GlyphMapWidget final : public GUI::AbstractScrollableWidget {
C_OBJECT(GlyphMapWidget)
public:
virtual ~GlyphMapWidget() override;
diff --git a/Userland/Applications/HexEditor/HexEditor.h b/Userland/Applications/HexEditor/HexEditor.h
index 9ef97ad7ca..d03d45f7f6 100644
--- a/Userland/Applications/HexEditor/HexEditor.h
+++ b/Userland/Applications/HexEditor/HexEditor.h
@@ -12,11 +12,11 @@
#include <AK/NonnullOwnPtrVector.h>
#include <AK/NonnullRefPtrVector.h>
#include <AK/StdLibExtras.h>
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGfx/Font.h>
#include <LibGfx/TextAlignment.h>
-class HexEditor : public GUI::ScrollableWidget {
+class HexEditor : public GUI::AbstractScrollableWidget {
C_OBJECT(HexEditor)
public:
enum EditMode {
diff --git a/Userland/Applications/Piano/RollWidget.cpp b/Userland/Applications/Piano/RollWidget.cpp
index 2416405a74..b9dc063203 100644
--- a/Userland/Applications/Piano/RollWidget.cpp
+++ b/Userland/Applications/Piano/RollWidget.cpp
@@ -248,7 +248,7 @@ void RollWidget::mousewheel_event(GUI::MouseEvent& event)
}
if (!(event.modifiers() & KeyModifier::Mod_Ctrl)) {
- GUI::ScrollableWidget::mousewheel_event(event);
+ GUI::AbstractScrollableWidget::mousewheel_event(event);
return;
}
diff --git a/Userland/Applications/Piano/RollWidget.h b/Userland/Applications/Piano/RollWidget.h
index 85b0d16d82..db33f2aa62 100644
--- a/Userland/Applications/Piano/RollWidget.h
+++ b/Userland/Applications/Piano/RollWidget.h
@@ -10,11 +10,11 @@
#include "KeysWidget.h"
#include "Music.h"
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
class TrackManager;
-class RollWidget final : public GUI::ScrollableWidget {
+class RollWidget final : public GUI::AbstractScrollableWidget {
C_OBJECT(RollWidget)
public:
virtual ~RollWidget() override;
diff --git a/Userland/Applications/Spreadsheet/ConditionalFormatting.h b/Userland/Applications/Spreadsheet/ConditionalFormatting.h
index cdfa3a11a6..3c52faffd9 100644
--- a/Userland/Applications/Spreadsheet/ConditionalFormatting.h
+++ b/Userland/Applications/Spreadsheet/ConditionalFormatting.h
@@ -8,7 +8,7 @@
#include "Forward.h"
#include <AK/String.h>
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGfx/Color.h>
namespace Spreadsheet {
diff --git a/Userland/DevTools/HackStudio/FormEditorWidget.h b/Userland/DevTools/HackStudio/FormEditorWidget.h
index 4975877674..56957a8901 100644
--- a/Userland/DevTools/HackStudio/FormEditorWidget.h
+++ b/Userland/DevTools/HackStudio/FormEditorWidget.h
@@ -7,7 +7,7 @@
#pragma once
#include <AK/HashTable.h>
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
namespace HackStudio {
@@ -15,7 +15,7 @@ class FormWidget;
class Tool;
class WidgetTreeModel;
-class FormEditorWidget final : public GUI::ScrollableWidget {
+class FormEditorWidget final : public GUI::AbstractScrollableWidget {
C_OBJECT(FormEditorWidget)
public:
virtual ~FormEditorWidget() override;
diff --git a/Userland/DevTools/HackStudio/Git/DiffViewer.cpp b/Userland/DevTools/HackStudio/Git/DiffViewer.cpp
index 139478c77b..7c57501f16 100644
--- a/Userland/DevTools/HackStudio/Git/DiffViewer.cpp
+++ b/Userland/DevTools/HackStudio/Git/DiffViewer.cpp
@@ -225,7 +225,7 @@ void DiffViewer::update_content_size()
void DiffViewer::resize_event(GUI::ResizeEvent& event)
{
- ScrollableWidget::resize_event(event);
+ AbstractScrollableWidget::resize_event(event);
update_content_size();
}
diff --git a/Userland/DevTools/HackStudio/Git/DiffViewer.h b/Userland/DevTools/HackStudio/Git/DiffViewer.h
index 136a27da10..eaaba2670d 100644
--- a/Userland/DevTools/HackStudio/Git/DiffViewer.h
+++ b/Userland/DevTools/HackStudio/Git/DiffViewer.h
@@ -9,10 +9,10 @@
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibDiff/Hunks.h>
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
namespace HackStudio {
-class DiffViewer final : public GUI::ScrollableWidget {
+class DiffViewer final : public GUI::AbstractScrollableWidget {
C_OBJECT(DiffViewer)
public:
virtual ~DiffViewer() override;
diff --git a/Userland/Libraries/LibGUI/ScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h
index 17ecef5b47..11d8c234a3 100644
--- a/Userland/Libraries/LibGUI/ScrollableWidget.h
+++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -11,10 +11,11 @@
namespace GUI {
-class ScrollableWidget : public Frame {
- C_OBJECT(ScrollableWidget)
+class AbstractScrollableWidget : public Frame {
+ C_OBJECT_ABSTRACT(AbstractScrollableWidget);
+
public:
- virtual ~ScrollableWidget() override;
+ virtual ~AbstractScrollableWidget() override;
Gfx::IntSize content_size() const { return m_content_size; }
int content_width() const { return m_content_size.width(); }
@@ -63,7 +64,7 @@ public:
Gfx::IntRect to_widget_rect(const Gfx::IntRect& content_rect) const { return { to_widget_position(content_rect.location()), content_rect.size() }; }
protected:
- ScrollableWidget();
+ AbstractScrollableWidget();
virtual void custom_layout() override;
virtual void resize_event(ResizeEvent&) override;
virtual void mousewheel_event(MouseEvent&) override;
@@ -72,11 +73,11 @@ protected:
void set_size_occupied_by_fixed_elements(const Gfx::IntSize&);
private:
- class ScrollableWidgetScrollbar final : public Scrollbar {
- C_OBJECT(ScrollableWidgetScrollbar);
+ class AbstractScrollableWidgetScrollbar final : public Scrollbar {
+ C_OBJECT(AbstractScrollableWidgetScrollbar);
protected:
- explicit ScrollableWidgetScrollbar(ScrollableWidget& owner, Gfx::Orientation orientation)
+ explicit AbstractScrollableWidgetScrollbar(AbstractScrollableWidget& owner, Gfx::Orientation orientation)
: Scrollbar(orientation)
, m_owner(owner)
{
@@ -88,15 +89,15 @@ private:
}
private:
- ScrollableWidget& m_owner;
+ AbstractScrollableWidget& m_owner;
};
friend class ScrollableWidgetScrollbar;
void update_scrollbar_ranges();
void handle_wheel_event(MouseEvent&, Widget&);
- RefPtr<ScrollableWidgetScrollbar> m_vertical_scrollbar;
- RefPtr<ScrollableWidgetScrollbar> m_horizontal_scrollbar;
+ RefPtr<AbstractScrollableWidgetScrollbar> m_vertical_scrollbar;
+ RefPtr<AbstractScrollableWidgetScrollbar> m_horizontal_scrollbar;
RefPtr<Widget> m_corner_widget;
Gfx::IntSize m_content_size;
Gfx::IntSize m_size_occupied_by_fixed_elements;
diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp
index b2553de11d..e4492b8e91 100644
--- a/Userland/Libraries/LibGUI/AbstractTableView.cpp
+++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp
@@ -272,7 +272,7 @@ void AbstractTableView::scroll_into_view(const ModelIndex& index, bool scroll_ho
rect = row_rect(index.row());
break;
}
- ScrollableWidget::scroll_into_view(rect, scroll_horizontally, scroll_vertically);
+ AbstractScrollableWidget::scroll_into_view(rect, scroll_horizontally, scroll_vertically);
}
void AbstractTableView::context_menu_event(ContextMenuEvent& event)
diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp
index 43af9a15cc..8bb9462773 100644
--- a/Userland/Libraries/LibGUI/AbstractView.cpp
+++ b/Userland/Libraries/LibGUI/AbstractView.cpp
@@ -212,7 +212,7 @@ NonnullRefPtr<Gfx::Font> AbstractView::font_for_index(const ModelIndex& index) c
void AbstractView::mousedown_event(MouseEvent& event)
{
- ScrollableWidget::mousedown_event(event);
+ AbstractScrollableWidget::mousedown_event(event);
if (!model())
return;
@@ -254,28 +254,28 @@ void AbstractView::set_hovered_index(const ModelIndex& index)
void AbstractView::leave_event(Core::Event& event)
{
- ScrollableWidget::leave_event(event);
+ AbstractScrollableWidget::leave_event(event);
set_hovered_index({});
}
void AbstractView::mousemove_event(MouseEvent& event)
{
if (!model())
- return ScrollableWidget::mousemove_event(event);
+ return AbstractScrollableWidget::mousemove_event(event);
auto hovered_index = index_at_event_position(event.position());
set_hovered_index(hovered_index);
auto data_type = m_model->drag_data_type();
if (data_type.is_null())
- return ScrollableWidget::mousemove_event(event);
+ return AbstractScrollableWidget::mousemove_event(event);
if (!m_might_drag)
- return ScrollableWidget::mousemove_event(event);
+ return AbstractScrollableWidget::mousemove_event(event);
if (!(event.buttons() & MouseButton::Left) || m_selection.is_empty()) {
m_might_drag = false;
- return ScrollableWidget::mousemove_event(event);
+ return AbstractScrollableWidget::mousemove_event(event);
}
auto diff = event.position() - m_left_mousedown_position;
@@ -283,7 +283,7 @@ void AbstractView::mousemove_event(MouseEvent& event)
constexpr int drag_distance_threshold = 5;
if (distance_travelled_squared <= drag_distance_threshold)
- return ScrollableWidget::mousemove_event(event);
+ return AbstractScrollableWidget::mousemove_event(event);
VERIFY(!data_type.is_null());
@@ -317,7 +317,7 @@ void AbstractView::mousemove_event(MouseEvent& event)
void AbstractView::mouseup_event(MouseEvent& event)
{
- ScrollableWidget::mouseup_event(event);
+ AbstractScrollableWidget::mouseup_event(event);
if (!model())
return;
@@ -481,7 +481,7 @@ void AbstractView::set_edit_triggers(unsigned triggers)
void AbstractView::hide_event(HideEvent& event)
{
stop_editing();
- ScrollableWidget::hide_event(event);
+ AbstractScrollableWidget::hide_event(event);
}
void AbstractView::keydown_event(KeyEvent& event)
@@ -596,7 +596,7 @@ void AbstractView::keydown_event(KeyEvent& event)
}
}
- ScrollableWidget::keydown_event(event);
+ AbstractScrollableWidget::keydown_event(event);
}
void AbstractView::cancel_searching()
@@ -706,7 +706,7 @@ void AbstractView::draw_item_text(Gfx::Painter& painter, const ModelIndex& index
void AbstractView::focusin_event(FocusEvent& event)
{
- ScrollableWidget::focusin_event(event);
+ AbstractScrollableWidget::focusin_event(event);
if (model() && !cursor_index().is_valid()) {
move_cursor(CursorMovement::Home, SelectionUpdate::None);
diff --git a/Userland/Libraries/LibGUI/AbstractView.h b/Userland/Libraries/LibGUI/AbstractView.h
index ce62910cc3..065beeff64 100644
--- a/Userland/Libraries/LibGUI/AbstractView.h
+++ b/Userland/Libraries/LibGUI/AbstractView.h
@@ -7,15 +7,15 @@
#pragma once
#include <AK/Function.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGUI/Model.h>
#include <LibGUI/ModelSelection.h>
-#include <LibGUI/ScrollableWidget.h>
#include <LibGfx/TextElision.h>
namespace GUI {
class AbstractView
- : public ScrollableWidget
+ : public AbstractScrollableWidget
, public ModelClient {
C_OBJECT_ABSTRACT(AbstractView);
diff --git a/Userland/Libraries/LibGUI/Forward.h b/Userland/Libraries/LibGUI/Forward.h
index 48e4e67098..83c97aaaad 100644
--- a/Userland/Libraries/LibGUI/Forward.h
+++ b/Userland/Libraries/LibGUI/Forward.h
@@ -54,7 +54,7 @@ class ResizeCorner;
class ResizeEvent;
class ScreenRectChangeEvent;
class Scrollbar;
-class ScrollableWidget;
+class AbstractScrollableWidget;
class Slider;
class SortingProxyModel;
class SpinBox;
diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp
index 54d2651045..8977539877 100644
--- a/Userland/Libraries/LibGUI/IconView.cpp
+++ b/Userland/Libraries/LibGUI/IconView.cpp
@@ -43,7 +43,7 @@ void IconView::scroll_into_view(const ModelIndex& index, bool scroll_horizontall
{
if (!index.is_valid())
return;
- ScrollableWidget::scroll_into_view(item_rect(index.row()), scroll_horizontally, scroll_vertically);
+ AbstractScrollableWidget::scroll_into_view(item_rect(index.row()), scroll_horizontally, scroll_vertically);
}
void IconView::resize_event(ResizeEvent& event)
@@ -373,7 +373,7 @@ void IconView::scroll_out_of_view_timer_fired()
else if (m_out_of_view_position.x() < in_view_rect.left())
adjust_x = -(SCROLL_OUT_OF_VIEW_HOT_MARGIN / 2) + max(-SCROLL_OUT_OF_VIEW_HOT_MARGIN, m_out_of_view_position.x() - in_view_rect.left());
- ScrollableWidget::scroll_into_view({ scroll_to.translated(adjust_x, adjust_y), { 1, 1 } }, true, true);
+ AbstractScrollableWidget::scroll_into_view({ scroll_to.translated(adjust_x, adjust_y), { 1, 1 } }, true, true);
update_rubber_banding(m_out_of_view_position);
}
diff --git a/Userland/Libraries/LibGUI/ListView.cpp b/Userland/Libraries/LibGUI/ListView.cpp
index 50a869f78c..86bd0b6a1d 100644
--- a/Userland/Libraries/LibGUI/ListView.cpp
+++ b/Userland/Libraries/LibGUI/ListView.cpp
@@ -262,7 +262,7 @@ void ListView::scroll_into_view(const ModelIndex& index, bool scroll_horizontall
{
if (!model())
return;
- ScrollableWidget::scroll_into_view(content_rect(index.row()), scroll_horizontally, scroll_vertically);
+ AbstractScrollableWidget::scroll_into_view(content_rect(index.row()), scroll_horizontally, scroll_vertically);
}
}
diff --git a/Userland/Libraries/LibGUI/ScrollableWidget.cpp b/Userland/Libraries/LibGUI/ScrollableWidget.cpp
index 8d586b499e..3f9430427c 100644
--- a/Userland/Libraries/LibGUI/ScrollableWidget.cpp
+++ b/Userland/Libraries/LibGUI/ScrollableWidget.cpp
@@ -1,24 +1,24 @@
/*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGUI/Scrollbar.h>
namespace GUI {
-ScrollableWidget::ScrollableWidget()
+AbstractScrollableWidget::AbstractScrollableWidget()
{
- m_vertical_scrollbar = add<ScrollableWidgetScrollbar>(*this, Orientation::Vertical);
+ m_vertical_scrollbar = add<AbstractScrollableWidgetScrollbar>(*this, Orientation::Vertical);
m_vertical_scrollbar->set_step(4);
m_vertical_scrollbar->on_change = [this](int) {
did_scroll();
update();
};
- m_horizontal_scrollbar = add<ScrollableWidgetScrollbar>(*this, Orientation::Horizontal);
+ m_horizontal_scrollbar = add<AbstractScrollableWidgetScrollbar>(*this, Orientation::Horizontal);
m_horizontal_scrollbar->set_step(4);
m_horizontal_scrollbar->set_page_step(30);
m_horizontal_scrollbar->on_change = [this](int) {
@@ -30,11 +30,11 @@ ScrollableWidget::ScrollableWidget()
m_corner_widget->set_fill_with_background_color(true);
}
-ScrollableWidget::~ScrollableWidget()
+AbstractScrollableWidget::~AbstractScrollableWidget()
{
}
-void ScrollableWidget::handle_wheel_event(MouseEvent& event, Widget& event_source)
+void AbstractScrollableWidget::handle_wheel_event(MouseEvent& event, Widget& event_source)
{
if (!m_scrollbars_enabled) {
event.ignore();
@@ -48,12 +48,12 @@ void ScrollableWidget::handle_wheel_event(MouseEvent& event, Widget& event_sourc
}
}
-void ScrollableWidget::mousewheel_event(MouseEvent& event)
+void AbstractScrollableWidget::mousewheel_event(MouseEvent& event)
{
handle_wheel_event(event, *this);
}
-void ScrollableWidget::custom_layout()
+void AbstractScrollableWidget::custom_layout()
{
auto inner_rect = frame_inner_rect_for_size(size());
int height_wanted_by_horizontal_scrollbar = m_horizontal_scrollbar->is_visible() ? m_horizontal_scrollbar->min_height() : 0;
@@ -78,20 +78,20 @@ void ScrollableWidget::custom_layout()
}
}
-void ScrollableWidget::resize_event(ResizeEvent& event)
+void AbstractScrollableWidget::resize_event(ResizeEvent& event)
{
Frame::resize_event(event);
update_scrollbar_ranges();
}
-Gfx::IntSize ScrollableWidget::available_size() const
+Gfx::IntSize AbstractScrollableWidget::available_size() const
{
unsigned available_width = max(frame_inner_rect().width() - m_size_occupied_by_fixed_elements.width() - width_occupied_by_vertical_scrollbar(), 0);
unsigned available_height = max(frame_inner_rect().height() - m_size_occupied_by_fixed_elements.height() - height_occupied_by_horizontal_scrollbar(), 0);
return { available_width, available_height };
}
-Gfx::IntSize ScrollableWidget::excess_size() const
+Gfx::IntSize AbstractScrollableWidget::excess_size() const
{
auto available_size = this->available_size();
int excess_height = max(0, m_content_size.height() - available_size.height());
@@ -99,7 +99,7 @@ Gfx::IntSize ScrollableWidget::excess_size() const
return { excess_width, excess_height };
}
-void ScrollableWidget::update_scrollbar_ranges()
+void AbstractScrollableWidget::update_scrollbar_ranges()
{
if (should_hide_unnecessary_scrollbars()) {
if (excess_size().height() - height_occupied_by_horizontal_scrollbar() <= 0 && excess_size().width() - width_occupied_by_vertical_scrollbar() <= 0) {
@@ -126,7 +126,7 @@ void ScrollableWidget::update_scrollbar_ranges()
m_vertical_scrollbar->set_page_step(visible_content_rect().height() - m_vertical_scrollbar->step());
}
-void ScrollableWidget::set_content_size(const Gfx::IntSize& size)
+void AbstractScrollableWidget::set_content_size(const Gfx::IntSize& size)
{
if (m_content_size == size)
return;
@@ -134,7 +134,7 @@ void ScrollableWidget::set_content_size(const Gfx::IntSize& size)
update_scrollbar_ranges();
}
-void ScrollableWidget::set_size_occupied_by_fixed_elements(const Gfx::IntSize& size)
+void AbstractScrollableWidget::set_size_occupied_by_fixed_elements(const Gfx::IntSize& size)
{
if (m_size_occupied_by_fixed_elements == size)
return;
@@ -142,17 +142,17 @@ void ScrollableWidget::set_size_occupied_by_fixed_elements(const Gfx::IntSize& s
update_scrollbar_ranges();
}
-int ScrollableWidget::height_occupied_by_horizontal_scrollbar() const
+int AbstractScrollableWidget::height_occupied_by_horizontal_scrollbar() const
{
return m_horizontal_scrollbar->is_visible() ? m_horizontal_scrollbar->height() : 0;
}
-int ScrollableWidget::width_occupied_by_vertical_scrollbar() const
+int AbstractScrollableWidget::width_occupied_by_vertical_scrollbar() const
{
return m_vertical_scrollbar->is_visible() ? m_vertical_scrollbar->width() : 0;
}
-Gfx::IntRect ScrollableWidget::visible_content_rect() const
+Gfx::IntRect AbstractScrollableWidget::visible_content_rect() const
{
Gfx::IntRect rect {
m_horizontal_scrollbar->value(),
@@ -165,14 +165,14 @@ Gfx::IntRect ScrollableWidget::visible_content_rect() const
return rect;
}
-void ScrollableWidget::scroll_into_view(const Gfx::IntRect& rect, Orientation orientation)
+void AbstractScrollableWidget::scroll_into_view(const Gfx::IntRect& rect, Orientation orientation)
{
if (orientation == Orientation::Vertical)
return scroll_into_view(rect, false, true);
return scroll_into_view(rect, true, false);
}
-void ScrollableWidget::scroll_into_view(const Gfx::IntRect& rect, bool scroll_horizontally, bool scroll_vertically)
+void AbstractScrollableWidget::scroll_into_view(const Gfx::IntRect& rect, bool scroll_horizontally, bool scroll_vertically)
{
auto visible_content_rect = this->visible_content_rect();
if (visible_content_rect.contains(rect))
@@ -194,7 +194,7 @@ void ScrollableWidget::scroll_into_view(const Gfx::IntRect& rect, bool scroll_ho
}
}
-void ScrollableWidget::set_scrollbars_enabled(bool scrollbars_enabled)
+void AbstractScrollableWidget::set_scrollbars_enabled(bool scrollbars_enabled)
{
if (m_scrollbars_enabled == scrollbars_enabled)
return;
@@ -204,17 +204,17 @@ void ScrollableWidget::set_scrollbars_enabled(bool scrollbars_enabled)
m_corner_widget->set_visible(m_scrollbars_enabled);
}
-void ScrollableWidget::scroll_to_top()
+void AbstractScrollableWidget::scroll_to_top()
{
scroll_into_view({}, Orientation::Vertical);
}
-void ScrollableWidget::scroll_to_bottom()
+void AbstractScrollableWidget::scroll_to_bottom()
{
scroll_into_view({ 0, content_height(), 0, 0 }, Orientation::Vertical);
}
-Gfx::IntRect ScrollableWidget::widget_inner_rect() const
+Gfx::IntRect AbstractScrollableWidget::widget_inner_rect() const
{
auto rect = frame_inner_rect();
rect.set_width(rect.width() - width_occupied_by_vertical_scrollbar());
@@ -222,7 +222,7 @@ Gfx::IntRect ScrollableWidget::widget_inner_rect() const
return rect;
}
-Gfx::IntPoint ScrollableWidget::to_content_position(const Gfx::IntPoint& widget_position) const
+Gfx::IntPoint AbstractScrollableWidget::to_content_position(const Gfx::IntPoint& widget_position) const
{
auto content_position = widget_position;
content_position.translate_by(horizontal_scrollbar().value(), vertical_scrollbar().value());
@@ -230,7 +230,7 @@ Gfx::IntPoint ScrollableWidget::to_content_position(const Gfx::IntPoint& widget_
return content_position;
}
-Gfx::IntPoint ScrollableWidget::to_widget_position(const Gfx::IntPoint& content_position) const
+Gfx::IntPoint AbstractScrollableWidget::to_widget_position(const Gfx::IntPoint& content_position) const
{
auto widget_position = content_position;
widget_position.translate_by(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp
index 1e6256ec1b..fcb9bfe542 100644
--- a/Userland/Libraries/LibGUI/TextEditor.cpp
+++ b/Userland/Libraries/LibGUI/TextEditor.cpp
@@ -729,7 +729,7 @@ void TextEditor::keydown_event(KeyEvent& event)
if (is_single_line()) {
if (event.key() == KeyCode::Key_Tab)
- return ScrollableWidget::keydown_event(event);
+ return AbstractScrollableWidget::keydown_event(event);
if (event.key() == KeyCode::Key_Return) {
if (on_return_pressed)
@@ -1425,14 +1425,14 @@ void TextEditor::set_text_alignment(Gfx::TextAlignment alignment)
void TextEditor::resize_event(ResizeEvent& event)
{
- ScrollableWidget::resize_event(event);
+ AbstractScrollableWidget::resize_event(event);
update_content_size();
recompute_all_visual_lines();
}
void TextEditor::theme_change_event(ThemeChangeEvent& event)
{
- ScrollableWidget::theme_change_event(event);
+ AbstractScrollableWidget::theme_change_event(event);
if (m_highlighter)
m_highlighter->rehighlight(palette());
}
@@ -1599,7 +1599,7 @@ void TextEditor::did_change_font()
vertical_scrollbar().set_step(line_height());
recompute_all_visual_lines();
update();
- ScrollableWidget::did_change_font();
+ AbstractScrollableWidget::did_change_font();
}
void TextEditor::document_did_append_line()
diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h
index e4614b31af..44de99cbc9 100644
--- a/Userland/Libraries/LibGUI/TextEditor.h
+++ b/Userland/Libraries/LibGUI/TextEditor.h
@@ -11,8 +11,8 @@
#include <AK/NonnullRefPtrVector.h>
#include <LibCore/ElapsedTimer.h>
#include <LibCore/Timer.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGUI/Forward.h>
-#include <LibGUI/ScrollableWidget.h>
#include <LibGUI/TextDocument.h>
#include <LibGUI/TextRange.h>
#include <LibGfx/TextAlignment.h>
@@ -22,7 +22,7 @@
namespace GUI {
class TextEditor
- : public ScrollableWidget
+ : public AbstractScrollableWidget
, public TextDocument::Client
, public Syntax::HighlighterClient {
C_OBJECT(TextEditor);
diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp
index 01e50f089f..39ac1b76c6 100644
--- a/Userland/Libraries/LibGUI/TreeView.cpp
+++ b/Userland/Libraries/LibGUI/TreeView.cpp
@@ -380,7 +380,7 @@ void TreeView::scroll_into_view(const ModelIndex& a_index, bool scroll_horizonta
}
return IterationDecision::Continue;
});
- ScrollableWidget::scroll_into_view(found_rect, scroll_horizontally, scroll_vertically);
+ AbstractScrollableWidget::scroll_into_view(found_rect, scroll_horizontally, scroll_vertically);
}
void TreeView::model_did_update(unsigned flags)
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp
index d5afb5c005..5417658e6c 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp
@@ -225,7 +225,7 @@ void InProcessWebView::layout_and_sync_size()
void InProcessWebView::resize_event(GUI::ResizeEvent& event)
{
- GUI::ScrollableWidget::resize_event(event);
+ GUI::AbstractScrollableWidget::resize_event(event);
layout_and_sync_size();
}
@@ -254,25 +254,25 @@ void InProcessWebView::paint_event(GUI::PaintEvent& event)
void InProcessWebView::mousemove_event(GUI::MouseEvent& event)
{
page().handle_mousemove(to_content_position(event.position()), event.buttons(), event.modifiers());
- GUI::ScrollableWidget::mousemove_event(event);
+ GUI::AbstractScrollableWidget::mousemove_event(event);
}
void InProcessWebView::mousedown_event(GUI::MouseEvent& event)
{
page().handle_mousedown(to_content_position(event.position()), event.button(), event.modifiers());
- GUI::ScrollableWidget::mousedown_event(event);
+ GUI::AbstractScrollableWidget::mousedown_event(event);
}
void InProcessWebView::mouseup_event(GUI::MouseEvent& event)
{
page().handle_mouseup(to_content_position(event.position()), event.button(), event.modifiers());
- GUI::ScrollableWidget::mouseup_event(event);
+ GUI::AbstractScrollableWidget::mouseup_event(event);
}
void InProcessWebView::mousewheel_event(GUI::MouseEvent& event)
{
page().handle_mousewheel(to_content_position(event.position()), event.button(), event.modifiers(), event.wheel_delta());
- GUI::ScrollableWidget::mousewheel_event(event);
+ GUI::AbstractScrollableWidget::mousewheel_event(event);
}
void InProcessWebView::keydown_event(GUI::KeyEvent& event)
@@ -307,7 +307,7 @@ void InProcessWebView::keydown_event(GUI::KeyEvent& event)
break;
default:
if (!page_accepted_event) {
- ScrollableWidget::keydown_event(event);
+ AbstractScrollableWidget::keydown_event(event);
return;
}
break;
@@ -391,7 +391,7 @@ void InProcessWebView::drop_event(GUI::DropEvent& event)
return;
}
}
- ScrollableWidget::drop_event(event);
+ AbstractScrollableWidget::drop_event(event);
}
void InProcessWebView::page_did_request_alert(const String& message)
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.h b/Userland/Libraries/LibWeb/InProcessWebView.h
index 2cca3056ea..12c5e58864 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.h
+++ b/Userland/Libraries/LibWeb/InProcessWebView.h
@@ -7,8 +7,8 @@
#pragma once
#include <AK/URL.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGUI/Desktop.h>
-#include <LibGUI/ScrollableWidget.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Page/Page.h>
#include <LibWeb/WebViewHooks.h>
@@ -16,7 +16,7 @@
namespace Web {
class InProcessWebView final
- : public GUI::ScrollableWidget
+ : public GUI::AbstractScrollableWidget
, public WebViewHooks
, public PageClient {
C_OBJECT(InProcessWebView);
@@ -67,7 +67,7 @@ private:
// ^Web::PageClient
virtual bool is_multi_process() const override { return false; }
- virtual Gfx::Palette palette() const override { return GUI::ScrollableWidget::palette(); }
+ virtual Gfx::Palette palette() const override { return GUI::AbstractScrollableWidget::palette(); }
virtual Gfx::IntRect screen_rect() const override { return GUI::Desktop::the().rect(); }
virtual void page_did_change_title(const String&) override;
virtual void page_did_set_document_in_main_frame(DOM::Document*) override;
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
index b27e06ad4c..cf97279c91 100644
--- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
@@ -92,7 +92,7 @@ void OutOfProcessWebView::load_empty_document()
void OutOfProcessWebView::paint_event(GUI::PaintEvent& event)
{
- GUI::ScrollableWidget::paint_event(event);
+ GUI::AbstractScrollableWidget::paint_event(event);
// If the available size is empty, we don't have a front or back bitmap to draw.
if (available_size().is_empty())
@@ -113,7 +113,7 @@ void OutOfProcessWebView::paint_event(GUI::PaintEvent& event)
void OutOfProcessWebView::resize_event(GUI::ResizeEvent& event)
{
- GUI::ScrollableWidget::resize_event(event);
+ GUI::AbstractScrollableWidget::resize_event(event);
handle_resize();
}
@@ -185,7 +185,7 @@ void OutOfProcessWebView::mousewheel_event(GUI::MouseEvent& event)
void OutOfProcessWebView::theme_change_event(GUI::ThemeChangeEvent& event)
{
- GUI::ScrollableWidget::theme_change_event(event);
+ GUI::AbstractScrollableWidget::theme_change_event(event);
client().post_message(Messages::WebContentServer::UpdateSystemTheme(Gfx::current_system_theme_buffer()));
request_repaint();
}
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.h b/Userland/Libraries/LibWeb/OutOfProcessWebView.h
index 91f6f9313a..8338291a1e 100644
--- a/Userland/Libraries/LibWeb/OutOfProcessWebView.h
+++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.h
@@ -7,7 +7,7 @@
#pragma once
#include <AK/URL.h>
-#include <LibGUI/ScrollableWidget.h>
+#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGUI/Widget.h>
#include <LibWeb/WebViewHooks.h>
@@ -16,7 +16,7 @@ namespace Web {
class WebContentClient;
class OutOfProcessWebView final
- : public GUI::ScrollableWidget
+ : public GUI::AbstractScrollableWidget
, public Web::WebViewHooks {
C_OBJECT(OutOfProcessWebView);
@@ -76,7 +76,7 @@ private:
virtual void theme_change_event(GUI::ThemeChangeEvent&) override;
virtual void screen_rect_change_event(GUI::ScreenRectChangeEvent&) override;
- // ^ScrollableWidget
+ // ^AbstractScrollableWidget
virtual void did_scroll() override;
void request_repaint();