Commit Graph
35 Commits
Author SHA1 Message Date
waozi 8c5ded5844 Fix material tab bar spacing 2026-08-19 18:48:24 -03:00
waozi 397cd3749c Avoid duplicate badge measurement 2026-08-19 16:04:50 -03:00
waozi 85779958ab Add themed Go surface widgets 2026-08-19 15:46:01 -03:00
waozi 4ad9d1cbdb kry_update: arch-aware AppImage appcast key
AppImages are per-arch, so the download key is now appimage-amd64 /
appimage-arm64 (windows stays bare — the zip bundles every arch exe).
Publishers with a single arch can keep one artifact; multi-arch
publishers list one channel per arch and each machine resolves its
own. Tests and the Go binding updated; nothing has shipped under the
old key yet.
2026-08-19 14:15:24 -03:00
waozi 8b332ab17f kryui: Go bindings for kry_update_flow
StartUpdateFlow/Poll/State/Download/Apply/ExecPending wrap the C
lifecycle for the Go apps (gopass GUI first); ShowToast already covers
the notification side. Links the vendored curl like the rest of the
package's static stack. The binding test drives a file:// appcast
through available -> download -> ready -> apply, including the real
staging rename under a fake $APPIMAGE.
2026-08-19 14:10:40 -03:00
waozi 4a865f45fd theme: default to the system theme source on every platform
GetDefaultPlatformThemeSource() no longer falls back to THEME_SOURCE_APP on Android; GetCurrentThemeColor() already falls back to the app palette when no system palette is readable, so SYSTEM is safe everywhere. Also expose SetThemeSource/SetThemeMode (plus ThemeSource/ThemeMode consts) in the go/kryui bindings and the Runtime parity interface.
2026-08-19 12:09:07 -03:00
waozi dc86744139 k2g: reach Go parity on the Runtime surface
The Runtime interface now covers every widget family go/kryui itself
exposes, not just the .kry whitelist: the positional controls
(GenericButton, TextButton, LocaleDropdown, VerticalSlider, CanvasGrid,
SelectableText, ShowUIToast(For)), the Props widgets (TextInputControl,
ReadonlyTextBox, TextArea, Radio, Spinbox, Combobox, LabelFrame,
Notebook, PanedView, Collapsible, ListBox, SourceView, TableView), the
dialogs, the canvas (BeginUICanvas/EndUICanvas), the Tk layout helpers
(BeginUIFrameBox, UIFramePack, UIGridCell, UIPlace), and theme control
(SetCurrentTheme/SetThemeDarkMode/SetThemeStyle with THEME_STYLE_*
constants under their C names).

k2g lowers .kry array declarations to Go slices at the use site
(state and local 'name: [N] const char*' references emit 'name[:]'),
accepts UICanvas literals like Props/Spec, and maps the canvas/Tk
handle types. The syntax gate now exercises the whole parity set and
still compiles the output against the real cgo runtime.

Honest remainder, noted in the matrix: DropdownEx's rich option
arrays, forward-goto-over-declarations, and C pointer/Texture2D
values stay outside what .kry can express.
2026-08-18 17:06:20 -03:00
waozi 78e9c369ca docs: k2c column, bare widget names, and a permanent HTML renderer
The widget matrix gains an explicit k2c column (always equal to C —
.kry reaches the whole API through plain call statements; the note was
prose-only before) and drops every DrawUI*-prefixed spelling in favor
of the bare widget names.

go/kryui now aliases the remaining prefixed calls (TextInputControl,
GenericButton, TextButton, ReadonlyTextBox, Dropdown(DropdownEx,
LocaleDropdown), VerticalSlider, Checkbox, ToggleSwitch, Hyperlink,
IconBtn) so the bare surface is complete; the C-mirroring spellings
stay as the definitions for existing callers.

