Skip to content

Window API

Declared by <huxerui/window.h>.

  • WindowContentMode: SafeArea, EdgeToEdge.
  • WindowChromeMode: System, Custom.
  • WindowCommand: Minimize, Maximize, Restore, ToggleMaximize, Close.
  • SystemBarContentBrightness: Automatic, Light, Dark.
  • WindowOptions: title, initial size, content mode, chrome mode, preferred title-bar height, and caption labels.
  • WindowCaptionLabels: localized minimize, toggle-maximize, and close labels.
  • WindowMetrics: logical viewport, remaining safe-area insets, and optional title-bar metrics.
  • WindowTitleBarMetrics: height, resolved left/right control reservations, and maximized state.
  • SystemBarsAppearance: status/navigation backgrounds and content brightness; Default() and Descriptor().
  • SafeAreaPadding: per-edge booleans and Descriptor(); selected edges consume only unconsumed ancestor insets.
  • WindowDragRegion: marker descriptor for draggable custom-chrome content.

WindowTitleBar is a variadic/collection Layout that applies drag-region and centered cross-axis behavior while reserving standard controls. UseWindow() -> WindowHandle; handle methods are Minimize, Maximize, Restore, ToggleMaximize, and Close.

WindowOptions is read when the platform shell creates its window. WindowMetrics is adapter-owned observable geometry expressed in logical units. SafeAreaPadding consumes only selected insets not already consumed by an ancestor, so nested safe-area containers do not double-pad content.

WindowContentMode::SafeArea asks the root to stay within platform insets; EdgeToEdge allows drawing behind system UI. WindowChromeMode::Custom requires application title-bar content and is meaningful on desktop backends that support custom chrome. Window commands are requests: embedded hosts and platforms without the corresponding operation may ignore them.