class

Egui::Inspector

Inherits Reference < Object

Constants

CLOSE_W = 26.0
COLOR_POP = "inspector_color"
DOCK_MENU = "inspector_dock"
EXPORT_POP = "inspector_export"
EXPORT_W = 150.0
HIGHLIGHT_COLOR = Color32.rgb(255, 149, 0)
HIGHLIGHT_Z = 60

The orange selection outline. It rides a layer ABOVE app windows (z=50) so a selected widget is clearly marked, but BELOW the inspector panel (z=98), popups/modals (99) and tooltips (100) — the outline must never paint over the very tools that edit the widget (the panel itself, the color picker, the export modal).

INSPECTOR_LAYER = LayerId.new(Order::Middle, Id.from("inspector_panel"), z: 98)

The inspector panel rides its own layer ABOVE app windows (z=98 vs Middle/windows z=50) — a debug tool must never be covered — but under its own popups (Foreground z=99: pick menu, color picker, export modal) and tooltips (z=100). Order::Middle keeps modals able to block it (the export modal dims the panel below itself like any other content).

LABEL_W = 130.0
MARK_W = 22.0

Property table geometry: fixed columns keep every row aligned — the override marker, the property name, then the editor cells.

MENU_W = 26.0
PANEL_H = 190.0
PANEL_W = 422.0

Default width of the right column (the bottom strip is PANEL_H): wide enough for the header's action cluster (tabs + Export + ⚙ + ✕ + gaps) even after the panel padding. Exact budget: interior = PANEL_W − 2×10 window padding; the header needs 2×TAB_W + 2 tab gaps + EXPORT_W + MENU_W + CLOSE_W + 3 cluster gaps (+8 item spacing each) = 402 → 422 leaves the spacer's gap non-negative (at 420 the ✕ cell was clamped 26→24 and its glyph spilled).

PANEL_W_SAVE = 530.0

The width with a live .ecss session: the header adds the «Сохранить» button (SAVE_W + its item-spacing gap) before Export.

PICK_MENU = "inspector_pick"
ROW_H = 20.0
SAVE_W = 100.0
TAB_CLASS = "inspector.tab"

The StyleSheet class of the panel's own header tab cells — they are paint-in-place (see TabPart below), and the class keeps them restylable like any app widget: ctx.stylesheet.rule("inspector.tab", …).

TAB_H = 26.0
TAB_W = 80.0

Header geometry: equal-width tab cells (the "Class"/"Element" pair reads as one control) and the right-pinned action cluster.

Constructors

new(ctx : Context)
Source

Instance methods

after_update

After app.update — called from Context#end_frame once ALL app content has rendered, including the DEFERRED central panel (a widget's context menu attached there opens its popup only at that point, so the pick decision below must run after it): open the pick menu only when NO popup answered the press — a widget with its own context menu gets the «Inspect …» row appended as that menu's last item instead (see #render_menu_tail). Then the overlays that must paint above everything.

Source
before_update

Before app.update: the panel must bite #available_rect first to hug its screen edge (right column or bottom strip), before the app's own panels take their share.

Source
begin_frame
Source
class_sel

The "Class" tab's selected class. Linked to the Element tab: switching to Class jumps to the LAST SELECTED element's class (see #class_sel=), so "pick the element → edit its class" is one motion, not a manual hunt through the class combo.

Source
class_sel=(class_sel : String | Nil)

The "Class" tab's selected class. Linked to the Element tab: switching to Class jumps to the LAST SELECTED element's class (see #class_sel=), so "pick the element → edit its class" is one motion, not a manual hunt through the class combo.

Source
dock
Source
dock=(dock : Symbol)
Source
export_class_snippet

The "Class" export: the class's own base rule plus every state overlay, as StyleSheet#rule calls ready to paste into the app.

Source
export_element_snippet

The "Element" export: the per-id overrides as the exact Context#set_id_style calls that reproduce them — base keys first, then each state overlay. Widgets with an explicit id export the stable Id.from("…") form; auto ids export the raw value plus a hint to assign an explicit id in code.

Source
export_open=(export_open : Bool)
Source
export_open?
Source
export_text
Source
export_text=(export_text : String)
Source
inspect_widget(id : Id) : Nil

Select id AND show the panel — the pick menu's action. Picking a widget with the panel hidden must reveal it, not just set the selection (F12 is not the only way back).

Source
meta_for(id : Id) : WidgetMeta | Nil
Source
meta_values

Every meta recorded this frame (specs / introspection).

Source
open=(flag : Bool) : Bool

Panel visibility (F12 flips it). The backend's inspector: :hidden starts closed — enabled but invoked on demand. Closing the panel also drops the selection: the orange outline belongs to the tool, it must not outlive the tool being on screen.

Source
open?
Source
open_export

Build the snippet for the ACTIVE tab and open the modal.

Source
record_meta(id : Id, widget : Widget | Nil) : Nil

Record (id → widget) while the frame runs; only called when the inspector is enabled, so the off case costs one branch.

Source
render_menu_tail(ui : Ui, id : Id) : Nil

The «Inspect …» row appended to a widget's OWN context menu — the one-menu rule: a widget never gets two context menus, so while the inspector is enabled its entry rides along as the LAST item of whatever menu the widget already opens (Response#context_menu) instead of opening a second popup beside it. The standalone pick menu below only exists for widgets WITHOUT a menu of their own.

Source
selected
Source
selected=(id : Id | Nil) : Id | Nil
Source
tab=(tab : Symbol)
Source

Nested types