Sketch2D: tablet painting application #17

Merged
ilusha merged 13 commits from sketch2d into master 2026-11-01 14:26:57 +03:00

13 commits

Author SHA1 Message Date
fa1cfae4d4 Sketch2D: the library's multi-select is a SelectionModel
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
The hand-built std::vector<std::string> selection (toggle/clear/select-all and
the contains checks) becomes SelectionModel<std::string> in multiple mode: the
banner, move-here picker and action menu now read the selected set and current
item from the shared selection model.
2026-11-01 13:46:54 +03:00
1781e634ca Sketch2D: the brush list is a ListView of ListRow
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
BrushListPopup no longer hand-builds BrushPresetButton widgets: the presets are
a ListView whose rows are ListRow with a custom-painted leading (the stroke
sample). ListRow gains a custom leading so a caller can paint its own mark, and
the brush sample paint moves into a free function.
2026-11-01 13:42:23 +03:00
5f29f5099b Sketch2D: use the shared Commands for the command registry
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
The hand-rolled CommandRegistry is now a thin wrapper over Commands<Command>:
definitions, shortcuts, enabled/checked, run and key handling all come from the
shared registry, with the commandInfo label and the key-repeat tracking on top.
The repeat tracking itself moved into Commands<Id> so any app can offer fine
adjustment on a held shortcut, and the actions no longer carry the unused event
pointer.
2026-11-01 13:31:21 +03:00
de9cfc7c44 Sketch2D: use the shared PromptDialog for the name prompts
RenameLayerDialog and SaveSketchDialog were two copies of the same one-field
prompt; replace them with the shared PromptDialog. The layer dialog keeps its
63-character limit and the library prompts their 64-character limit; the
prompt's submitted signal preserves Enter-confirm without re-confirming on a
focus change.
2026-11-01 13:21:57 +03:00
7a2d61ae4b Sketch2D: port the input, text, image and command APIs onto the refactor
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
The UI layer now compiles against the refactored Widgets and shared Graphics
input layer: the old Painter/text positional API becomes Canvas + TextStyle,
ui::ImageId becomes ImageHandle, the InputID key registry becomes the shared
Key enum, event.touchGesture/wheelAmount/pressure become the new Event accessors,
and the theme Metrics fields are renamed. Sketch2D keeps its own command
registry (with repeat tracking and event-triggered actions) under
CommandRegistry, renamed so it no longer shadows the shared Commands.hpp; it
also keeps its profiler macros and the CPU-placement policy, rebuilt on the
shared Profiler and ThreadPinning.
2026-11-01 13:09:54 +03:00
55072088a2 Sketch2D: migrate the input codes onto the shared input layer
The refactor moved pointer buttons, modifiers and the pointer sample into the
shared GraphicApplication input layer: PointerButton::Primary -> Left, the
old ui::Modifiers -> KeyModifiers, PointerTool::Finger -> PointerDevice::Finger,
and the canvas type is tp::Canvas rather than a Widgets painter. Rename the UI
layer to match and undo two over-eager Painter->Canvas replacements.
2026-11-01 12:29:12 +03:00
303030a571 Sketch2D: migrate the removed subsystem utilities for the refactor
The refactor dropped the global profile macros, the CPU-placement policy and
the shared AppStorage. Follow it: delete the TP_PROFILE_* instrumentation and
the ThreadPlacement pinning (worker count becomes hardware_concurrency), and
give Sketch2D its own small AppStorage for its home folder. Also repair a
Painter->Canvas rename that had corrupted StrokePainter's deleted copy ops.
2026-11-01 12:27:05 +03:00
91df02ba7f Sketch2D: link the renamed library targets for the ported headers
The refactor renamed Graphics -> GraphicApplication and moved Profiler into
GraphicApplicationDiagnostics, ParallelFor and WorkerLanes into Threading.
Point the libraries at the new targets so the ported includes resolve.
2026-11-01 12:22:35 +03:00
d2ee293466 Sketch2D: port the UI layer onto the refactored Widgets Canvas
The refactor renamed the Widgets painter to tp::Canvas (fillRect -> rect,
fillCircle -> circle, strokeRect -> outline, strokeCircle -> circleOutline,
fillPolygon -> polygon, image -> drawImage, RecordingPainter ->
RecordingCanvasBackend). The UI layer still used the old Painter names; port
them, register the module in the root build, and link the tests against
WidgetsTesting instead of the removed Widgets test-support sources.
2026-11-01 12:19:53 +03:00
Шурупов Илья Викторович
a096aeaddf Sketch2D: tests, icons and scripts 2026-11-01 12:19:53 +03:00
Шурупов Илья Викторович
8fe06e77a0 Sketch2D: application entry, desktop launcher and benchmark 2026-11-01 12:19:53 +03:00
Шурупов Илья Викторович
04bcfc5556 Sketch2D: tile renderer, library and UI layers 2026-11-01 12:19:53 +03:00
Шурупов Илья Викторович
c2688f83a4 Sketch2D: core brush, engine and document libraries 2026-11-01 12:19:53 +03:00