Skip to content

Size metrics ​

Chrome sizes live in one module so the title bar, tabs, explorer, dialogs, and status bar cannot drift apart. Every value is in egui points (1 pt = 1 px at 100 % scale).

rust
use egui_workbench::metrics::*;

Heights ​

ConstantValueUsed by
TITLE_HEIGHT34.0Title bar panel
TAB_HEIGHT34.0Tab strip panel and TabStrip
STATUS_HEIGHT24.0Status bar panel
TREE_ROW_HEIGHT21.0Explorer rows
CONTROL_HEIGHT30.0Text fields, dialog buttons, combos, steppers

WorkbenchStyle scales TREE_ROW_HEIGHT, CONTROL_HEIGHT, MENU_ROW_HEIGHT, and LIST_ROW_HEIGHT by the density factor. Title bar, tab strip, and status bar keep their fixed heights; they match native window decorations and hit areas.

Widths and indentation ​

ConstantValueUsed by
TAB_STRIP_PADDING8.0Left inset of the first tab
SIDEBAR_WIDTH260.0Default explorer width
TREE_INDENT12.0Indentation per tree depth
CHEVRON_SIZE14.0Expand/collapse slot
WINDOW_BUTTON_WIDTH44.0Minimize / maximize / close cell
WINDOW_BUTTON_HEIGHT32.0Window control cell

SIDEBAR_MIN_WIDTH (160.0) and CONTENT_MIN_WIDTH (480.0) live in app; the shell shrinks the explorer to keep the content usable and never lets the explorer exceed half the window. RIGHT_PANEL_MIN_WIDTH is 180.0 and BOTTOM_PANEL_MIN_HEIGHT is 72.0.

Buttons and rows ​

ConstantValueUsed by
ACTION_BUTTON28.0Title-bar action buttons
TOOL_BUTTON26.0Tab-strip tool buttons
SMALL_BUTTON21.0Explorer header buttons
MENU_ROW_HEIGHT22.0Context-menu rows
LIST_ROW_HEIGHT26.0Palette and keyboard-menu rows
ICON_SMALL14.0Dense menus, steppers, window buttons
ICON_MEDIUM16.0Title-bar actions, tabs, tree rows
ICON_LARGE20.0Product mark
RESIZE_EDGE4.0Resize band of the undecorated window

Builder sizes ​

components::Size is the control scale:

SizeHeightTextMin widthPadding
Sm24.011.50.08 × 2
Md30.013.088.012 × 4
Lg36.014.0104.016 × 6

IconButtonSize is the square icon scale:

SizeSideGlyphRadius
Action28.016.05
Tool26.018.05
Small21.016.04

Style-derived heights ​

WorkbenchStyle methods return the effective values:

rust
let style = style::get(ctx);
style.control_height();          // scaled 30
style.size_height(Size::Lg);     // scaled 36
style.menu_row_height();         // scaled 22
style.list_row_height();         // scaled 26
style.tree_row_height();         // scaled 21

Why the chrome does not scale ​

Density changes controls and rows, not the title bar, tab strip, or status bar. Those three surfaces align with the operating system's window buttons and with the visual rhythm of the app icon; scaling them independently makes the window controls float or clip. If you need a different chrome scale, fork the panel heights rather than changing metrics at runtime.

Released under MIT OR Apache-2.0. Icons: Lucide (ISC) and Material Icon Theme (MIT).