class

Egui::WindowFrame::Windows

Inherits Egui::WindowFrame < Reference < Object

========================================================================== Windows 11 (dark & light, follows ctx.theme)

Constants

BG = Color32.new(32, 32, 32, 255)

Windows 11 dark palette. The hover/press overlays and the window outline are SOLID colors (6.1%/3.8% white over #202020, what DWM composites) — no alpha blending at draw time, so they render identically on every backend path.

BG_LIGHT = Color32.new(214, 214, 214, 255)

Windows 11 light palette (same overlays, black on #D6D6D6). The caption sits DARKER than the theme's panel_fill (#F3F3F3) so the tab cards and the menu bar below read against it — the Win11 Notepad light hierarchy: gray titlebar, lighter content.

BTN_W = 46.0
CAPTION_H = 32.0
CLOSE_HOVER = Color32.new(196, 43, 28, 255)
CLOSE_PRESSED = Color32.new(179, 39, 30, 255)
FG = Color32.new(255, 255, 255, 255)
FG_LIGHT = Color32.new(32, 32, 32, 255)
GLYPH = 10.0
GLYPH_ON_RED = Color32.new(255, 255, 255, 255)

The close hover/press red is shared by both palettes; its glyph stays WHITE over the red (what Win11 does in light mode too).

HOVER_FILL = Color32.new(46, 46, 46, 255)
HOVER_FILL_LIGHT = Color32.new(202, 202, 202, 255)
ICON_GAP = 8.0
ICON_PAD = 10.0
ICON_SIZE = 16.0
PRESSED_FILL = Color32.new(40, 40, 40, 255)
PRESSED_FILL_LIGHT = Color32.new(208, 208, 208, 255)
TITLE_PAD = 16.0
TITLE_PT = 14.0

Instance methods

bg

The theme-picked palette: dark or light, following ctx.theme.

Source
caption_height
Source
content_area(bar : Rect) : Rect | Nil

Caption content (e.g. TitleBarTabs) claims everything LEFT of the three caption buttons — and, with an icon installed, only AFTER the icon slot (tabs follow the icon, Win11 order).

Source
paint_buttons(bar : Rect) : Nil

Interact + paint the caption buttons (Middle layer, z=50, so they win hit-tests over the drag strip at z=0).

Source
paint_caption(bar : Rect) : Nil

The caption background: #202020 grown 1pt past the strip on the TOP and SIDES (so the window outline seam never bleeds through), but EXACT at the bottom — the old 1pt overshoot covered the menu bar's top pixel with a #202020 line that broke the active-tab/menu-bar merge (they share panel_fill).

Source
paint_icon(bar : Rect) : Nil

The app icon (see .icon=): 16×16 at the left edge, centered against the TAB CARDS (TitleBarTabs geometry: below its top gap) when the caption is tall; in a plain caption — in the whole bar.

Source
paint_title(bar : Rect) : Nil
Source