From: Brendan Hansen Date: Thu, 7 Oct 2021 18:49:53 +0000 (-0500) Subject: conflicts incoming... X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=c791ca868ffbacf2a7dc5fbc408443b4e8353974;p=onyx-wasm-analyzer.git conflicts incoming... --- diff --git a/src/app/editor.onyx b/src/app/editor.onyx index 5f6985d..5e40115 100644 --- a/src/app/editor.onyx +++ b/src/app/editor.onyx @@ -177,3 +177,8 @@ modify_window_draw :: (obj: any, win: ^app.Application_Window, site := #callsite } } +#private_file gfx :: package immediate_mode +#tag gfx.Color4.r, Slider_Float.{ 0, 1 } +#tag gfx.Color4.g, Slider_Float.{ 0, 1 } +#tag gfx.Color4.b, Slider_Float.{ 0, 1 } +#tag gfx.Color4.a, Slider_Float.{ 0, 1 } diff --git a/src/app/settings.onyx b/src/app/settings.onyx index 15bdd3d..4a482c0 100644 --- a/src/app/settings.onyx +++ b/src/app/settings.onyx @@ -14,8 +14,8 @@ package app } Application_Settings :: struct { - #tag(editor.Ignore_Option.{ "Undefined" }) - #tag(editor.Rename.{ "Color scheme" }) + [editor.Ignore_Option.{ "Undefined" }] + [editor.Rename.{ "Color scheme" }] colorscheme := Colorscheme.Undefined; } diff --git a/src/features/hex_editor/feature.onyx b/src/features/hex_editor/feature.onyx index ea974e6..9aa158f 100644 --- a/src/features/hex_editor/feature.onyx +++ b/src/features/hex_editor/feature.onyx @@ -4,7 +4,7 @@ package feature.hex_viewer use package feature { Feature } -_ :: struct #tag(Feature.{ "Hex Viewer" }) { +_ :: struct [Feature.{ "Hex Viewer" }] { setup := setup; } diff --git a/src/features/hex_editor/hex_viewer.onyx b/src/features/hex_editor/hex_viewer.onyx index fe2f4c6..2931707 100644 --- a/src/features/hex_editor/hex_viewer.onyx +++ b/src/features/hex_editor/hex_viewer.onyx @@ -16,10 +16,10 @@ window_name :: "Hex Viewer" Hex_Viewer_State :: struct { scrollable_region := ui.Scrollable_Region_State.{}; - #tag(editor.Slider_Int.{ -1, 40 }) + [editor.Slider_Int.{ -1, 40 }] highlighted_line := -1; - #tag(editor.Slider_Int.{ -1, 16 }) + [editor.Slider_Int.{ -1, 16 }] highlighted_column := -1; } diff --git a/src/features/text_editor/feature.onyx b/src/features/text_editor/feature.onyx index a5ea200..ec9e158 100644 --- a/src/features/text_editor/feature.onyx +++ b/src/features/text_editor/feature.onyx @@ -4,6 +4,6 @@ package feature.text_editor use package feature { Feature } -_ :: struct #tag(Feature.{ "Text Editor" }) { +_ :: struct [Feature.{ "Text Editor" }] { setup := setup; } diff --git a/src/features/wasm/feature.onyx b/src/features/wasm/feature.onyx index 3c3cf36..af6986c 100644 --- a/src/features/wasm/feature.onyx +++ b/src/features/wasm/feature.onyx @@ -4,7 +4,7 @@ package feature.wasm use package feature { Feature } -_ :: struct #tag(Feature.{ "WASM" }) { +_ :: struct [Feature.{ "WASM" }] { setup := setup; file_loaded := file_loaded; } diff --git a/src/ui/window.onyx b/src/ui/window.onyx index b114baf..39d028b 100644 --- a/src/ui/window.onyx +++ b/src/ui/window.onyx @@ -14,12 +14,12 @@ Window_State :: struct { title := "(undefined)"; - #tag(editor.Slider_Float.{ 0, 64 }) + [editor.Slider_Float.{ 0, 64 }] border_width := 10.0f; border_color := gfx.Color4.{ 1, 0, 0 }; background_color := gfx.Color4.{ 0.2, 0.2, 0.2 }; - #tag(editor.Slider_Float.{ 0, 64 }) + [editor.Slider_Float.{ 0, 64 }] bar_height := 28.0f; draggable := true; @@ -29,6 +29,9 @@ Window_State :: struct { dragging := false; resizing := false; + [editor.Slider_Float.{ 0, 24 }] + shadow := 10.0f; + get_rectangle :: (use w: ^Window_State) -> Rectangle { bw := border_width; if dragging do bw *= 5; @@ -148,6 +151,28 @@ window_start :: (use state: ^Window_State, site := #callsite, increment := 0) -> state.should_close = true; } + if shadow > 0 { + // Draw a drop shadow + + gfx.vertex(.{ x - border_width, y + h + border_width }, .{ 0, 0, 0, 0.7 }); + gfx.vertex(.{ x + w + border_width, y + h + border_width }, .{ 0, 0, 0, 0.35 }); + gfx.vertex(.{ x + w + border_width + shadow, y + h + border_width + shadow }, .{ 0, 0, 0, 0 }); + + gfx.vertex(.{ x - border_width, y + h + border_width }, .{ 0, 0, 0, 0.7 }); + gfx.vertex(.{ x + w + border_width + shadow, y + h + border_width + shadow }, .{ 0, 0, 0, 0 }); + gfx.vertex(.{ x - border_width + shadow, y + h + border_width + shadow }, .{ 0, 0, 0, 0 }); + + gfx.vertex(.{ x + w + border_width, y - bar_height - border_width }, .{ 0, 0, 0, 0.7 }); + gfx.vertex(.{ x + w + border_width + shadow, y + h + border_width + shadow }, .{ 0, 0, 0, 0 }); + gfx.vertex(.{ x + w + border_width, y + h + border_width }, .{ 0, 0, 0, 0.35 }); + + gfx.vertex(.{ x + w + border_width, y - bar_height - border_width }, .{ 0, 0, 0, 0.7 }); + gfx.vertex(.{ x + w + border_width + shadow, y - bar_height + shadow }, .{ 0, 0, 0, 0 }); + gfx.vertex(.{ x + w + border_width + shadow, y + h + border_width + shadow }, .{ 0, 0, 0, 0 }); + + gfx.flush(); + } + gfx.push_matrix(); gfx.push_scissor(x, y, w, h); gfx.apply_transform(.{ translation = .{ x, y }, scale = .{ 1, 1 } });