DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
EditorTheme.h File Reference

Classes

struct  DekiEditor::PickerItem
 One entry in a SchematicPicker list. More...
struct  DekiEditor::DialogButtonSpec

Namespaces

namespace  DekiEditor
namespace  DekiEditor::Palette
namespace  DekiEditor::Metrics
namespace  DekiEditor::Fonts

Enumerations

enum class  DekiEditor::DialogButton { DekiEditor::Normal , DekiEditor::Primary , DekiEditor::Danger }
 The button row at the foot of a dialog: equal-width buttons across the dialog, text centred, the safe choice first and the action last. More...

Functions

void DekiEditor::SetupEditorTheme (float dpiScale)
 Applies the Deki schematic theme to ImGui.
void DekiEditor::Fonts::RegisterTtf (ImFont *font, const char *ttfPath)
 Records a loaded font's TTF path so CssPx can work out its CSS-to-FreeType size ratio from the font's own metrics.
float DekiEditor::Fonts::CssPx (ImFont *font, float cssPx)
 The ImGui+FreeType size whose em-square matches a CSS font-size.
void DekiEditor::Tooltip (const char *fmt,...) IM_FMTARGS(1)
void DekiEditor::FirstUseWindowPlacement (float width, float height)
 Where a window first appears: width x height, centred over the editor.
void DekiEditor::EmptyStateText (const char *text)
 A panel's "nothing here" line (empty list, search with no result): dim, wrapped, inset like the rows above it rather than against the panel edge.
int DekiEditor::SchematicPicker (const char *id, const char *title, const PickerItem *items, int itemCount, bool justOpened, float listHeight, const char *itemIcon=nullptr, const char *searchHint=nullptr, const char *emptyText=nullptr)
 The editor's search-first picker: two-level browsing (categories, then what is inside one), ranked search across every level at once, full keyboard control, and a slide when you step between levels.
void DekiEditor::BeginPropertyContext ()
 Opens the shared property-list layout: the body indent, row gap and field padding of every property list in the editor.
void DekiEditor::EndPropertyContext ()
bool DekiEditor::SchematicCollapsingHeader (const char *label, ImGuiTreeNodeFlags flags=ImGuiTreeNodeFlags_DefaultOpen)
 Schematic collapsing header for inspector sections, with the label in Space Grotesk (Title Case as typed).
bool DekiEditor::SchematicSectionBegin (const char *label, ImGuiTreeNodeFlags flags=ImGuiTreeNodeFlags_DefaultOpen, ImGuiID *outHeaderId=nullptr)
 The same band as SchematicCollapsingHeader, with the body SLIDING open and shut instead of appearing and vanishing.
void DekiEditor::SchematicSectionEnd ()
bool DekiEditor::SchematicTreeBodyBegin (bool open, ImGuiID nodeId)
 The children of a tree node, sliding open and shut like a section body.
void DekiEditor::SchematicTreeBodyEnd ()
bool DekiEditor::SchematicSectionBand (const char *label, float *outLabelX=nullptr)
 The same band without the fold: same height, full bleed and uppercase letter-spaced label as SchematicCollapsingHeader, with no chevron and no collapsing.
bool DekiEditor::SchematicBandTitleField (const char *id, char *buf, int bufSize, float x, float bandTop, float bandBottom, float width, const char *hint)
 An inline rename field drawn AS a band title: no frame, background or padding, in the band's own font, size and color, centered on the band's line.
void DekiEditor::SchematicSubHeader (const char *label)
 One rung below both of those: a DEKI_GROUP-style subdivision INSIDE a section.
bool DekiEditor::SchematicAddButton (const char *label, float width=0.0f)
 The "add one more" button at the end of a list (Add Component, Add Transition): a centered outlined box (transparent fill, hairline border, dim label) that takes the accent only on hover.
