120 Commits
Author SHA1 Message Date
Liu b7a5779b61 fix(widgets): keep the sidebar footer menu in flow
- fill the provider height so the footer stays inside the sidebar
- overlay only action menus instead of every menu inside a menu item
- mark action menus with sidebar-menu-action-menu in the demos
- assert the project action layout still overlays its row
2026-11-22 20:11:22 +08:00
Liu 1a030c3a48 fix(styles): keep the focus ring out of grouped inputs
- reset the generic textinput ring on input-group children
- match the accent override specificity in both light and dark modes
- cover the grouped input reset with a test
2026-11-22 20:11:21 +08:00
Liu 63ed1be359 style: drop the pointer cursor from buttons and scrollbars
- keep the default cursor over buttons, select triggers and scrollbars
- update the cursor test for the new button default
2026-11-22 20:11:21 +08:00
Liu 747a222fcc feat(styles): follow the accent in focus rings and app fills
- generate focus box-shadow overrides from the accent primary color
- add the fill-primary class for app-level primary fills
- use it for the doc-viewer payout progress bar
2026-11-22 20:11:20 +08:00
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 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 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 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 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 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 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 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 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 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 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
Liu 093a6a1e35 feat: add explicit window lifecycle and per-window event routing
- add the window API and lifecycle design specs
- lcui_init no longer creates a window; settings loading is explicit
- add lcui_window_* create/bind/geometry/state/show/close api
- replace display modes with window options and quit-on-last-window
- add per-window event scopes and window-based pointer/keyboard routing
- keep pending updates for widgets appended during a frame
- migrate examples, tests, previews and internals docs
- remove default-scope focus and mouseover getters
2026-11-16 00:03:50 +08:00
Liu c6496268c0 fix(doc-viewer): demo language tabs should not wrap onto two rows
- lay out the file and language tab groups as flex rows so width rounding
  cannot push TSX onto a second line after selecting XML
- let the file group shrink with min-width: 0
- add a demo header regression test for every language selection
2026-11-15 23:40:43 +08:00
Liu 907123560a feat(widgets): add dropdown menu trigger width matching
- add a match-trigger-width attribute for portal menus
- size the opened content panel to the trigger border box
- use it for the home payout currency menu
2026-11-14 11:12:54 +08:00
Liu e87f0f1f06 feat(doc-viewer): localize and rebalance the home gallery
- add Chinese card copy with ¥ amounts and CNY as the default currency
- reorder the 4x2 card grid around Deployment, Distribute and Payout
- remove leftover item min-heights and fix title/media/action alignment
- compile generated UTF-8 page headers with MSVC /utf-8
2026-11-14 00:31:29 +08:00
Liu 855855263b feat(css): add align-self support for flex items
- register align-self and resolve auto against the container align-items
- apply per-item alignment to measuring, cross-axis layout and static positions
- align item media icons with the first title line
2026-11-14 00:31:15 +08:00
Liu 51706dbfb2 fix(widgets): fix password mask buffer overflow
- allocate room for the terminating wide character when masking text blocks
- add a regression that enables password masking before entering text
2026-11-14 00:31:05 +08:00
Liu cbf051e061 fix(ui): refresh status styles only for matched selectors
- skip style refreshes when no :hover/:active/:focus selector matches
- detect self and descendant status selectors separately before refresh
- preserve API text content across CSS content overrides and restore it on exit
- cover unmatched, matched and text-content status changes in integration tests
2026-11-13 22:18:29 +08:00
Liu 3cce29caa4 fix(doc-viewer): rebuild responsive home gallery
- compose the home page from real card, field, attachment and empty widgets
- place gallery cards into responsive columns on first mount and route remount
- update the home layout on native window resizes and breakpoint changes
- refresh navbar, docs page containers and offscreen render helpers
- add gallery layout regressions for mounting, resizing, hover and icon sizing
2026-11-13 21:56:49 +08:00
Liu 1f46778893 fix(ui): stabilize layout measurement and style refresh
- restore intrinsic sizes before measuring flex and block children
- resolve percentage widths against indefinite parents as auto
- reflow parents when child content changes and refresh background geometry
- ignore hidden flex items in gap insertion and use spec static positions
- keep text paint size in sync with the current capture scale
2026-11-13 21:56:39 +08:00
Liu e857ce1245 feat(widgets): support multiline text input attribute
ui_textinput_enable_multiline() only toggled white-space; is_multiline_mode was never set, so newlines were still filtered and autosize stayed single-line. Set the flag and expose a declarative multiline attribute for textinput, with an integration test covering newline handling.
2026-11-08 17:06:45 +08:00
Liu 6667d19e63 fix(widgets): invalidate portal scroll parents on destroy
Portal cached raw scroll area pointers and only skipped widgets whose state was UI_WIDGET_STATE_DELETED. ui_widget_destroy() frees immediately and never sets that state, so replacing the docs layout (locale switch) left dropdown portals pointing at a freed ScrollArea. Destroying the portal then called ui_widget_off() on freed memory.

