Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::Dialog Class Reference

Full-host structural root containing at most one visible opaque panel. This is deliberately not a SizedWidget: panel limits never narrow the structural root. Layout is pure; input confinement, registration, anchors and title/body composition belong to the managed owner. No observer, callback, model or tree reference is retained here. More...

#include <dialog.hpp>

Inheritance diagram for portals::Dialog:
portals::Dialogportals::Dialog portals::Widget portals::Layout

Public Member Functions

 Dialog (DialogOptions options={})
DialogOptions options () const
std::expected< CellSize, TreeError > childAvailable (CellSize available) const override
std::expected< CellSize, TreeError > measureChildren (std::span< const MeasuredChild > children) const override
std::expected< std::vector< CellRect >, TreeError > arrangeChildren (std::span< const MeasuredChild > children, CellSize available) const override
Public Member Functions inherited from portals::Widget
virtual ~Widget ()=default
 Destroy on UI after the last active tree borrow.
virtual void mount ()
 Called exactly once after attachment; exceptions are reported.
virtual void unmount ()
 Called once before destruction, children first; cleanup continues on exceptions.
virtual std::expected< CellSize, TreeError > measure (CellSize available)
 Default desired size is empty.
virtual std::expected< void, TreeError > arrange (CellRect local)
 Default accepts the owning rectangle.
virtual std::expected< void, TreeError > paint (PaintContext &context)
 Default emits no commands.
virtual ComputedStyle styleDefaults () const
 Read manual presentation defaults during style staging on UI.
virtual bool styleReadOnly () const noexcept
 Read actual view-only state during style staging; false by default.
const std::shared_ptr< const StyleSnapshot > & computedStyle () const noexcept
 Inspect the last atomically installed theme inside tree.read/frame.
std::uint64_t styleRevision () const noexcept
Public Member Functions inherited from portals::Layout
virtual ~Layout ()=default
 Destroy with the implementing widget.
virtual std::expected< CellRect, TreeError > childClip (CellSize available) const
 Clip descendants within this container without changing allocation.
virtual std::expected< LayoutChildPolicy, TreeError > childLayoutFor (NodeId child, CellSize available) const
 Describe one child's clip and reveal policy after arrangeChildren.

Static Public Member Functions

static std::expected< void, TreeError > validate (DialogOptions options)

Friends

struct detail::DialogAccess

Detailed Description

Full-host structural root containing at most one visible opaque panel. This is deliberately not a SizedWidget: panel limits never narrow the structural root. Layout is pure; input confinement, registration, anchors and title/body composition belong to the managed owner. No observer, callback, model or tree reference is retained here.

Constructor & Destructor Documentation

◆ Dialog()

portals::Dialog::Dialog ( DialogOptions options = {})
explicit
Parameters
optionsOwning panel and input settings; pure layout validates them before use.

Member Function Documentation

◆ arrangeChildren()

std::expected< std::vector< CellRect >, TreeError > portals::Dialog::arrangeChildren ( std::span< const MeasuredChild > children,
CellSize available ) const
overridevirtual
Parameters
childrenZero or one visible panel with its intrinsic measurement and policies.
availableFull host allocation; only the panel is capped and centered.
Returns
Owning panel rectangle, or validation, geometry or allocation error.

Implements portals::Layout.

◆ childAvailable()

std::expected< CellSize, TreeError > portals::Dialog::childAvailable ( CellSize available) const
overridevirtual
Parameters
availableFull offered host extent in cells.
Returns
Usable panel measurement bounds, or INVALID_ARGUMENT for invalid settings.

Implements portals::Layout.

◆ measureChildren()

std::expected< CellSize, TreeError > portals::Dialog::measureChildren ( std::span< const MeasuredChild > children) const
overridevirtual
Parameters
childrenZero or one visible panel measurement, borrowed only for this call.
Returns
Panel intrinsic extent capped by options, or INVALID_ARGUMENT for invalid structure/settings.

Implements portals::Layout.

◆ options()

DialogOptions portals::Dialog::options ( ) const
Returns
Owning copy of the complete dialog settings.

◆ validate()

std::expected< void, TreeError > portals::Dialog::validate ( DialogOptions options)
static
Parameters
optionsOwning settings, checked without mutation or allocation.
Returns
Success, or INVALID_ARGUMENT for invalid enums, extents, margins, gap or frame settings.

The documentation for this class was generated from the following file: