mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Add type selector popup, view root switching, and new type creation
- Type selector chevron [▸] on command row opens searchable popup - Popup lists all root structs with filter, keyboard nav, side-triangle indicator - Selecting a type switches the editor view via setViewRootId - "Create new type" inserts a new root struct with no name - Command row displays the active view root's name - Tests for chevron detection, span compatibility, view switching, undo
This commit is contained in:
12
src/core.h
12
src/core.h
@@ -489,7 +489,7 @@ struct ColumnSpan {
|
||||
|
||||
enum class EditTarget { Name, Type, Value, BaseAddress, Source, ArrayIndex, ArrayCount,
|
||||
ArrayElementType, ArrayElementCount, PointerTarget,
|
||||
RootClassType, RootClassName };
|
||||
RootClassType, RootClassName, TypeSelector };
|
||||
|
||||
// Column layout constants (shared with format.cpp span computation)
|
||||
inline constexpr int kFoldCol = 3; // 3-char fold indicator prefix per line
|
||||
@@ -635,6 +635,16 @@ inline ColumnSpan commandRowRootNameSpan(const QString& lineText) {
|
||||
return {nameStart, nameEnd, true};
|
||||
}
|
||||
|
||||
// ── CommandRow type-selector chevron span ──
|
||||
// Detects "[▸]" at the start of the command row text
|
||||
|
||||
inline ColumnSpan commandRowChevronSpan(const QString& lineText) {
|
||||
if (lineText.size() < 3) return {};
|
||||
if (lineText[0] == '[' && lineText[1] == QChar(0x25B8) && lineText[2] == ']')
|
||||
return {0, 3, true};
|
||||
return {};
|
||||
}
|
||||
|
||||
// ── Array element type/count spans (within type column of array headers) ──
|
||||
// Line format: " int32_t[10] name {"
|
||||
// arrayElemTypeSpan covers "int32_t", arrayElemCountSpan covers "10"
|
||||
|
||||
Reference in New Issue
Block a user