Repository navigation
[EDITOR] Context menu improvements and type chips - #109
Conversation
Entries are cached before rendering, so filtering and scoring run as a fast previous step over the cached entries. Search results are ranked by match quality, and searches are standardized: names are matched lowercase and without separators, so "Print Line" finds "PrintLine", "print_line" or "print-line". Words of a term must all match but can appear in any order. - Categories with no children are not drawn - Categories draw open by default
The first item of the menu is selected by default and follows the filtered results. Up and down move the selection while the search input keeps the keyboard, so the search can keep being refined. Enter applies the selected item from a single place, which also fixes the first item being spawned alongside the selected one.
The selected row draws as if hovered (or active while pressed) with ImGuiSelectableFlags_Highlight, using a clearly brighter version of its own color for colored rows. Nav focus rectangles are hidden, including the one around the search bar.
The view follows the selection only when it moves or the results change, so manual scrolling is left alone. The scroll rect leaves a one-line margin so the next items stay slightly visible, and holding shift moves the selection five items at a time.
17ddd26 to
afecb89
Compare
# Conflicts: # Libs/Editor/Src/Utils/FunctionGraphContextMenu.cpp
|
Type dropdown polish:
Note: these type-chip commits are now on |
|
More editor polish:
|
|
Chips are now real (non-interactive) items:
|
|
Type combo fills its space again: the closed combo keeps the full available width (the callers' stretch width) instead of shrinking to the selected chip; only long names are ellipsized inside the frame. The dropdown keeps its content-based auto-fit. |
|
Type combos all use chips now: the details panel combo no longer opts out — every |
DrawChip paints a name over a rounded background of its color with an optional icon and ellipsizes it to fit a maximum width. Chip places one as a non-interactive item, so it takes layout space but has no id, and SelectableRow draws a selectable row that can highlight like a hovered item.
Type combo entries and the selected value are drawn as colored type chips with the type icon, using the UI chip widgets. Entries report their size to the layout so the dropdown grows to fit them, the closed combo fills its column and ellipsizes long names, and types are listed flat by default with an option to group them by category.
The variable editor gives types a wider column, and double clicking a function opens its file, selects its node and centers the graph on it.
51766f9 to
64454b7
Compare
|
History reorganized (9 commits total, was 16): Context menu:
Type chips: The merge of |
Chip takes ChipFlags: Background paints the colored chip, None draws flat text. It is a non-interactive item, so containers grow with it. The separate DrawChip, DrawChipText and CalcChipWidth helpers are gone.
TypeCombo takes TypeComboFlags to draw the selected type as a chip and to group types by category. One type list is filtered per category with the pipe ECS helpers, and entries and the selected value are chip items, so the dropdown grows with them. GetTypeIcon takes a scope.
Double clicking a call or picking Show function in its context menu opens the type that owns the function and selects it there once drawn, or selects and centers it when it belongs to the open type. The elements panel double click no longer reopens its own type.
The drag moved nodes by indexing a selection that can change mid drag, reading past the snapshot of origins and moving nodes that were never dragged. The snapshot now holds the node ids with their origins.
Entry labels and keywords are views into interned names instead of copies, and the search is parsed only when its text changes. Matching and scoring ignore case and match through separators in place, so no lowercased copies are needed, and the cached keyword array stays inline. Operator entries are created through a shared helper, and their label is formatted when drawn.
126a34c to
3264500
Compare
Summary
Reworks the graph context menu around a cache -> filter/score -> render pipeline, as a base for further editor improvements, along with visual and navigation improvements.