Register a destroy listener on every bound scroll parent, clear the matching slot, and skip cleared slots while handling scroll events.
2026-11-08 14:58:53 +08:00
Liu 91444c60cd feat(widgets): add class based button styles 2026-11-08 00:20:47 +08:00
Liu 78b401c1b5 fix(router): reuse matched components on sibling navigation
- keep the mounted component when the matched component name is unchanged
- initialize matched_widget and add regression tests for nested layouts
2026-11-08 00:20:46 +08:00
Liu 029d5c4e22 feat(widgets): add button group widget
- add button-group, button-group-text and button-group-separator
  prototypes with orientation and separator APIs
- mark direct children as geometry items, keep select, popover and
  dropdown wrappers out of the border geometry and clean up on unlink
- theme the group for the nova style, covering nested groups, select,
  input group and first/last edge rules
- add integration tests for factories, marking, geometry, input flex
  and trigger wrappers
- add zh-CN documentation, field tables, sidebar entry and C/XML/TSX
  examples for every section
2026-11-08 00:20:39 +08:00
Liu a23c16f5c5 feat(widgets): add input group widget 2026-11-08 00:20:36 +08:00
Liu 3dda91be11 feat(widgets): add accordion widget 2026-11-08 00:20:33 +08:00
Liu 20b3221cfd fix(ui): stabilize flex layout and add layout contract tests
- merge own sizehint with child layout extent; keep sizehint callable
- support cross-axis auto margins and flex-basis content/percentage
- fix space-evenly gap, canvas destroy, breadcrumb intrinsic width and dynamic text intrinsic refresh
- add flex contract, sizehint, empty layout and field layout suites
- move empty/field scenarios to theme-independent test fixtures
- document layout coverage and known gaps
2026-11-08 00:20:31 +08:00
Liu c575d7fab5 refactor(worker): internalize worker task queue
- move the worker queue into src/lcui_worker.c
- expose only lcui_worker_* from <LCUI/worker.h>
- reuse the global async queue in anchor
- fix double unlock, active-state race and cancel target
- add worker integration tests
2026-11-08 00:20:29 +08:00
Liu ef42f0894c refactor(ui): move router widgets into core widgets
- move router-link and router-view into src/widgets
- add <LCUI/widgets/router.h> and aggregate it in widgets.h
- remove the libui-router target and package
2026-11-08 00:20:29 +08:00
Liu 22c883b79e fix(ui): wrap and stabilize flex column text layout
Persist parent width constraint (source + generation) and wrap text at it; six-pass flex layout with <=1 reflow per child; fit-content clamp for centered auto-width children; re-derive centered column cross width from constraint on standalone reflow; fixed-cross flex containers ignore child size hint. Record row main-axis allocation as a persisted constraint so a flex:1 child keeps its width across standalone reflow. Measure/layout phase split, measurement cache invalidation test, and sizehint capability flag so zero-size results are not mistaken for missing sizehints. Add layout engine rules doc and integration tests (wrap, empty, empty-basic, field-checkbox remount, empty media icon).
2026-11-08 00:20:27 +08:00
Liu 263c62e531 feat(widgets): add breadcrumb widget
- add the breadcrumb family: root, list, item, link, page, separator, ellipsis
- build from a path with a per-call label provider, append_item/append, or explicit data-path items
- collapse overflowing items while keeping as many trailing nodes as fit; the ellipsis opens a Portal-based dropdown
- emit change with the clicked node key; pages, disabled items, and custom append content never emit
- add theme rules, integration tests, a preview scene, and zh-CN docs with C/XML/TSX demos
2026-11-08 00:20:26 +08:00
Liu f226404554 feat(widgets): add sidebar widget 2026-11-02 22:31:25 +08:00
Liu ba50322e22 feat(widgets): add dropdown menu widget 2026-11-02 22:31:24 +08:00
Liu 898a96cb8c feat(widgets): add collapsible widget 2026-11-02 22:31:23 +08:00
Liu 8c78437264 fix(widgets): contain nested scrollarea wheel events 2026-11-02 22:31:18 +08:00
Liu 49e719995c feat(widgets): add attachment widget 2026-11-02 22:31:17 +08:00
Liu 860b1f1289 feat(widgets): add card widget 2026-11-02 22:31:16 +08:00
Liu ccad5ef131 feat(widgets): add toast widget 2026-11-02 22:31:15 +08:00