Type picker refactor: use SCI_USERLISTSHOW, fix coordinate handling

- Switch type picker from SCI_AUTOCSHOW to SCI_USERLISTSHOW for proper
  signal handling (userListActivated now fires correctly)
- Fix coordinate system mixing by using posFromCol() consistently
- Skip 0x prefix in value/base address edit selection
- Dynamic hint positioning: 2 spaces after value with // prefix
- Clearer validation errors ("too large! max=0x..." instead of "max")
- Green colored hint text using IND_BASE_ADDR indicator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
sysadmin
2026-02-04 07:48:59 -07:00
parent 06c3251f74
commit 490486ca7c
7 changed files with 396 additions and 154 deletions

View File

@@ -115,7 +115,7 @@ void composeLeaf(ComposeState& state, const NodeTree& tree,
lm.isContinuation = isCont;
lm.lineKind = isCont ? LineKind::Continuation : LineKind::Field;
lm.nodeKind = node.kind;
lm.offsetText = fmt::fmtOffsetMargin(absAddr, isCont);
lm.offsetText = fmt::fmtOffsetMargin(tree.baseAddress + absAddr, isCont);
lm.markerMask = computeMarkers(node, prov, absAddr, isCont, depth);
lm.foldLevel = computeFoldLevel(depth, false);
@@ -145,7 +145,7 @@ void composeParent(ComposeState& state, const NodeTree& tree,
lm.nodeId = node.id;
lm.depth = depth;
lm.lineKind = LineKind::Field;
lm.offsetText = fmt::fmtOffsetMargin(absAddr, false);
lm.offsetText = fmt::fmtOffsetMargin(tree.baseAddress + absAddr, false);
lm.nodeKind = node.kind;
lm.markerMask = (1u << M_CYCLE) | (1u << M_ERR);
lm.foldLevel = computeFoldLevel(depth, false);
@@ -162,13 +162,19 @@ void composeParent(ComposeState& state, const NodeTree& tree,
lm.nodeId = node.id;
lm.depth = depth;
lm.lineKind = LineKind::Header;
lm.offsetText = fmt::fmtOffsetMargin(absAddr, false);
lm.offsetText = fmt::fmtOffsetMargin(tree.baseAddress + absAddr, false);
lm.nodeKind = node.kind;
lm.foldHead = true;
lm.foldCollapsed = node.collapsed;
lm.foldLevel = computeFoldLevel(depth, true);
lm.markerMask = (1u << M_STRUCT_BG);
state.emitLine(fmt::fmtStructHeader(node, depth), lm);
lm.isRootHeader = (node.parentId == 0); // Root-level struct
// Root structs show base address, nested structs show normal header
QString headerText = lm.isRootHeader
? fmt::fmtStructHeaderWithBase(node, depth, tree.baseAddress)
: fmt::fmtStructHeader(node, depth);
state.emitLine(headerText, lm);
}
if (!node.collapsed) {
@@ -215,7 +221,7 @@ void composeNode(ComposeState& state, const NodeTree& tree,
lm.nodeId = node.id;
lm.depth = depth;
lm.lineKind = LineKind::Field;
lm.offsetText = fmt::fmtOffsetMargin(absAddr, false);
lm.offsetText = fmt::fmtOffsetMargin(tree.baseAddress + absAddr, false);
lm.nodeKind = node.kind;
lm.foldHead = true;
lm.foldCollapsed = node.collapsed;