Commit Graph
3840 Commits
Author SHA1 Message Date
Liu 90dbba2cdd feat(widgets): migrate textinput editing to the stb_textedit kernel
- vendor stb_textedit and add the textedit core with canonical text
- map edit indices to pd_text layout for caret, selection and hit testing
- support caret movement, selection, clipboard, undo/redo, password,
  read-only and multiline editing
- render selections with the accent color and configurable text color
- fix caret scaling, input-group repaint and zero-size reflow regressions
- add integration tests, a preview page and internals notes
2026-11-22 20:11:20 +08:00
Liu b0c031f8dc feat: add window icon support
- Add ptk_window_set_icons with Win32 WM_SETICON, X11 _NET_WM_ICON and fb no-op.

- Add LCUI window/default icon APIs, DPI-aware HICON selection and pre-rendered built-in icon assets.

- Add pandagl memory image readers and fix bilinear zoom edge sampling.

- Cover file/data icons, defaults and high-DPI sizes with integration tests.
2026-11-21 23:26:34 +08:00
Liu dc0ab38546 feat(styles): add switchable accent color themes
- generate an override stylesheet for each preset from style-nova
- add the ui_theme_* API, custom colors and single-slot loading
- persist the choice and add the navbar color picker
- keep badge variants, tooltip arrows and swatches consistent
2026-11-21 23:26:31 +08:00
Liu 64ea750885 feat(css): allow unloading style rules by source
- track rules by the source name passed to the loader
- add css_remove_style_rules() and ui_unload_css_string()
- refresh computed styles after removal and cover it with a test
2026-11-21 22:23:12 +08:00
Liu 2c4958b427 feat(doc-viewer): show repository icons, star counts and version badge
- add monochrome GitHub and Gitee assets with light/dark CSS backgrounds
- replace the GitHub text link with icon links for both repositories
- fetch and cache repository star counts at build time and render them
  beside the icons when available
- abbreviate counts of 1000 or more as `Nk` and separate the navbar
  actions with vertical dividers
- move the version number from the navbar to a badge below the Home title
- harden the star script for cold checkouts: root-relative paths, request
  timeouts, cache fallbacks and CI coverage
2026-11-21 20:53:30 +08:00
Liu 331e07840a fix(styles): correct card action and title class selectors 2026-11-21 19:42:40 +08:00
Liu dbc3eaf20e docs: add the doc-viewer navbar icon and star design 2026-11-21 19:27:19 +08:00
Liu 83c1c6d07d feat(styles): add class variants for badge, alert, item and card 2026-11-21 19:22:43 +08:00
Liu 0b63de799f fix(doc-viewer): demo code tabs should show a visible hover background
- use a foreground overlay instead of `bg-muted`, which matched the code
  header background exactly
- add a pointer cursor to the clickable tabs
- add a regression test for light and dark hover
2026-11-21 18:53:16 +08:00
Liu 1a6c3100e2 fix(styles): dark button variants should stay flat
- reset the border color under `.dark` for the primary, ghost, destructive
  and link variants, so the base `.dark .button` border cannot outline them