scripts/feature-matrix-html.py renders the browsable color-coded view
(regenerate after every matrix change); the current HTML is committed
alongside.
2026-08-18 16:55:59 -03:00
waozi f2a48285c9 k2g: lower typed declarations, arrays, and goto/labels for real
Declarations no longer degrade to 'any': the declared type is split
from the initializer before translation, go_type skips leading
whitespace and normalizes 'char *' to 'char*', and array types
('[N] const char*', '[N] int') map to Go arrays. Composite-literal
initializers take the Go form 'var x = [N]T{...}'. goto and label
statements emit verbatim — 'name:' and 'goto name' are valid Go, and
a forward jump over declarations stays a loud compile error rather
than a silent TODO.

The shared frontend now classifies a bare 'name:' as KIR_STMT_LABEL
(previously the kind existed but was never produced; labels only
worked through the raw-text path).

Generated code may pass the C-shaped option list to Dropdown/TextLines
— a ';'-joined string, a []string, or a [N]string array — so array
declarations feed widgets directly; Dropdown also tolerates the C
option-count argument, which the Go side derives itself.
2026-08-18 16:27:02 -03:00
waozi 8c8bbb0dfa theme: add the Aero widget style
Add THEME_STYLE_AERO after MATERIAL so existing app clamps treat it as
invalid (SYSTEM fallback) until they opt in. The style renders Windows
Vista/7 glass from plain primitives only - translucent fills, gloss
highlights, hover glow, layered shadows, inset fields, gradient tracks -
so every backend (raylib, Android, web, software, null) draws the same
picture.

- UIStyleTokens preset: 4px/8px radii, translucent control/panel alpha,
  gloss shine, soft shadow offset
- New src/ui/ui_aero.c: UIAeroScheme derived from the active palette
  (GetUIAeroScheme) plus paint helpers for controls, glass panels,
  inset fields and gradient tracks
- ui_draw_control_background/ui_draw_box_background route Aero through
  the new helpers, so shared-path widgets pick glass up for free
- New THEME_AERO palette (13th, the style default) with sky-glass light
  and slate-blue dark scopes + themes/aero*.ini mirrors
- Theme settings picker offers the style; locale gains theme_aero
- Go binding ThemeStyleAero
2026-08-18 16:10:15 -03:00
waozi ecaa07b4f6 k2g: cover the full widget whitelist on the Go Runtime interface
Grow go/kryui so every whitelisted .kry widget statement lowers and
compiles through k2g: new Props/Spec types (PictureProps,
UIParagraphSpec, BottomNav/TopNav/Toolbar), cgo wrappers (TextInRect,
Paragraph, TextLines, Bevel, IconTexture by icon type, Picture, Toggle,
Modal, TitleBar, nav bars), the raylib color palette and picture-fit
constants under their C names, and the matching Runtime methods
(including Row/Stack, Key, Fade, theme getters, optional-border Rect).

k2g lowers positional Props/Spec literals through a C field-order table,
maps Id to ID, converts int-typed bool Props fields, and resolves the
color/fit constants. The syntax gate now exercises every widget and
still compiles the generated Go against the real cgo runtime.
2026-08-18 16:10:15 -03:00
waozi 62eff75d38 tray+notify: SetDesktopTrayIcon emblem swap, action-capable notifications
- SetDesktopTrayIcon(path) swaps the tray icon at runtime (empty restores
  the icon InitDesktopTray resolved): the emblem/attention state apps show
  while unseen notifications wait. gtk_dl gains gtk_status_icon_set_from_file.
- SendNotificationAction + PollNotificationAction extend the notification
  API with one action button per popup on the GDBus backend: Notify's
  daemon id is kept with the caller's URL, an ActionInvoked subscription
  resolves the click, and Poll hands (action, url) to the app's main loop
  while pumping the dispatch context so it also works without one. Other
  backends degrade to the plain send.
- go/kryui: bindings (SetNotificationAppName, NotificationSupported,
  SendNotificationAction, PollNotificationAction, SetDesktopTrayIcon).
