feat(layers): draggable Name-column width in the Layer Manager (#359)

A thin divider after the Name header resizes the column by drag
(60-640 px, session-persistent), riding the shared modal drag flow.
The name elide budget follows the column width, so widening the
column reveals long layer names; the hover tooltip stays for overflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-21 23:34:02 +03:00
commit 87f40e7544
4 changed files with 58 additions and 22 deletions

View file

@ -461,6 +461,11 @@ pub(super) struct OpenCADStudio {
modal_drag_last: Option<Point>,
/// True while the modal title bar is held (a drag is in progress).
modal_dragging: bool,
/// Layer Manager: dragging the Name-column divider (width follows the
/// shared ModalDragMove flow).
layer_col_dragging: bool,
/// Layer Manager Name column width in px, adjusted by the divider drag.
layer_name_col_w: f32,
/// How far the user has dragged the modal's corner resize grip from the
/// dialog's natural size (added to each modal's default width/height). Reset
/// with `modal_offset` so every dialog opens at its own size.
@ -1364,6 +1369,8 @@ pub enum Message {
CommandHistoryNext,
/// Toggle the dropdown listing the full command-line history.
CommandHistoryToggle,
/// Start dragging the Layer Manager's Name-column divider.
LayerNameColGrab,
/// Toggle the persistent literal-space mode (the `>` button): while on,
/// every command line behaves as if it started with `>` — Space stays in
/// the input instead of submitting. Saved in the user config.
@ -2286,6 +2293,8 @@ impl OpenCADStudio {
modal_offset: iced::Vector::ZERO,
modal_drag_last: None,
modal_dragging: false,
layer_col_dragging: false,
layer_name_col_w: 130.0,
modal_resize: iced::Vector::ZERO,
modal_resizing: false,
attr_editor_handle: None,