added editor.Hide
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 8 Oct 2021 17:42:34 +0000 (12:42 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 8 Oct 2021 17:42:34 +0000 (12:42 -0500)
src/app/app.onyx
src/app/editor.onyx
src/ui/window.onyx

index 01e9740c8552d8209612edb96edc014cf1335f5d..eb4640c92adde324967522d79fb3007d9c7be4a1 100644 (file)
@@ -435,7 +435,7 @@ invoke_feature_function :: macro (name: str, Hook_Type := #type () -> void, call
             if type.kind != .Struct do continue;
 
             feature := cast(^Type_Info_Struct) type;
-            
+
             for ^tag: feature.tags {
                 if tag.type == Feature {
                     debug_log(.Debug, "Found feature: {}", (cast(^Feature) tag.data).name);
index b7533c54379842554abc88caac87c7d3c083218c..1d86b61858023059e5d0ddb8a4e9c4d83502335b 100644 (file)
@@ -7,6 +7,7 @@ package editor
     use package core
 }
 
+Hide          :: struct {}
 Rename        :: struct { name: str; }
 Slider_Int    :: struct { min, max: i32; }
 Slider_Float  :: struct { min, max: f32; }
@@ -68,6 +69,12 @@ editor_window_draw :: (obj: any, win: ^app.Application_Window, site := #callsite
 
         for ^member: settings_type.members {
             __counter += 1;
+
+            if array.some(member.tags, (x) => {
+                if x.type != type_expr do return false;
+                return *cast(^type_expr) x.data == Hide;
+            }) do continue;
+
             member_type := get_type_info(member.type);
 
             row_rect, *rect = ui.Flow.split_horizontal(*rect, top_height=48);
index 39d028badbb735fae78e777c759de3dea2625a2c..2b99ea9cf34c6f81c50d77c03e42ed6dda13a515 100644 (file)
@@ -26,8 +26,8 @@ Window_State :: struct {
     resizable := true;
 
     should_close := false;
-    dragging     := false;
-    resizing     := false;
+    [editor.Hide] dragging := false;
+    [editor.Hide] resizing := false;
 
     [editor.Slider_Float.{ 0, 24 }]
     shadow       := 10.0f;