From: Brendan Hansen Date: Sun, 10 Oct 2021 18:50:33 +0000 (-0500) Subject: added drop shadow to menubar X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=8cdd1298bc166efab2a71f36150c71b3c9d7bf2d;p=onyx-wasm-analyzer.git added drop shadow to menubar --- diff --git a/src/ui/menubar.onyx b/src/ui/menubar.onyx index c109d2d..8a259b5 100644 --- a/src/ui/menubar.onyx +++ b/src/ui/menubar.onyx @@ -39,4 +39,19 @@ menubar :: (r: Rectangle, @Temporary search_buffer: ^String_Buffer, options: [] _, search_rect := Flow.split_vertical(menu_rect, right_width=300); textbox(search_rect, search_buffer, "Search", theme=^menu_textbox_theme); + + { + x, y := Rectangle.top_left(r); + w, h := Rectangle.dimensions(r); + shadow :: 12.0f + shadow_amm :: 0.4f + + gfx.vertex(.{ x, y + h }, .{ 0, 0, 0, shadow_amm }); + gfx.vertex(.{ x + w, y + h }, .{ 0, 0, 0, shadow_amm }); + gfx.vertex(.{ x + w + shadow, y + h + shadow }, .{ 0, 0, 0, 0 }); + + gfx.vertex(.{ x, y + h }, .{ 0, 0, 0, shadow_amm }); + gfx.vertex(.{ x + w + shadow, y + h }, .{ 0, 0, 0, 0 }); + gfx.vertex(.{ x, y + h + shadow }, .{ 0, 0, 0, 0 }); + } }