summaryrefslogtreecommitdiff
path: root/Widgets/Window.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-13 17:52:47 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-13 17:52:47 +0200
commit1929cb6b71452a00325f8098e5d998462a742a9f (patch)
treea82b3db98863958054d828a1b10c61a1504a0c24 /Widgets/Window.h
parent44a32039be5d6b5ff1f6b5eed75300723edb06a9 (diff)
downloadserenity-1929cb6b71452a00325f8098e5d998462a742a9f.zip
Implement basic focus.
Diffstat (limited to 'Widgets/Window.h')
-rw-r--r--Widgets/Window.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Widgets/Window.h b/Widgets/Window.h
index bfb49b36fb..eb94390b92 100644
--- a/Widgets/Window.h
+++ b/Widgets/Window.h
@@ -1,8 +1,9 @@
#pragma once
-#include <AK/String.h>
#include "Object.h"
#include "Rect.h"
+#include <AK/String.h>
+#include <AK/WeakPtr.h>
class Widget;
@@ -39,10 +40,15 @@ public:
bool isActive() const;
+ Widget* focusedWidget() { return m_focusedWidget.ptr(); }
+ void setFocusedWidget(Widget*);
+
private:
String m_title;
Rect m_rect;
Widget* m_mainWidget { nullptr };
bool m_isBeingDragged { false };
+
+ WeakPtr<Widget> m_focusedWidget;
};