From fe39cc897fbc8d8470d790df5306550c841d95d4 Mon Sep 17 00:00:00 2001 From: nathan Date: Sun, 16 Nov 2025 21:19:01 -0700 Subject: Window focus stuff --- src/ui.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ui.h') 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); -- cgit v1.2.3