- reset the link variant's hover and active background in dark mode
- add regression tests for the class-based variants
2026-11-21 17:19:03 +08:00
Liu a9d94e2188 fix(font): use the resolved family name for fontconfig aliases
lcui_fc_fonts_init used the candidate name for aliases. When fontconfig falls back (for example no Ubuntu Mono on CI), the alias pointed at a family that was never loaded, so monospace/sans-serif/serif resolved to -2 and text rendering was empty. Query FC_FAMILY and use the actual loaded family.
2026-11-21 15:58:53 +08:00
Liu e56cee573b test: list loaded font families in environment output 2026-11-21 15:58:53 +08:00
Liu a9de756541 test(css): identify properties and cursor values in assertions 2026-11-21 15:58:52 +08:00
Liu 5eb230e877 ci: run library test targets in separate steps 2026-11-21 15:42:48 +08:00
Liu cf111c4a90 test: print environment details before test suites
Log display backend, metrics, screen size, fontconfig matches and font ids once so CI failures can be compared against the local environment.
2026-11-21 15:13:53 +08:00
Liu 03aef4fed3 test: add context to spinner capture and gallery resize assertions
Spinner tolerances scale with the reference ink size, and gallery resize assertions include the requested width and column index so repeated loop iterations are distinguishable.
2026-11-21 14:45:31 +08:00
Liu e26cd958a0 fix(ptk): emit window size event synchronously on Windows
Hidden windows may not receive WM_SIZE, so the gallery native resize tests saw stale root sizes. Emit PTK_EVENT_SIZE with the requested client size, matching the X11 backend.
2026-11-21 14:45:27 +08:00
Liu e50a5fa5fd test: use relative tolerances for text measurement tests
Shimmer allows a relative capture-width delta, the breadcrumb check asserts it stays within its parent, and assertion names include the property/value and measured metrics so CI failures show numbers instead of only true/false.
2026-11-21 14:26:38 +08:00
Liu 7c72628f23 fix(ui-server): apply window resize before the first frame
ui_server_on_window_resize() required INITIALIZED, but the doc-viewer tests resize a window before ui_server_update transitions PENDING to INITIALIZED, especially under Xvfb, so the resize was ignored. Update the widget whenever a connection exists.
2026-11-21 13:46:27 +08:00
Liu 279eacd3ad fix(css): report unsupported declarations at debug level
Tailwind-generated doc-viewer CSS contains standard values LCUI does not implement (fixed, sticky, grid, table, ...). Skipping them is expected fallback behavior, so log the property or value at debug level instead of error.
2026-11-21 13:42:01 +08:00
Liu 5460d5a733 fix(styles): remove unsupported letter-spacing from dropdown shortcut 2026-11-21 13:41:57 +08:00
Liu 4ab2de700a test: use tailwind-style labels in block and percentage wrap fixtures
Match the flex layout fixture: short utility-style labels keep example titles on one line and consistent across platform fonts.
2026-11-20 00:32:51 +08:00
Liu 64cfdc477c test: use tailwind-style labels in flex layout fixtures
Replace prose CSS declarations with short tailwind utility names so example titles stay on one line and remain readable at narrow widths.
2026-11-20 00:22:14 +08:00
Liu 7404070d5e fix(pandagl): release fontconfig global caches on shutdown
FcInitLoadConfigAndFonts() leaves fontconfig global configuration and caches allocated; FcConfigDestroy() only releases the per-call config. Call FcFini() when the font library is destroyed.
2026-11-20 00:15:26 +08:00
Liu 74255f501c test: shorten flex layout titles to avoid font-dependent wrapping
The example 10/12 titles were long enough to wrap at 320px, so their container height depended on the resolved monospace font. Use short tailwind-style labels, expect the single-line height, and drop the bundled DejaVu Sans Mono fixture.
2026-11-20 00:00:29 +08:00
Liu 4f83a1b2b0 test: pin layout fixtures to a bundled monospace font
The monospace alias resolved to Ubuntu Mono locally and a different font on CI runners, so the 320px flex wrapping expectations diverged. Bundle DejaVu Sans Mono under tests/fixtures/fonts, load it in the layout suites and point the monospace alias at it.
2026-11-19 23:51:09 +08:00
Liu 87d63f3c8a fix(ptk): keep cached window size in sync on Windows
ptk_window_set_size() only issued SetWindowPos(); the cached client size was updated later by WM_SIZE. Closing a window immediately after create/set_size saved the stale 320x240 size. Update the cache with the requested client size, matching the X11 backend.
2026-11-19 23:39:49 +08:00
Liu edf192475d test(css): identify properties in inheritance assertions
The shorthand and default-inheritance checks reused one fixed description inside loops, so the log showed identical lines with no property context. Include the selector and property name in each assertion name.
2026-11-19 23:38:27 +08:00
Liu 7449e6fb4a feat(pandagl): add quiet font loading for optional fonts
pd_font_try_load_file() reports failures at debug level so platform probes, test candidates and CSS @font-face no longer spam errors for missing system fonts. pd_font_load_file() and XML font resources still report errors, and initialization warns once when no usable default font exists.
2026-11-19 23:37:21 +08:00
Liu 7db080e684 test: use the logical monospace font in layout fixtures
Ubuntu Mono and Consola did not exist on Windows (Consola is a typo), so the fixtures fell back to Microsoft YaHei, a proportional font. Use the monospace alias so both platforms select their system monospace font, and unify the flex title height expectation now that Windows also wraps.
2026-11-19 22:49:34 +08:00
Liu ce47e50ed3 fix: keep example tests in the console subsystem on Windows
win.sdk.application was added globally in examples/xmake.lua, so doc-viewer-tests inherited the GUI subsystem and failed to link with WinMain. Scope the rule to the GUI example targets instead.
2026-11-19 22:39:49 +08:00
Liu ed25199836 fix(pandagl): zero glyph bitmap metrics on init
pd_glyph_bitmap_init() only cleared the bitmap fields. When glyph rendering failed and fell back to .notdef, the cached bitmap kept uninitialised metrics, so pd_text_update_line_size() read garbage (valgrind: conditional jump on uninitialised value) and text widths became nondeterministic.
2026-11-19 22:38:10 +08:00
Liu 365c2034c9 docs: clarify commit scope rules 2026-11-19 22:15:56 +08:00
Liu cf7ec0c0ea fix: make window resize conversion explicit
ui_widget_resize() takes floats; passing int values triggered C4244 (int to float) on MSVC, which is fatal under /WX in CI.
2026-11-19 22:15:46 +08:00
Liu 464eed1402 build: centralize package versions and standardize on C11
versions.json is now the single source of truth; scripts/sync-versions.mjs keeps xmake descriptors, tracked version headers and package.json in sync. Sub-library versions are aligned with the published 1.0.0 packages. C11 is set at the project level, and _GNU_SOURCE is defined on POSIX so strict C11 still exposes clock_gettime, strdup and recursive pthread mutexes.
2026-11-19 22:03:59 +08:00
Liu 9f1cb8a6e1 test: stabilize layout tests for Linux font metrics
Use Linux-specific expected heights for Ubuntu Mono wrapping, relax the auto-size width bound, and fix selector/style leaks in the CSS text decoration tests.
2026-11-19 22:03:59 +08:00
Liu 0e0bf7b179 fix(ui): image listener removal should free list nodes
list_unlink() leaves the node allocated. Use list_delete_node() when removing listeners, and destroy listener nodes when the image source is destroyed.
2026-11-19 22:03:59 +08:00
Liu ac011085ec fix(ui): event initialization should clear uninitialized mouse data
Synthetic click events only set target/type/data, leaving mouse coordinates uninitialized. Zero the event before assigning fields so hit testing does not read undefined values.
2026-11-19 22:03:59 +08:00
Liu 1ae26cab65 fix(lcui_ui): window resize should update the bound content
Apply the logical size to the bound widget when the window is resized before the first frame, and reject binding after a window has been closed.
2026-11-19 22:03:59 +08:00
Liu 01b022bd4c fix(ptk): X11 window geometry should reflect requested values
Cache the requested client size and position immediately, emit a size event for unmapped windows, and close hidden windows without waiting for a window manager that may not exist. This keeps synchronous get_size/get_position and close callbacks correct under Xvfb and WSLg.
2026-11-19 22:03:59 +08:00
dependabot[bot] 7decb79323 build(deps): bump source-map-js from 1.2.1 to 1.2.2
Bumps [source-map-js](https://github.com/7rulnik/source-map-js) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/7rulnik/source-map-js/releases)
- [Changelog](https://github.com/7rulnik/source-map-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/7rulnik/source-map-js/compare/v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: source-map-js
  dependency-version: 1.2.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-19 22:03:59 +08:00
dependabot[bot] 7af4d05f49 build(deps-dev): bump postcss-selector-parser from 6.1.4 to 6.1.6
Bumps [postcss-selector-parser](https://github.com/postcss/postcss-selector-parser) from 6.1.4 to 6.1.6.
- [Release notes](https://github.com/postcss/postcss-selector-parser/releases)
- [Changelog](https://github.com/postcss/postcss-selector-parser/blob/6.1.6/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-selector-parser/compare/6.1.4...6.1.6)

---
updated-dependencies:
- dependency-name: postcss-selector-parser
  dependency-version: 6.1.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-19 22:03:59 +08:00
dependabot[bot] 867ee79a97 build(deps): bump source-map-js in /examples/doc-viewer
Bumps [source-map-js](https://github.com/7rulnik/source-map-js) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/7rulnik/source-map-js/releases)
- [Changelog](https://github.com/7rulnik/source-map-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/7rulnik/source-map-js/compare/v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: source-map-js
  dependency-version: 1.2.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-19 22:03:59 +08:00
dependabot[bot] 4d1f39cc73 build(deps-dev): bump postcss-selector-parser in /examples/doc-viewer
Bumps [postcss-selector-parser](https://github.com/postcss/postcss-selector-parser) from 6.1.4 to 6.1.6.
- [Release notes](https://github.com/postcss/postcss-selector-parser/releases)
- [Changelog](https://github.com/postcss/postcss-selector-parser/blob/6.1.6/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-selector-parser/compare/6.1.4...6.1.6)

---
updated-dependencies:
- dependency-name: postcss-selector-parser
  dependency-version: 6.1.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-19 22:03:59 +08:00
dependabot[bot] fb4fe23a9e build(deps-dev): bump next from 16.4.2 to 16.4.6 in /examples/doc-viewer
Bumps [next](https://github.com/vercel/next.js) from 16.4.2 to 16.4.6.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.4.2...v16.4.6)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 16.4.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-19 22:03:59 +08:00
Liu c4b9000d36 build: make static library merging opt-in
Keep the sub-library archives separate by default so add_deps() can export each library's own links for tests and development builds. The merge-archive option restores the self-contained lcui library for release/Debian builds, and CI enables it only after tests pass. yutil-tests also needs C11 for its u8 string literals.
2026-11-19 01:26:36 +08:00
Liu 2e58a3936d refactor(ctest): implement timing without yutil
ctest only used y_gettime() for the elapsed time report, which pulled the yutil static library and its private dependency ordering into every test target. Replace it with a local monotonic clock (clock_gettime on POSIX, GetTickCount on Windows) and drop the yutil dependency from ctest and ctest-tests.
2026-11-19 01:20:07 +08:00
Liu 75d26f05d0 test: move doc-viewer layout tests into the doc-viewer project
These layout tests need the generated global.css.h and the doc-viewer home-grid component, so they do not belong in the core lcui-tests binary. Move them to examples/doc-viewer/tests, keep their fixture with the tests, and generate the doc-viewer sources before running xmake test so a fresh checkout has global.css.h.
2026-11-19 01:19:59 +08:00
Liu 78ba539b36 build(doc-viewer): lcui packages should use their latest releases
Move @lcui/react to 0.7.0, @lcui/fluent-icons to 2.1.0 and add @lcui/tailwind-config 0.2.0 so lcui build can regenerate the doc-viewer sources from global.css. Refresh both bun.lock and package-lock.json.
2026-11-19 01:19:59 +08:00
Liu a5444668ac test: unused helpers should be removed and footer initialized
Drop ad_count_children and count_by_type, which no longer have any callers, and initialize footer to NULL before scanning dialog children to silence GCC's -Wmaybe-uninitialized in release builds.
2026-11-19 01:19:58 +08:00