mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
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:
@@ -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, ' ')
|
||||
|
||||
Reference in New Issue
Block a user