aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.h
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-11-17 04:19:01 +0000
committernathan <nathansmith@disroot.org>2025-11-17 04:19:01 +0000
commitfe39cc897fbc8d8470d790df5306550c841d95d4 (patch)
tree97243f3c23a471000163fc9e157bb145f5d92536 /src/ui.h
parent7bb57d60f8d8249eb48c9c7a7e7d3760127a0c3c (diff)
downloadFindThings-fe39cc897fbc8d8470d790df5306550c841d95d4.tar.gz
FindThings-fe39cc897fbc8d8470d790df5306550c841d95d4.tar.bz2
FindThings-fe39cc897fbc8d8470d790df5306550c841d95d4.zip
Window focus stuff
Diffstat (limited to 'src/ui.h')
-rw-r--r--src/ui.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ui.h b/src/ui.h
index e3e5918..76d9b1f 100644
--- a/src/ui.h
+++ b/src/ui.h
@@ -16,6 +16,12 @@
typedef void (*DrawWindowContentCallback)(Vector2 position, Vector2 scroll);
+typedef enum {
+ NO_FOCUS_ACTION,
+ REQUEST_FOCUS,
+ DEMAND_FOCUS
+} FocusCommand;
+
typedef struct {
char title[UI_WINDOW_TITLE_MAX];
Rectangle rect;
@@ -25,6 +31,7 @@ typedef struct {
DrawWindowContentCallback callback;
Vector2 contentSize;
Vector2 scroll;
+ bool hasFocus;
} FloatingWindow;
typedef struct {
@@ -33,7 +40,7 @@ typedef struct {
} WindowManager;
FloatingWindow createFloatingWindow(const char* title, Rectangle rect);
-bool updateFloatingWindow(FloatingWindow* window);
+FocusCommand updateFloatingWindow(FloatingWindow* window);
void initWindowManager(WindowManager* wm);
void updateWindowManager(WindowManager* wm);