1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +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:
Andreas Kling 2019-03-15 16:12:06 +01:00
parent ab92252ee6
commit 497300c492
10 changed files with 157 additions and 5 deletions

View file

@ -4,8 +4,11 @@
#include <SharedGraphics/Rect.h>
#include <AK/AKString.h>
#include <AK/Types.h>
#include <AK/WeakPtr.h>
#include <Kernel/KeyCode.h>
class GObject;
class GEvent {
public:
enum Type {
@ -31,6 +34,8 @@ public:
FocusIn,
FocusOut,
WindowCloseRequest,
ChildAdded,
ChildRemoved,
};
GEvent() { }
@ -170,3 +175,15 @@ public:
private:
int m_timer_id;
};
class GChildEvent final : public GEvent {
public:
GChildEvent(Type, GObject& child);
~GChildEvent();
GObject* child() { return m_child.ptr(); }
const GObject* child() const { return m_child.ptr(); }
private:
WeakPtr<GObject> m_child;
};