Skip to main content

Module nxwin

Module nxwin 

Source
Expand description

NeXTSTEP window chrome for in-app floating windows (spec §3, §4.3, §5).

NxWindow wraps an [egui::Window] that has no egui title bar or frame, and paints the NeXT chrome itself: a 1 px black border, a 23 px title bar (black when key, dark gray otherwise), a beveled close box, a bottom resize bar split into thirds, and a light-gray body. Every piece is a painter shape; the only glyphs are the title text.

The key window is the most recently clicked NxWindow, tracked in egui memory; see is_key. Closing the key window hands the key to the next window shown.

Structs§

Layout 🔒
Where each piece of chrome sits inside a window’s outer rect.
NxWindow
A floating window with NeXTSTEP chrome. Build with NxWindow::new, configure, then call NxWindow::show every frame.

Constants§

BORDER 🔒
CLOSE_INSET 🔒
CLOSE_SIZE 🔒
DEFAULT_RECT 🔒
MIN_SIZE 🔒
RESIZE_HEIGHT 🔒
TITLE_HEIGHT 🔒

Functions§

bevel 🔒
Paint a NeXT raised bevel over r: light-gray face, white top-left edge, dark gray then black bottom-right edge (spec §1).
is_key
Is the window with this id the key window (the most recently clicked NxWindow)? The id is NxWindow::id.
key_slot 🔒
Memory slot holding the [Id] of the key window.
layout 🔒
make_key
Make the window with this id the key window, as a click on it would.
rect_slot 🔒
Memory slot holding a window’s outer rect between frames.
stored_rect
The outer rect the window with this id (NxWindow::id) ended its last NxWindow::show with: drags, resizes and clamps applied. None before it is first shown.
title_colors
Title bar fill and text colors: black with white text for the key window, dark gray with light-gray text otherwise (spec §1).