Widgets: fix every component-review finding in one refactor #19

Merged
ilusha merged 10 commits from WidgetsRefactor into master 2026-11-01 11:53:32 +03:00

10 commits

Author SHA1 Message Date
12ddb9532d Widgets: DocumentFolderPanel — a folder of markdown documents
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 shared half of a skills library and a task workspace: a FileBrowser over
a root directory of markdown files, an editor page that opens a file on
double-click, loads it and writes edits back to disk, a status line for
read/save failures, and a back-to-library navigation. The library title, an
optional hint above the browser, the editor mode and the document title are
configurable; onDocumentOpened reports each open. Tests cover open/load,
write-back through editing, and the unreadable-file status.
2026-11-01 11:30:05 +03:00
a67b2ff05c Widgets: PromptDialog, and a submitted signal for single-line editors
A one-line prompt (rename a layer, save a sketch, name a skill) is a dialog
with a text field, a confirm button and a cancel. PromptDialog focuses and
selects the field when it opens; Enter submits (confirm), Escape or Cancel
cancel without running the callback.

The field needed a way to tell "Enter submitted it" from "it committed because
it lost focus": a click on Cancel moves focus and would otherwise also confirm.
TextEditor::setOnSubmitted fires only when Enter submits a single-line editor,
while setOnCommitted keeps firing on both Enter and focus loss.
2026-11-01 11:24:00 +03:00
Шурупов Илья Викторович
a85b8db8c3 Widgets: drop two debug prints from the menu icon test
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
2026-11-01 11:07:54 +03:00
Шурупов Илья Викторович
061ad3ec60 Widgets: node views share geometry and SelectionModel; last glyphs; menu ownership
The node editor and tree view now share link geometry (one S-curve with a
LinkShape), nearest-port search, the marquee rect and look, and keep their
selection in a SelectionModel; the tree also already had box selection. The
last hand-drawn glyphs use core glyphs: number-field steps, the add-colour
cell, the menu icon, the dock grip and the collapsible chevron (which turns).
Menus own their items, separators and titles; TextArea is a column. The
gallery gains Forms and Panels pages for the new shared components.
2026-11-01 11:07:54 +03:00
Шурупов Илья Викторович
121e930064 Widgets: TitledPanel; dialogs, dock, floating panels and stack pages are titled panels
One header (leading/trailing slots) + scrollable body + footer + corner slot,
with one content API. PropertyList (value/slider/checkbox/choice/text rows
bound to getter/setter) drives the LibraryViewer track info and theme metrics.
Dialog, DockPanel, FloatingPanel and StackPage are titled panels; the private
panel layouts are gone.
2026-11-01 11:07:42 +03:00
Шурупов Илья Викторович
1233f76273 Widgets: ListNavigator, ListRow, ListView; menus, forms and files on them
Lists share navigation (arrows, Home/End, Page, type-ahead), one row with
leading/title/subtitle/trailing slots, selection and an empty state. Search
results, the file browser, settings rows, the LibraryViewer track list and the
theme color list use them. Menus and dropdowns gain full keyboard navigation
(they had none): Up/Down/Home/End/type-ahead, Enter, Right/Left for submenus,
focus restored on close. MenuEntry::command reads a Commands registry, which
NodeEditor now runs through; menus refresh whenever they open.
2026-11-01 11:07:42 +03:00
Шурупов Илья Викторович
5f2b4c3bbf Widgets: every drag through the router; list and Kanban reorder share a session
Slider, ResizeHandle, SeekBar, the color pickers, FloatingPanel, DockPanel and
its grip, text selection, ReorderableList and Kanban all use router drags (one
slop, Escape cancels; Ui::claimDrag hands a long press over). ReorderableList
and Kanban share ReorderSession (one slot rule and auto-scroll through the
Viewport, one elevation, a landing glide) and stock layouts. Cards, swatches
and the seek handle fade through InteractionVisual; breadcrumbs, swatches and
dialog buttons are owned children; four withAlpha copies become Palette::faded.
2026-11-01 11:07:42 +03:00
Шурупов Илья Викторович
773ad57940 Widgets: ScrollView is a Viewport; one wheel, drag, fling and reveal for every scroller
The core Viewport gains per-edge stretch, animated glide, revealOffset, overlay
hooks and the averaged release velocity. ScrollView drops its own offset
animation, 8px drag state machine, fling, two stretches and layout. Horizontal
wheel, trackpad and Shift+wheel scroll sideways in every scroller (Kanban loses
its workaround); reveal uses the theme margin in TextArea and TabView; the
carousel tells touchpad from wheel by the scroll source. The router delivers a
drag only to the widget that accepted it, cancels a drag whose widget is
hidden, and drops an unstarted ancestor drag on capture.
2026-11-01 11:07:42 +03:00
Шурупов Илья Викторович
56c264f142 Widgets: shared visuals, layouts and choices; TabView and MarkdownEditor use them
- core glyph set (plus Volume/Muted/ResizeCorner and a turn) with paintGlyph,
  InteractionVisual (hover/press/reveal) and the elevation shadow, adopted by
  buttons, toggles, panels and window controls;
- GridLayout per-column widths; MarkdownView tables on it and its blocks owned;
- RowLayout overflow; MenuBar fits its titles through it and moves its window
  through a router drag;
- SegmentedControl and RadioGroup on SelectionModel; the tab strip and the
  MarkdownEditor modes are segmented controls.
2026-11-01 11:07:42 +03:00
Шурупов Илья Викторович
6e4732d9ec 3DEditor, Sketch3D: port onto the refactored Widgets
Both were ImGui or half-ported on master and did not build there. 3DEditor
gets an EditorWidget (orbit/pan/zoom and click-select through router drags on
a Viewport) with a docked controls panel; Sketch3D gets a SketchGUI with a
router-drag viewport (Shift move, Alt rotate, Control zoom, pressure draws)
and a dock area with color wheel, sliders and menus.
2026-11-01 11:07:42 +03:00