Widget with owning policies, changed only through setSizePolicy on UI.
More...
#include <layout.hpp >
portals::SizedWidget portals::SizedWidget
SizedWidget (SizePolicy policy={})
Own the supplied policies; checked by layout.
SizePolicy sizePolicy () const override
Copy current policy without borrowing storage.
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
virtual ~LayoutItem ()=default
Destroy with the implementing widget.
std::expected< void, TreeError > setSizePolicy (WidgetTree &tree, Node < SizedWidget > node, SizePolicy policy)
Validate and edit policies between frames on the tree's UI owner; tree errors propagate. Changed policies invalidate layout; equal policies preserve geometry. The installed style minimum is a hard bound and a conflicting maximum rejects the update without changing the previous policy.
Widget with owning policies, changed only through setSizePolicy on UI.
◆ SizedWidget()
portals::SizedWidget::SizedWidget
(
SizePolicy policy = {} )
explicit
Own the supplied policies; checked by layout.
Parameters
policy Owning width/height constraints; layout validates them before placement.
◆ sizePolicy()
SizePolicy portals::SizedWidget::sizePolicy
(
)
const
override virtual
Copy current policy without borrowing storage.
Returns A value copy of the current width/height constraints; obtain it only inside tree.read.
Implements portals::LayoutItem .
◆ setSizePolicy
Validate and edit policies between frames on the tree's UI owner; tree errors propagate. Changed policies invalidate layout; equal policies preserve geometry. The installed style minimum is a hard bound and a conflicting maximum rejects the update without changing the previous policy.
Parameters
tree Owning UI tree, borrowed for this call.
node Checked observer of the SizedWidget to update.
policy Replacement width/height constraints; invalid values are rejected before mutation.
Returns Success after requesting layout, or the validation/access/invalidation error.
The documentation for this class was generated from the following file: