egui-macview
A Deterministic macOS AppKit Layout Engine, Authentic Control Primitive Suite, and CoreAnimation Physics Runtime for egui.
Overview
egui-macview brings native macOS AppKit precision, mathematical layout determinism, and CoreAnimation physics to the egui ecosystem.
While standard egui relies on content-driven streaming flow (where widgets automatically calculate margins and push the cursor), egui-macview introduces formal NIB-style retained layout bounds and explicit control framing.
For the normative specification suite, mathematical coordinate transformations, MVC datamodel, and iterative implementation roadmap, see the egui-macview Specification Suite.
Core Capabilities
- Deterministic Layout Engines (
MacFixedView,MacFlexView,MacRow,MacSplitView,MacScrollView,MacStackView):- Zero-margin framing guaranteeing mathematically proven zero-clipping layouts.
- Exact token-driven compact inputs (
metrics.control.text_field.compact_infobox.height), tool buttons (metrics.toolbar.hit_target_min), and hairline dividers (metrics.split_view.divider_thickness). MacSplitView: Authentic AppKitNSSplitViewdivider with hairline rendering, drag interactions, and min/max constraints (metrics.split_view.*).MacRow: Auto-budgeting horizontal cell layout with analytical $O(n)$ space distribution.MacScrollView: Floating overlay scrollbars with zero-gutter reservation and automatic fade timer (metrics.layout.scroll_view.*).MacStackView: Auto-layout linear stacking container with token-governed spacing and section separators (metrics.layout.stack_view.*).
- Authentic macOS Controls:
MacInputCell: Compact input (NSTextFieldequivalent) with FSM cyclic tab-chain, external focus ring, and transactional buffer commit on enter/blur.MacButtonCell: Native template image tinting using Apple accent and secondary colors (NSButton).MacSegmentedControl: Apple segmented pill with animated slide indicators (NSSegmentedControl).MacToggle: Native macOS toggle switch with token-driven dimensions and system green fill (NSSwitch).MacSlider: Native continuous tracking slider with tick marks and token-driven metrics (NSSlider).MacThumbnailCell: Generic preview canvas cell (metrics.control.thumbnail.size) with consumer-provided rendering callback (NSImageCell).MacOutlineView: Hierarchical tree with disclosure chevrons, indentation steps, and customizable accessory slots (NSOutlineView).MacPopUpButton: Trailing double chevrons with dropdown selection overlay (NSPopUpButton).MacSearchField: Leading vector magnifying glass, trailing clear button, and focus retention (NSSearchField).MacStepper: Discrete up/down scalar incrementing with float epsilon wrapping protection (NSStepper).MacColorWell: Color swatch preview with translucent alpha checkerboard underlay (NSColorWell).
- CoreAnimation Physics (
CASpring):- Closed-form analytical solution of the damped harmonic oscillator.
- Exact support for Apple's perceptual spring model (
responseanddampingRatiotokens frommacview.motion.spring.default). - Frame-rate independent: identical micro-second motion across 60Hz, 120Hz ProMotion, and 144Hz displays.
Interactive Showcase Gallery
To run the interactive desktop gallery demonstrating the complete macOS AppKit suite on Windows 11:
Gallery Features:
- Dynamic Theme Toggle: Real-time switching between Aqua (Light) and DarkAqua (Dark) appearances.
- MacSplitView Layout: Dual hairline draggable splitters dividing Left Sidebar, Center Canvas, and Right Inspector with min/max constraint protection.
- Left Sidebar (MacOutlineView): Hierarchical outline tree with disclosure chevrons,
MacThumbnailCellvector drawings, andaccessory_customtoggle buttons. - Center Canvas (MacScrollView & CASpring):
MacSearchFieldfilter bar, floating overlay scrollbars with zero gutter inflation,MacFixedViewexact point positioning,MacRowauto-budgeted layout, andMacPopoverpowered by analytical damped harmonic oscillator physics. - Right Inspector (MacStackView): Collapsible sections demonstrating
MacInputCell(cyclic Tab-chain FSM and focus rings),MacSlider(continuous tracking with tick marks),MacStepper,MacPopUpButton,MacSegmentedControl,MacToggle, andMacColorWellwith alpha checkerboard underlays.
Getting Started
use ;
use ;