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

@@ -213,12 +213,12 @@ QString readValue(const Node& node, const Provider& prov,
QString fmtNodeLine(const Node& node, const Provider& prov,
uint64_t addr, int depth, int subLine,
const QString& comment) {
const QString& comment, int colName) {
QString ind = indent(depth);
QString type = typeName(node.kind);
QString name = fit(node.name, COL_NAME);
QString name = fit(node.name, colName);
// Blank prefix for continuation lines (same width as type+sep+name+sep)
const int prefixW = COL_TYPE + COL_NAME + 4; // 2 seps × 2 chars
const int prefixW = COL_TYPE + colName + 4; // 2 seps × 2 chars
// Comment suffix (padded or empty)
QString cmtSuffix = comment.isEmpty() ? QString(COL_COMMENT, ' ')