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 callNxWindow::showevery 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 isNxWindow::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 lastNxWindow::showwith: drags, resizes and clamps applied.Nonebefore 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).