Dynamic name column width + click-in-padding keeps edit active

- Compute effective name column width from longest field name (8-22 chars)
- Store layout in ComposeResult, cache in editor for span calculations
- Parameterize span functions to use runtime nameW instead of fixed constant
- Click within column padding during edit moves cursor to end instead of committing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
sysadmin
2026-02-04 09:03:18 -07:00
parent 490486ca7c
commit b7b0cbf2d2
5 changed files with 78 additions and 32 deletions

View File

@@ -25,8 +25,8 @@ public:
// ── Column span computation ──
static ColumnSpan typeSpan(const LineMeta& lm);
static ColumnSpan nameSpan(const LineMeta& lm);
static ColumnSpan valueSpan(const LineMeta& lm, int lineLength);
static ColumnSpan nameSpan(const LineMeta& lm, int nameW = kColName);
static ColumnSpan valueSpan(const LineMeta& lm, int lineLength, int nameW = kColName);
// ── Multi-selection ──
QSet<int> selectedNodeIndices() const;
@@ -55,6 +55,7 @@ private:
QsciScintilla* m_sci = nullptr;
QsciLexerCPP* m_lexer = nullptr;
QVector<LineMeta> m_meta;
LayoutInfo m_layout; // cached from ComposeResult
int m_marginStyleBase = -1;
int m_hintLine = -1;