mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
LibGUI: Add a GStackWidget for many widgets sharing a single location.
Call set_active_widget(GWidget*) to put a new widget on top.
This commit is contained in:
parent
ab92252ee6
commit
497300c492
10 changed files with 157 additions and 5 deletions
21
LibGUI/GStackWidget.h
Normal file
21
LibGUI/GStackWidget.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GWidget.h>
|
||||
|
||||
class GStackWidget : public GWidget {
|
||||
public:
|
||||
explicit GStackWidget(GWidget* parent);
|
||||
virtual ~GStackWidget() override;
|
||||
|
||||
GWidget* active_widget() const { return m_active_widget; }
|
||||
void set_active_widget(GWidget*);
|
||||
|
||||
protected:
|
||||
virtual void child_event(GChildEvent&) override;
|
||||
virtual void resize_event(GResizeEvent&) override;
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "GStackWidget"; }
|
||||
|
||||
GWidget* m_active_widget { nullptr };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue