Widgets: core engine (canvas painting, ordered input, interaction mechanisms) #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Widgets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Widgets core engine
First of two PRs splitting the Widgets rewrite. This one is the engine: no widgets. Every widget, the window adapter and the gallery come in
WidgetsComponents(#13), which will be ported onto this API.#14 (GraphicApplication) is merged; this PR is rebased on top of it.
The core was reviewed against its consumers (PR #13, Sketch2D, Taskboard, Objects, 3DEditor, Sketch3D, LibraryViewer). The review found 18 issues, and this branch resolves all of them.
What changed
tp::Canvas— thePaintermirror is removed; clipping now reaches the backend. Core links only the input layer, window types and canvas (no Vulkan, NanoVG, ImGui).AppStorageis removed.tp::InputEventlog, andui::Eventis an envelope around the input event or a recognized gesture.Viewport+ViewportPolicy,SelectionModel<Id>,ReorderSession,Commands<Id>.Column/Row/Stackown their layout and takeBoxOptions;emplaceChild<T>()gives widgets owned children;Widget::platform()provides window services that work without a window.openDropdown, andopenOverlaywithDialog,SheetorNotice.Theme::Interactionholds the interaction constants;Metricskeeps only shared sizes with a single, test-checked scaling list;Widget::assignreplaces the per-setter boilerplate.Ui(UiOptions{ textMetrics, theme, windowHost }), plus aWidgetsTestinglibrary (UiDriver, probes) on the recording canvas.Verification
SketchGUI, which still use the old API.84192f778eto9305f53a40- Move to the GraphicApplication layout: src/{core,layouts,widgets,app,components}, one static library each (WidgetsCore/.../WidgetsComponents) under the Widgets umbrella. - Split the widget set: the simple proof-of-concept widgets stay in widgets/; the full widgets (docking, kanban, markdown, media, files, views, session) and the node editor live in src/components/, grouped by category, with their tests alongside. - The tooltip bubble moves into core (the tooltip controller owns one) so core no longer depends on the Label widget; InputRouting moves into core too. - DebugInspector/DebugTools move to components/debug; WidgetApplication is now a minimal adapter without the inspector/debug menu. - Tests split: core + simple-widget tests in tests/, component tests in src/components/tests/, app adapter tests in tests/app/.Widgets: rebuild around measure/arrange layout, event routing and popupsto Widgets: minimal core library with simple widgets and layout engineWidgets: minimal core library with simple widgets and layout engineto Widgets: core engine library (widget, layout, painter, popup, theme)Widgets: core engine library (widget, layout, painter, popup, theme)to Widgets: core engine (canvas painting, ordered input, interaction mechanisms)c738a5c51ctoc046e2639fc046e2639ftobd049cb012bd049cb012to5545faf6a95545faf6a9to74e6aa0eee386fd36f48to74e6aa0eeeView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.