diff --git a/Readme.md b/Readme.md index 0298556..03957c8 100644 --- a/Readme.md +++ b/Readme.md @@ -1,9 +1,5 @@ # Sectr Prototype -![img](docs/assets/sectr_host_2024-03-09_04-30-27.png) - - - This prototype aims to flesh out ideas I've wanted to explore futher when it came to code editing and tools for code in general. The things to explore: @@ -44,3 +40,9 @@ Even so the notatble groups are: * Auto-layout with heavy procedural generation of box widgets There is some unused code in `code/__imgui_raddbg`. Its a partial translation of some data structures from raddbg's ui. + +## Gallery + +![img](docs/assets/sectr_host_2024-03-09_04-30-27.png) +![img](docs/assets/sectr_host_2024-05-04_12-29-39.png) +![img](docs/assets/Code_2024-05-04_12-55-53.png) diff --git a/code/api.odin b/code/api.odin index b68461c..8cdd541 100644 --- a/code/api.odin +++ b/code/api.odin @@ -153,7 +153,7 @@ startup :: proc( prof : ^SpallProfiler, persistent_mem, frame_mem, transient_mem rl.SetConfigFlags( { rl.ConfigFlag.WINDOW_RESIZABLE, - // rl.ConfigFlag.WINDOW_TOPMOST, + rl.ConfigFlag.WINDOW_TOPMOST, }) window_width : i32 = cast(i32) config.resolution_width diff --git a/code/colors.odin b/code/colors.odin index ba1a5af..7df434b 100644 --- a/code/colors.odin +++ b/code/colors.odin @@ -15,7 +15,7 @@ Color_BG_TextBox_Green :: Color { 102, 102, 110, 255 } Color_Frame_Disabled :: Color { 22, 22, 22, 120 } Color_Frame_Hover :: Color { 122, 122, 125, 200 } Color_Frame_Select :: Color { 188, 188, 188, 220 } -Color_GreyRed :: Color { 220, 100, 100, 165 } +Color_GreyRed :: Color { 220, 100, 100, 50 } Color_White_A125 :: Color { 255, 255, 255, 165 } Color_Black :: Color { 0, 0, 0, 255 } diff --git a/code/tick_update.odin b/code/tick_update.odin index 2b7292e..42271e3 100644 --- a/code/tick_update.odin +++ b/code/tick_update.odin @@ -244,12 +244,11 @@ update :: proc( delta_time : f64 ) -> b32 { // frame := ui_widget( "Frame", {} ) // ui_parent(frame) - parent_layout := default_layout parent_layout.size = range2( { 300, 300 }, {} ) parent_layout.alignment = { 0.5, 0.5 } parent_layout.margins = { 100, 100, 100, 100 } - parent_layout.padding = {} + parent_layout.padding = { 5, 10, 5, 5 } parent_layout.pos = { 0, 0 } parent_theme := frame_style_default @@ -267,11 +266,9 @@ update :: proc( delta_time : f64 ) -> b32 debug.draggable_box_pos = parent.style.layout.pos debug.draggable_box_size = parent.style.layout.size.min } - if parent.dragging { debug.draggable_box_pos += mouse_world_delta() } - if parent.resizing { og_layout := ui_context.active_start_style.layout @@ -286,7 +283,6 @@ update :: proc( delta_time : f64 ) -> b32 if (ui.hot == parent.key) && (ui.hot_resizable || ui.active_start_signal.resizing) { parent.style.bg_color = Color_Blue } - parent.style.layout.pos = debug.draggable_box_pos parent.style.layout.size.min = debug.draggable_box_size } @@ -295,18 +291,19 @@ update :: proc( delta_time : f64 ) -> b32 child_layout.size = range2({ 0, 0 }, { 0, 0 }) child_layout.alignment = { 0.5, 0.5 } child_layout.margins = { 20, 20, 20, 20 } - child_layout.padding = {} - child_layout.anchor = range2({ 0.0, 0.0 }, { 0.0, 0.0 }) + child_layout.padding = { 5, 5, 5, 5 } + child_layout.anchor = range2({ 0.2, 0.1 }, { 0.1, 0.15 }) child_layout.pos = { 0, 0 } child_theme := frame_style_default child_theme.bg_color = Color_GreyRed child_theme.flags = { // .Fixed_Width, .Fixed_Height, + .Origin_At_Anchor_Center } child_theme.layout = child_layout ui_theme_via_style(child_theme) - child := ui_widget( "Child", { .Mouse_Clickable }) + child := ui_widget( "Child", { .Mouse_Clickable }) } // Whitespace AST test diff --git a/docs/assets/Code_2024-05-04_12-55-53.png b/docs/assets/Code_2024-05-04_12-55-53.png new file mode 100644 index 0000000..3c3936b Binary files /dev/null and b/docs/assets/Code_2024-05-04_12-55-53.png differ diff --git a/docs/assets/raddbg_2024-05-04_12-05-47.mp4 b/docs/assets/raddbg_2024-05-04_12-05-47.mp4 deleted file mode 100644 index 1fbdfc2..0000000 Binary files a/docs/assets/raddbg_2024-05-04_12-05-47.mp4 and /dev/null differ diff --git a/docs/assets/sectr_host_2024-05-04_12-29-39.png b/docs/assets/sectr_host_2024-05-04_12-29-39.png new file mode 100644 index 0000000..f1e1f88 Binary files /dev/null and b/docs/assets/sectr_host_2024-05-04_12-29-39.png differ