fix(layers): freeze toggle in ribbon dropdown + sortable manager columns

Ribbon layer dropdown rows were a single button, so a click on the
visible/freeze/lock icon fell through to the make-active handler instead
of toggling that state. Split the row: each icon is its own toggle
button, only the swatch+label selects the active layer. Toggle handlers
now resync the ribbon so the icon updates while the dropdown stays open.

Layer Manager columns are now sortable: clicking a header sorts by that
column, clicking again flips direction (SVG arrow indicator). Sort is
reapplied on every panel sync so it survives edits, preserves the
selection by name, and keeps the ribbon dropdown order in step.

Fixes #133

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-19 20:39:09 +03:00
commit 36d5891572
4 changed files with 205 additions and 48 deletions

View file

@ -889,6 +889,8 @@ pub enum Message {
LayerToggleVisible(usize),
LayerToggleLock(usize),
LayerToggleFreeze(usize),
/// Sort the Layer Manager table by a clicked column header.
LayerSort(crate::ui::layers::LayerSortCol),
/// Toggle per-viewport freeze: (layer_index, vp_col_index)
LayerToggleVpFreeze(usize, usize),
LayerNew,