Skip to content

[EDITOR] Draw type dropdown entries as colored type chips - #112

Merged
muit merged 3 commits into
feature/editor-improvementsfrom
feature/type-chips
Oct 22, 2026
Merged

muit merged 3 commits into
feature/editor-improvementsfrom
feature/type-chips

Conversation

@muit

@muit muit commented Oct 22, 2026

Copy link
Copy Markdown
Member

Summary

The type dropdown (variable editor, details panel) now renders its entries like the graph context menu: colored type chips with the type icon, e.g. [I32].

  • Chip drawing moved to the UI library — UI::DrawChip (name over a rounded background of its color, optional icon), UI::DrawChipText and UI::SelectableRow (selectable row that can highlight like a hovered item) now live in UI/Widgets.h. The context menu uses them instead of its private copies.
  • TypeCombo draws chips — every dropdown entry is a chip colored by the type, with the type icon when the type has one.
  • Selectable preview — TypeCombo takes a selectedAsChip flag controlling whether the closed combo also shows the selected type as a chip:
    • Variable editor: chip (true, default)
    • Details panel: plain text (false) because the row is already tinted with the type color

Stacked on #109 (feature/editor-improvements).

Testing

  • cmake --build Build passes
  • ctest --output-on-failure passes

muit added 3 commits October 23, 2026 00:30
Moves the context menu chip helpers into the UI library: DrawChip draws a
name over a rounded background of its color with an optional icon,
DrawChipText draws plain chip text, and SelectableRow draws a selectable
row that can highlight like a hovered item.
The type dropdown in the variable editor and the details panel now draws
its entries as colored chips with the type's icon, matching the graph
context menu. TypeCombo takes whether the selected type in the closed
combo is also drawn as a chip: the variable editor shows it, while the
details panel keeps the plain preview because its row is already colored
by the type.
TypeCombo takes whether types are grouped in Native, Structs and
Classes categories or listed flat and sorted by name. The selected
type chip is now drawn with BeginComboPreview/EndComboPreview, the
supported custom preview path of the current ImGui.
@muit

muit commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Updated:

  • Categories toggle: TypeCombo now takes showCategories (default true). When false, types are listed flat and sorted by name instead of the Native / Structs / Classes trees (search filtering still applies).
  • Preview fix: the selected chip is now drawn with BeginComboPreview() / EndComboPreview() — the supported custom-preview path in the current ImGui version (1.92.9b) — instead of drawing directly over ComboPreviewData.PreviewRect.

Note on the missing chips: I verified the drawing headlessly against the built RiftUILib: a SelectableRow + DrawChip inside a combo popup emits geometry (36 verts, full-width row) and the preview chip emits 24 verts. If the chips are still missing, make sure you are running a build of feature/type-chips — the dropdown changes are not in feature/editor-improvements.

@muit
muit merged commit a596ec8 into feature/editor-improvements Oct 22, 2026
11 checks passed
@muit

muit commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Superseded — these commits were moved into #109 on feature/editor-improvements.

@muit
muit deleted the feature/type-chips branch October 22, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant