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:
batallion2
2026-02-09 12:21:03 -07:00
committed by sysadmin
parent 0e65b9997e
commit f4149faa9a
15 changed files with 1611 additions and 291 deletions

View File

@@ -54,18 +54,16 @@ private slots:
QString result = rcx::renderCpp(tree, rootId);
// Header
QVERIFY(result.contains("Generated by ReclassX"));
QVERIFY(result.contains("#pragma once"));
QVERIFY(result.contains("#include <cstdint>"));
QVERIFY(!result.contains("#include <cstdint>"));
QVERIFY(!result.contains("#pragma pack"));
// Struct definition
QVERIFY(result.contains("#pragma pack(push, 1)"));
QVERIFY(result.contains("struct Player {"));
QVERIFY(result.contains("int32_t health;"));
QVERIFY(result.contains("float speed;"));
QVERIFY(result.contains("uint64_t id;"));
QVERIFY(result.contains("};"));
QVERIFY(result.contains("#pragma pack(pop)"));
// static_assert - struct is 16 bytes (0+4 + 4+4 + 8+8 = 16)
QVERIFY(result.contains("static_assert(sizeof(Player) == 0x10"));
@@ -485,7 +483,6 @@ private slots:
QString result = rcx::renderCppAll(tree);
QVERIFY(result.contains("Full SDK export"));
QVERIFY(result.contains("struct StructA {"));
QVERIFY(result.contains("struct StructB {"));
QVERIFY(result.contains("uint32_t valueA;"));