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

Owning validated switch decorations, independent of any widget or scene. More...

#include <controls.hpp>

Public Member Functions

WidthPolicy policy () const

Static Public Member Functions

static std::expected< SwitchChrome, TreeError > from (std::string_view off, std::string_view on, WidthPolicy policy={})
 Validate same-width single-line off/on decorations under the receiving policy.

Friends

class Switch

Detailed Description

Owning validated switch decorations, independent of any widget or scene.

Member Function Documentation

◆ from()

std::expected< SwitchChrome, TreeError > portals::SwitchChrome::from ( std::string_view off,
std::string_view on,
WidthPolicy policy = {} )
static

Validate same-width single-line off/on decorations under the receiving policy.

Parameters
offOff bytes copied during this call.
onOn bytes copied during this call.
policyComplete receiving width policy.
Returns
Owning pair or INVALID_ARGUMENT; allocation before/inside construction may throw.

◆ policy()

WidthPolicy portals::SwitchChrome::policy ( ) const
inline
Returns
Complete receiving policy.

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