Widgets: components, app adapter and gallery on the refactored core #13

Merged
ilusha merged 3 commits from WidgetsComponents into master 2026-10-31 21:39:11 +03:00

3 commits

Author SHA1 Message Date
5f6c191bf5 Widgets: keep each component's tests next to the component
Some checks failed
Windows / build (pull_request) Has been cancelled
CMake on a single platform / build (pull_request) Has been cancelled
CMake / build (pull_request) Has been cancelled
Category tests move into their component's tests/ folder (controls, chrome,
views, media, nodes, files, kanban, markdown, docking, session, debug); the
cross-cutting suites (input, layout, popups, style, wrapping, the gallery and
theme editor pages, the grab-bag widget tests) stay in tests/ with the shared
support.
2026-10-31 19:41:16 +03:00
15fe61dac4 Widgets: port the components, app adapter, gallery and tests onto the core
Some checks failed
Windows / build (pull_request) Has been cancelled
CMake on a single platform / build (pull_request) Has been cancelled
CMake / build (pull_request) Has been cancelled
Mechanical port of WidgetsComponents onto the refactored core, per the
porting table: widgets paint on tp::Canvas, handle the routed tp::InputEvent,
use the container widgets, popup kinds, Widget::platform(), the theme
interaction constants and WidgetsTesting for tests.

- Painter, the ui:: mirror types, ImageId/ImageLoader, InputRouting and the
  per-frame hooks are gone; the app adapter constructs Ui(UiOptions{...}) and
  dispatches InputState directly.
- Drags go through the router: NodeEditor and TreeView arm a pending gesture
  at press and consume Dragged Started/Moved/Finished/Cancelled; a click that
  does not drag finishes selection, and releasing while stretched absorbs
  into the stretch instead of flinging.
- The widget sizes that left Metrics live in the components as sizes::
  (slider, scroll bar, splitter, menu, window buttons); MarkdownEditor takes
  the images directory from the application.
- Tests drive the headless UiDriver on the recording canvas; the suite is
  781 tests (the InputTranslator tests died with the translator, and the
  per-frame hook test died with the hook - both are covered by core tests).

The full build's failing set is unchanged: the four old-API application
entry points (3DEditor, LibraryViewer, Sketch3D) that the next PRs port.
2026-10-31 18:39:33 +03:00
30a5ddae47 Widgets core: canvas access on the Ui, transient test modifiers, hairline border
Small core changes the components port needs:
- UiOptions takes the canvas and Ui exposes canvas(), so widgets can load and
  size images through it.
- The test driver gains key/holdKey/pressKey/click overloads that hold
  modifiers only for that one call, like the old driver's modifier argument.
- borderWidth is a hairline and stays unscaled; the scaling guard accounts for
  it.
2026-10-31 18:39:33 +03:00