mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
LibGUI: Convert GScrollBar to ObjectPtr
This commit is contained in:
parent
4616a13e94
commit
bce58bbbca
7 changed files with 11 additions and 10 deletions
|
@ -7,7 +7,6 @@
|
|||
class GScrollBar final : public GWidget {
|
||||
C_OBJECT(GScrollBar)
|
||||
public:
|
||||
explicit GScrollBar(Orientation, GWidget* parent);
|
||||
virtual ~GScrollBar() override;
|
||||
|
||||
Orientation orientation() const { return m_orientation; }
|
||||
|
@ -39,6 +38,8 @@ public:
|
|||
};
|
||||
|
||||
private:
|
||||
explicit GScrollBar(Orientation, GWidget* parent);
|
||||
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
virtual void mouseup_event(GMouseEvent&) override;
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
GScrollableWidget::GScrollableWidget(GWidget* parent)
|
||||
: GFrame(parent)
|
||||
{
|
||||
m_vertical_scrollbar = new GScrollBar(Orientation::Vertical, this);
|
||||
m_vertical_scrollbar = GScrollBar::construct(Orientation::Vertical, this);
|
||||
m_vertical_scrollbar->set_step(4);
|
||||
m_vertical_scrollbar->on_change = [this](int) {
|
||||
did_scroll();
|
||||
update();
|
||||
};
|
||||
|
||||
m_horizontal_scrollbar = new GScrollBar(Orientation::Horizontal, this);
|
||||
m_horizontal_scrollbar = GScrollBar::construct(Orientation::Horizontal, this);
|
||||
m_horizontal_scrollbar->set_step(4);
|
||||
m_horizontal_scrollbar->set_big_step(30);
|
||||
m_horizontal_scrollbar->on_change = [this](int) {
|
||||
|
|
|
@ -53,8 +53,8 @@ protected:
|
|||
private:
|
||||
void update_scrollbar_ranges();
|
||||
|
||||
GScrollBar* m_vertical_scrollbar { nullptr };
|
||||
GScrollBar* m_horizontal_scrollbar { nullptr };
|
||||
ObjectPtr<GScrollBar> m_vertical_scrollbar;
|
||||
ObjectPtr<GScrollBar> m_horizontal_scrollbar;
|
||||
GWidget* m_corner_widget { nullptr };
|
||||
Size m_content_size;
|
||||
Size m_size_occupied_by_fixed_elements;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue