3859 Commits
Author SHA1 Message Date
Liu de31a3bc74 feat(widgets): restyle scrollbar with a slim rounded thumb 2026-10-17 21:16:49 +08:00
Liu ee08bcf9f9 feat(fonts): load system UI/CJK fonts and register generic family aliases
Windows: also load the Segoe UI faces and Noto Sans SC (variable).

fontconfig/plain-Linux: register sans-serif/serif/monospace aliases, and guard pd_font_find_path() NULL before load.
2026-10-17 21:16:48 +08:00
Liu 218f900a58 feat(pandagl): support variable fonts and fix font fallback
Expand variable fonts into static weight instances via the wght axis so font-weight resolves to a real face.

Add pd_font_get_glyph_index and skip faces lacking a glyph during family fallback, so a missing glyph keeps falling back instead of stopping at a cached .notdef.

Fix an off-by-one in find_bolder_weight/find_lighter_weight (must index weights[weight-1]), which dereferenced NULL and crashed on sparse-weight families.

Cover these with variable-font, CJK-fallback and weight-fallback tests.
2026-10-17 21:16:48 +08:00
Liu 708611a727 feat(ui-server): sync system cursor with hovered widget style
Expose ui_get_mouseover() and, at the end of ui_server_update(), resolve
the first non-auto cursor up the hover ancestor chain (emulating CSS
inheritance), then apply it to the owning window. Runs after style
recomputation so :hover and dynamic changes take effect in the same
frame; resets to auto when the hovered widget is destroyed.
2026-10-17 21:16:47 +08:00
Liu 237a5b66f2 feat(ptk): add per-window cursor api for win32, x11 and fb
Add ptk_window_set/get_cursor() and a driver vtable. Win32 keeps the
cursor via WM_SETCURSOR (NONE hides it), X11 defines a cached cursor-font
shape (NONE uses a transparent pixmap), framebuffer records only. Values
map to the closest system cursor where no exact match exists.
2026-10-17 21:16:46 +08:00
Liu 844802374d feat(css): support cursor property with standard keyword values
Register the `cursor` property (36 standard keywords, no url() images),
add css_cursor_t, a 6-bit type_bits field and the 34 new keywords, and
implement css_cascade_cursor(). Defaults to `auto`.
2026-10-17 21:16:46 +08:00
Liu a1a0c2cebe docs: document supported cursor values and platform caveats 2026-10-17 21:16:45 +08:00
Liu 251bf2fa54 feat(ui): propagate inherited CSS values to dependent children 2026-10-17 21:16:45 +08:00
Liu 604e9226e8 feat(css): add CSS property inheritance support 2026-10-17 21:16:44 +08:00
Liu 9d5d8d5a1d fix(widgets): snapshot text source in ui_text_set_content_w
The function freed the previous `txt->content` buffer before running
`y_wcsdup(text)` on the caller-supplied pointer. When the caller passes
`txt->content` itself (e.g. trimming flip in ui_text_on_parse_attr),
wcslen() then walks freed memory, returns a stale length, and wcscpy()
overruns the freshly allocated buffer.

