diff infinite_canvas/dev_ui.c @ 278:8d560f50ed4c

Improve infinite canvas interactions and browser chrome Render Lucide icons directly with Raylib, add searchable icon browsing, robust text editing, entity lifecycle animations, z-order-safe input, semantic themes, and animated editable browser controls. Document rendering, pinning, context, and component extension for future agents. Co-authored-by: Copilot <[email protected]> Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:16:14 -0700
parents b55c22cff335
children 49e9e591c9bb
line wrap: on
line diff
--- a/infinite_canvas/dev_ui.c	Mon Aug 17 17:01:40 2026 -0700
+++ b/infinite_canvas/dev_ui.c	Mon Aug 17 22:16:14 2026 -0700
@@ -5,7 +5,7 @@
 #define RAYGUI_IMPLEMENTATION
 #include "third_party/raylib/include/raygui.h"
 
-static const Rectangle DEV_PANEL = {18.0f, 18.0f, 264.0f, 436.0f};
+static const Rectangle DEV_PANEL = {18.0f, 18.0f, 264.0f, 478.0f};
 
 static Rectangle Canvas_Dev_UI_Context_Bounds(void)
 {
@@ -114,7 +114,7 @@
         (Vector2){panel.x + 20.0f, panel.y + 48.0f},
         13.0f,
         0.0f,
-        p_snapshot->truncated ? (Color){220, 38, 38, 255} : p_theme->text_muted);
+        p_snapshot->truncated ? p_theme->danger : p_theme->text_muted);
 
     Rectangle close = {
         panel.x + panel.width - 76.0f,
@@ -214,6 +214,10 @@
 
 boolean Canvas_Dev_UI_Contains_Pointer(const Canvas_Dev_UI *p_ui)
 {
+    // The expanded dropdown is modal: it draws outside DEV_PANEL and also
+    // consumes outside clicks to close itself.
+    if (p_ui->dropdown_open) return TRUE;
+
     Vector2 pointer = GetMousePosition();
     if (CheckCollisionPointRec(pointer, DEV_PANEL)) return TRUE;
     if (p_ui->context_open &&
@@ -253,6 +257,8 @@
         0.1f,
         p_theme->text_muted);
 
+    if (p_ui->dropdown_open) GuiLock();
+
     if (GuiButtonRounded((Rectangle){34.0f, 126.0f, 112.0f, 34.0f}, "Add entity", 0.32f, 10)) {
         Canvas_Scene_Add(
             p_scene,
@@ -260,7 +266,7 @@
             p_camera->target);
     }
     if (GuiButtonRounded((Rectangle){154.0f, 126.0f, 112.0f, 34.0f}, "Clear", 0.32f, 10)) {
-        Canvas_Scene_Clear(p_scene);
+        Canvas_Scene_Fade_Out_All(p_scene);
     }
     if (GuiButtonRounded((Rectangle){34.0f, 168.0f, 72.0f, 34.0f}, "Demo", 0.32f, 10)) {
         Canvas_Scene_Add_Demo(p_scene);
@@ -308,19 +314,27 @@
         p_ui->context_scroll = 0.0f;
     }
 
-    DrawTextEx(font, TextFormat("%d FPS", GetFPS()), (Vector2){34.0f, 354.0f}, 12.0f, 0.0f, p_theme->text_muted);
-    DrawTextEx(font, TextFormat("%.2fx zoom", p_camera->zoom), (Vector2){104.0f, 354.0f}, 12.0f, 0.0f, p_theme->text_muted);
+    if (GuiButtonRounded(
+            (Rectangle){34.0f, 336.0f, 232.0f, 34.0f},
+            "Lucide icon gallery",
+            0.32f,
+            10)) {
+        Canvas_Scene_Show_Lucide_Gallery(p_scene, p_camera);
+    }
+
+    DrawTextEx(font, TextFormat("%d FPS", GetFPS()), (Vector2){34.0f, 396.0f}, 12.0f, 0.0f, p_theme->text_muted);
+    DrawTextEx(font, TextFormat("%.2fx zoom", p_camera->zoom), (Vector2){104.0f, 396.0f}, 12.0f, 0.0f, p_theme->text_muted);
     DrawTextEx(
         font,
         TextFormat("%d objects", (int)Dowa_Array_Length(p_scene->p_entities)),
-        (Vector2){196.0f, 354.0f},
+        (Vector2){196.0f, 396.0f},
         12.0f,
         0.0f,
         p_theme->text_muted);
     DrawTextEx(
         font,
         "Drag objects directly on the canvas",
-        (Vector2){34.0f, 400.0f},
+        (Vector2){34.0f, 442.0f},
         12.0f,
         0.0f,
         p_theme->text_muted);
@@ -334,6 +348,7 @@
     }
 
     // Draw last so the expanded list overlays the other developer controls.
+    if (p_ui->dropdown_open) GuiUnlock();
     Rectangle dropdown = {34.0f, 84.0f, 232.0f, 34.0f};
     if (GuiDropdownBoxRounded(
             dropdown,