void DekiEditor::DrawTreeNodeChevronLabel (bool open, bool expandable, const char *label, ImU32 labelColor)
 Draws a tree node's expand chevron (Tabler chevron, down=open / right=closed) and its label, in place of ImGui's filled triangle.
void DekiEditor::FullBleedSeparator ()
 Like ImGui::Separator(), but the hairline spans the full panel width, past the indent on the left and past the scrollbar on the right, so it touches both dock seams.
bool DekiEditor::PanelToolbar (bool *pinned=nullptr)
 The toolbar under a panel's tab: a full-width strip with a PIN (lock-to-selection) toggle on the left, a "..." menu on the right and a hairline below.
void DekiEditor::SearchField (const char *id, char *buf, size_t bufSize, float rightReserve=0.0f, bool bottomBorder=false, float *outSlotX=nullptr, float *outSlotY=nullptr, float *outSlotW=nullptr, float *outSlotH=nullptr, const char *hint="Search")
 Search field in the style of the Hierarchy and Asset Browser: a dim magnifier, then a borderless transparent input, vertically centered in a full-width band of its own.
bool DekiEditor::SchematicToolbarCombo (const char *id, int *currentIndex, const char *items, float height, bool leftDivider=false)
 Flat dropdown matching the panel toolbar's cells: a transparent, square, borderless box with a faint white hover, height px tall, the value and chevron centered.
bool DekiEditor::SchematicBeginToolbarCombo (const char *id, const char *preview, float height, bool leftDivider=false)
 The same toolbar dropdown with rows of your own (sections, separators, items that do more than pick an index): Begin draws the box and returns true while the list is open; draw ImGui::Selectable rows, then call SchematicEndToolbarCombo(), only when Begin returned true.
void DekiEditor::SchematicEndToolbarCombo ()
float DekiEditor::SchematicToolbarComboWidth (const char *preview)
bool DekiEditor::SchematicActionLink (const char *label)
 Right-aligned EDIT -> style action link, in ALL CAPS mono accent text with a 1px underline.
bool DekiEditor::SchematicDragFloat (const char *id, float *v, float vSpeed=1.0f, float vMin=0.0f, float vMax=0.0f, const char *format="%.3f")
 Drag widgets with LEFT-aligned value text (ImGui centers it).
bool DekiEditor::SchematicDragInt (const char *id, int *v, float vSpeed=1.0f, int vMin=0, int vMax=0, const char *format="%d")
bool DekiEditor::SchematicDragFloat2 (const char *id, float v[2], float vSpeed=1.0f, float vMin=0.0f, float vMax=0.0f, const char *format="%.3f")
 Drag widgets with several components sharing the rest of the row.
bool DekiEditor::SchematicDragFloat3 (const char *id, float v[3], float vSpeed=1.0f, float vMin=0.0f, float vMax=0.0f, const char *format="%.3f")
bool DekiEditor::SchematicDragFloatAxis (const char *id, float *v, int axis, float vSpeed=1.0f, float vMin=0.0f, float vMax=0.0f, const char *format="%.3f")
 One box of those, with its axis stamp (0 = X, 1 = Y, 2 = Z), as an item of its own: for a caller that needs each box's activation, or a different format per box (a dash for values that differ across a selection).
bool DekiEditor::SchematicColorEdit4 (const char *id, float col[4])
 Schematic color editors, with the semantics of ImGui::ColorEdit4 / ColorEdit3 (rgba / rgb as 0-1 floats).
bool DekiEditor::SchematicColorEdit3 (const char *id, float col[3])
bool DekiEditor::SchematicCombo (const char *id, int *currentIndex, const char *const items[], int count)
 Dropdown matching the drag fields: near-black frame, the current item left-aligned in the mono value font, a Tabler chevron on the right.
bool DekiEditor::SchematicCombo (const char *id, int *currentIndex, const char *itemsSeparatedByZeros)
bool DekiEditor::SchematicBeginCombo (const char *id, const char *preview)
 Open/close for custom dropdowns whose items are not a fixed string array (dynamic lists, custom preview text), with SchematicCombo's look.