Snapshot the source into a local `content` pointer first, release the
previous buffer, and reuse that snapshot for both `txt->content` and
the task queue copy.
2026-10-17 21:16:44 +08:00
Liu 916aac4850 feat(ui): render text underlines with offset and thickness control 2026-10-17 21:16:42 +08:00
Liu 11f8c66a65 feat(pandagl): add text underline render support 2026-10-17 21:16:42 +08:00
Liu 812391f1f5 feat(css): support CSS Color 4 rgb alpha syntax 2026-10-17 21:16:41 +08:00
Liu ae5b7d2ed9 feat(css): add text-decoration property 2026-10-17 21:16:41 +08:00
Liu b69a033056 docs: update website url 2026-10-17 21:16:40 +08:00
Liu 7676dd110b docs: update page generator 2026-10-17 21:16:40 +08:00
Liu 2b3c33a246 fix(pandagl): free unused fallback glyph bitmaps 2026-10-17 21:16:39 +08:00
Liu 53ef6ac477 fix(ui): destroy temporary string style values 2026-10-17 21:16:39 +08:00
Liu eb793c5959 fix(css): destroy temporary parsed style values 2026-10-17 21:16:38 +08:00
Liu 10b3665071 feat(widgets): add portal and select widget 2026-10-17 21:16:38 +08:00
Liu 4801465d93 fix(ui): calculate widget offsets without duplicate padding 2026-10-17 21:16:37 +08:00
Liu d7c5e848a6 refactor(ui): clarify event listener context parameters 2026-10-17 21:16:37 +08:00
Liu 4508d01609 docs: document focused lcui test command 2026-10-17 21:16:36 +08:00
Liu 8cb5bd7c32 fix(ui): percentage flex items should wrap within intrinsic size 2026-10-17 21:16:36 +08:00
Liu d819822db1 test(ui): cover percentage wrapping in content-sized flex layouts 2026-10-17 21:16:35 +08:00
Liu 3c6a592e98 fix(ui): incorporate children intrinsic width into cross size calculation 2026-10-17 21:16:35 +08:00
Liu b5e6bbf1c3 test(ui): add choice card reflow stability test and document event handler signature 2026-10-17 21:16:35 +08:00
Liu 13c32f98a3 feat(widgets): add field widget 2026-10-17 21:16:34 +08:00
rewine d212185924 fix: build for string-render example (#331) 2026-10-17 21:16:29 +08:00
Liu 8e539a9ccc fix(pandagl): nested [color] tags should use innermost tag's color 2026-10-17 21:16:28 +08:00
Liu fd23dd079f feat(widgets): add radio-group widget 2026-10-17 21:16:28 +08:00
Liu d731379d72 docs(doc-viewer): add label and checkbox widget documentation 2026-10-17 21:16:27 +08:00
Liu 8f77b1f32e feat(widgets): add checkbox widget 2026-10-17 21:16:26 +08:00
Liu 38aab01ec6 feat(widgets): add label widget 2026-08-05 22:42:29 +08:00
Liu 4a5f29b180 docs(doc-viewer): add usage, rename anatomy to composition 2026-08-05 22:42:28 +08:00
Liu 711296f718 fix(pandagl): unify text baseline across fallback fonts 2026-08-05 22:42:27 +08:00
Liu 3801fdc10f refactor(yutil): rename public APIs and migrate timer to ptk
- charset module renamed to encoding (decode/encode kept)
- time: get_time_ms → y_gettime, sleep_ms → y_sleep
- time: delete get_time_us, get_time_delta, sleep_s
- string: strdup2 → y_strdup, wcsdup2 → y_wcsdup
- string: strtolower → y_strlower, strtrim → y_strtrim
- string: wcstrim → y_wcstrim, strhash → y_strhash
- string: strreplace → y_strreplace, strsplit → y_strsplit
- string: delete wcsreplace, cmdsplit
- math: delete y_iround, y_pow2
- timer module migrated from yutil to ptk as internal timer_scheduler
- WinMain simplified to use __argc/__argv instead of cmdsplit

BREAKING CHANGE: all renamed yutil public APIs require downstream
  to update function names. Deleted APIs require code changes:
  - get_time_us: use y_gettime() for ms timestamps
  - get_time_delta: use y_gettime() - start instead
  - sleep_s: use y_sleep(ms) with millisecond argument
  - wcsreplace: no replacement, had zero callers
  - cmdsplit: WinMain now uses __argc/__argv from CRT
  - timer_list_*: migrated to ptk timer_scheduler_*;
    ptk_reset_timer still available for external use
2026-08-05 22:42:26 +08:00
Liu a4daecec9f chore: add yutil as regular directory 2026-08-05 22:42:24 +08:00
Liu ac0a9e26ee chore: convert yutil from submodule to regular directory 2026-08-05 22:42:23 +08:00
Liu 4a79f417d3 feat(pandagl): add backslash escape for style tag brackets
Allow \[, \], and \\ to be used in style-tag-enabled text input
so users can include literal bracket characters without triggering
tag parsing. Add tests covering open/close bracket escapes,
backslash self-escape, mixed real and escaped tags, and verify
unrelated backslash sequences (e.g. \n) are left untouched.
2026-08-05 22:42:23 +08:00
Liu 6cd01b468e chore: update copyright comment 2026-08-05 22:42:22 +08:00
Liu 2ccb6aa151 feat: add progress widget 2026-08-05 22:42:20 +08:00
CopilotandLiu 437d93d34e docs: add native doc-viewer and widget documentation (#324)
- Add examples/doc-viewer, an LCUI-based documentation viewer with an
  MDX compiler pipeline that converts source MDX files into C/TSX
  page components rendered by lcui build.
- Add zh-CN and en documentation for 5 widgets (anchor, button,
  scrollarea, text, text-input), each with C/TSX/XML example variants
  and widget-fields data.
- Add handbook and overview documentation.

Co-authored-by: Liu <lc-soft@live.cn>
2026-08-05 22:42:19 +08:00
Liu d48c8cc259 feat(settings): add custom string settings API
Expose lcui_settings_get_string / lcui_settings_set_string for reading
and writing custom [section] key-value pairs. Writes mark the settings
dirty; persistence requires a subsequent lcui_settings_flush() call.
2026-08-05 22:42:18 +08:00
Liu b6a2ad54da fix(widgets): ceil text bbox size to avoid rounding precision loss
Floating point truncation during cbox↔bbox round-trip conversion
caused accumulated error, e.g. 57.3333321 → 57.3333282, resulting
in unexpected line wrap. Using ceil() prevents value shrinkage and
ensures stable text layout.
2026-08-05 22:42:17 +08:00
Liu 7f9f52b904 chore: update copyright and email 2026-08-05 22:42:16 +08:00
Liu db5ab3dc36 ci: improve format check reliability
- Use project-local clang-format from node_modules/.bin instead of system
  PATH to avoid version mismatches between CI and development environments
- Print clang-format version and binary path in CI logs for debugging
- Add format:check script to package.json so `npm run format:check` works
- Add `needs: format` to build job so formatting failures block the build
  and don't waste CI resources
2026-08-05 22:42:15 +08:00
Liu 4bb0d51cd5 feat(settings): schema-driven serialization and window state persistence
- Per-window state with [window.<id>] sections in settings.ini
- Settings module split into rendering and window_state subsystems
- Schema-driven (de)serialization with DEFINE_SETTING_INT/BOOL_FIELD macros
- Listener-based change notification via deserialize/serialize callbacks
- Integration tests for get/set, validation, and bind/restore lifecycle
2026-08-05 22:42:14 +08:00
Liu 4dbd60875c ci: use clang-format-node for consistent formatting 2026-08-05 22:42:13 +08:00
Liu 9fd4bdb89f fix(ptk): ui_server should not bypass platform window destruction flow 2026-08-05 22:42:13 +08:00