2026-08-18 12:46:52 -03:00
waozi 15020a797b runtime: enforce one app instance by default 2026-08-17 21:46:45 -03:00
waozi 6f9d8d712b kryui: window flags and min size on the k2g AppConfig
Apps generated by k2g could not set FLAG_WINDOW_RESIZABLE or a minimum
window size: InitWindow ran before the host had any hook. AppConfig
grows Flags (applied before InitWindow) and MinWidth/MinHeight (applied
right after), mirroring what embedding apps pass on the raw compat API.
2026-08-17 21:38:36 -03:00
waozi 66fb62de40 ui: keep font atlases immutable while typing 2026-08-17 21:35:43 -03:00
waozi 537912b0a6 k2g: host bridge, enums, switch and full for headers
k2g now compiles real declarative apps, not just the smoke subset:

- '#extern "pkg.Fn"' lowers to a generated <Guard>Host interface with a
  Set<Guard>Host setter; extern calls become host.Method(...) with numeric
  argument conversions so int/long/float widening always compiles. The Kir
  frontend keeps the quoted host symbol on KirFunction.extern_target.
- 'Name :: enum' lowers to untyped Go constants with C counter semantics
  (explicit literal resets the counter; explicit expressions chain +1), and
  bare member names rewrite to the qualified Go constant at every use site.
- switch bodies translate: case/default labels, including brace-open forms
  and same-line bodies; Go auto-break replaces C fallthrough by design.
- C-style three-clause for headers ('for int i = 0; i < n; i++') become
  Go for headers with typed initializers; Go-style headers pass through.
- 'guard cond' lowers to a plain if (the body is the exit path).
- Assignments lower as statements; '} else {' chains emit on one line.
- Extended C-to-Go type map (short/size_t/long long/unsigned variants,
  char** slices, [N]T arrays, T* pointers, const stripping) removes the
  any-fallback for real signatures.
- Output is flat: nested source trees no longer nest Go files into
  separate packages; duplicate basenames are rejected.

go/kryui grows the widget surface declarative apps need: TabBar (real
DrawUITabBar cgo wrapper with plain string labels), Rect, RectGradientH,
Line, Progress, Checkbox, Dropdown and screen-size getters on the k2g
Runtime interface, plus DropdownLabels for ';' option lists.

tests/k2g_syntax_test.sh now covers the whole subset and keeps the
compile-against-the-real-runtime gate; the full suite passes.
2026-08-17 21:34:07 -03:00
waozi bc0a3999d0 ui: enforce cross-lowering text input latency 2026-08-17 20:26:30 -03:00
waozi 944aeea5f8 go: expose retained declarative UI 2026-08-17 19:00:18 -03:00
waozi 8b9bb98fa7 ui: make text rendering event efficient 2026-08-17 17:52:55 -03:00
waozi 525e7aa1cb ui: add fixed-subset font sources 2026-08-17 17:35:16 -03:00
waozi 67d9dcfac7 go: add reusable grid cell editor 2026-08-17 12:52:43 -03:00
waozi 99bd4a01a9 ui: finalize deferred overlays at frame end 2026-08-17 12:20:36 -03:00
waozi 7dc8315f99 go: support arm64 native linking 2026-08-17 12:16:12 -03:00
waozi dbff6b764f ui: persist line selection and expose pictures 2026-08-17 12:07:53 -03:00
waozi bee43bffab go: expose theme style selection 2026-08-17 12:00:19 -03:00
waozi cce6e637ee ui: add scroll-safe multiline text selection 2026-08-17 11:54:01 -03:00
waozi b407fdfe16 go: add secure password fields 2026-08-17 11:40:36 -03:00
waozi d845213e8b go: expose text area focus state 2026-08-17 11:12:44 -03:00
waozi dfea82942f go: expose tab key compatibility constant 2026-08-17 11:05:55 -03:00
waozi e6c21aaa70 go: complete raylib drawing compatibility helpers 2026-08-17 11:03:32 -03:00
waozi ceb5090614 go: expose toolkit collection and dialog widgets 2026-08-17 11:02:52 -03:00
waozi 67b07202b4 go: expose window focus activation 2026-08-17 10:24:02 -03:00
waozi 93abb65661 go: pin text editor state across cgo calls 2026-08-17 10:22:23 -03:00
waozi 0a1dab897b go: add native runtime and stateful controls 2026-08-17 08:58:58 -03:00
waozi 7877a4d2ed go: own the kryui runtime bindings 2026-08-17 08:37:10 -03:00