void DekiEditor::SchematicEndCombo ()
void DekiEditor::DrawAllTabTopAccents ()
 Draws a 1px accent line along the top of the selected tab in every dock node with a tab bar.
void DekiEditor::DrawDockSeams ()
 Draws the 1px frame of standalone floating windows (dialogs, undocked tool windows).
bool DekiEditor::SchematicCheckbox (const char *label, bool *v)
 Schematic checkbox: a 1px square border with a smaller filled square inside when checked.
bool DekiEditor::SchematicCheckbox (const char *label, bool *v, const ImVec4 &fillColor)
void DekiEditor::PushContextMenuPopupStyle ()
 Styling for right-click context menus.
void DekiEditor::PushContextMenuItemStyle ()
bool DekiEditor::BeginSchematicModal (const char *title, float cssWidth)
 Schematic modal dialog: centered over the main viewport, a fixed CSS-px width (auto height), generous padding, no saved settings.
void DekiEditor::EndSchematicModal ()
int DekiEditor::SchematicDialogButtons (std::initializer_list< DialogButtonSpec > buttons)

Variables

constexpr ImVec4 DekiEditor::Palette::Bg = ImVec4(0.039f, 0.043f, 0.051f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Bg2 = ImVec4(0.063f, 0.067f, 0.075f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Bg3 = ImVec4(0.051f, 0.055f, 0.063f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Panel = ImVec4(0.047f, 0.051f, 0.063f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Line = ImVec4(0.114f, 0.122f, 0.137f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Line2 = ImVec4(0.149f, 0.157f, 0.176f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Line3 = ImVec4(0.200f, 0.212f, 0.235f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Fg = ImVec4(0.910f, 0.902f, 0.882f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Dim = ImVec4(0.478f, 0.478f, 0.463f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Dim2 = ImVec4(0.322f, 0.322f, 0.310f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Accent = ImVec4(0.230f, 0.764f, 1.000f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::AccentDim = ImVec4(0.230f, 0.764f, 1.000f, 0.40f)
constexpr ImVec4 DekiEditor::Palette::FolderIcon = ImVec4(0.141f, 0.561f, 0.800f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Agent = ImVec4(0.706f, 0.549f, 1.000f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Red = ImVec4(0.910f, 0.420f, 0.310f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Amber = ImVec4(0.870f, 0.690f, 0.310f, 1.0f)
constexpr ImVec4 DekiEditor::Palette::Green = ImVec4(0.451f, 0.831f, 0.451f, 1.0f)
constexpr float DekiEditor::Metrics::kInspectorIndent = 18.0f
constexpr float DekiEditor::Metrics::kSectionHeaderOutdent = 10.0f
constexpr float DekiEditor::Metrics::kSectionHeaderMargin = 8.0f
constexpr float DekiEditor::Metrics::kSectionLabelIndent = 22.0f
constexpr float DekiEditor::Metrics::kInspectorRightPad = 14.0f
constexpr float DekiEditor::Metrics::kRowSpacing = 12.0f
constexpr float DekiEditor::Metrics::kFieldPadding = 8.0f
constexpr float DekiEditor::Metrics::kPreviewMaxHeight = 200.0f
ImFont * DekiEditor::g_FontUI
ImFont * DekiEditor::g_FontUISmall
ImFont * DekiEditor::g_FontUIMed
ImFont * DekiEditor::g_FontUIBold
ImFont * DekiEditor::g_FontMono
ImFont * DekiEditor::g_FontMonoSmall
ImFont * DekiEditor::g_FontMonoBold
ImFont * DekiEditor::g_FontDisplay
ImFont * DekiEditor::g_FontDisplaySmall
ImFont * DekiEditor::g_FontLogo
constexpr float DekiEditor::kTooltipDelaySeconds = 1.0f
 Every tooltip in the editor goes through here.