feat: first take at UI app

This commit is contained in:
2026-04-24 14:54:04 +02:00
parent 78609377be
commit 1b5a5008eb
24 changed files with 2630 additions and 3 deletions

42
lib/bds/desktop/menu.ex Normal file
View File

@@ -0,0 +1,42 @@
defmodule BDS.Desktop.Menu do
@moduledoc false
use Desktop.Menu
alias Desktop.Window
@impl true
def mount(menu) do
{:ok, menu}
end
@impl true
def render(assigns) do
~H"""
<menu>
<item onclick="open">Open</item>
<hr />
<item onclick="quit">Quit</item>
</menu>
"""
end
@impl true
def handle_event("open", menu) do
Window.show(BDS.Desktop.MainWindow)
{:noreply, menu}
end
def handle_event("quit", menu) do
Window.quit()
{:noreply, menu}
end
def handle_event(_, menu) do
{:noreply, menu}
end
@impl true
def handle_info(_, menu) do
{:noreply, menu}
end
end