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

Invisible flexible space along its direct Row/Column parent's main axis. Does not paint, accept input, focus, or schedule work. Other parents are rejected. More...

#include <layout.hpp>

Inheritance diagram for portals::Spacer:
portals::Spacerportals::Spacer portals::Widget

Public Member Functions

 Spacer (std::int32_t weight=1)
std::int32_t weight () const
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

Detailed Description

Invisible flexible space along its direct Row/Column parent's main axis. Does not paint, accept input, focus, or schedule work. Other parents are rejected.

Constructor & Destructor Documentation

◆ Spacer()

portals::Spacer::Spacer ( std::int32_t weight = 1)
inlineexplicit
Parameters
weightPositive main-axis flex weight; invalid values fail checked mount/layout.

Member Function Documentation

◆ weight()

std::int32_t portals::Spacer::weight ( ) const
inline
Returns
Owning positive flex weight, checked before layout.

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