5#include <portals/ui_construction.hpp>
18 return std::move(description).chrome(modifier.
value);
31 std::optional<PrimitiveGlyphs>
glyphs;
40 requires(std::same_as<T, Border> || std::same_as<T, Gauge> || std::same_as<T, Spinner> ||
41 std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
44 (void)std::move(description).glyphs(*modifier.
glyphs);
48 (void)std::move(description).maxPaintCells(*modifier.
maxPaintCells);
51 return std::move(description);
94 return std::move(description);
101inline GaugeScalarModifier value(
double initial) {
102 return {{.value = initial}};
109 return {{.minimum = bound}};
116 return {{.maximum = bound}};
124 return {{.minimum = minimum, .maximum = maximum}};
131 return {{.preferredWidth = cells}};
176 return std::move(description);
184 return {{.spinnerPreset = value}};
191template <
typename Name>
192 requires std::convertible_to<Name, std::string_view>
200inline SpinnerModifier frames(std::initializer_list<std::string_view> values) {
201 return {{.spinnerFrames = ::portals::detail::spinnerFrames(values)}};
208 return {{.spinnerFrames = std::string(value)}};
215 return {{.spinnerTick = value}};
222 return {{.spinnerDirection = value}};
229 return {{.spinnerAlignment = value}};
236 return {{.spinnerActive = value}};
243 return {{.spinnerReducedMotion = value}};
250 return {{.spinnerLabel = std::move(value)}};
264 return {{.spinnerMaxFrames = value}};
271 return {{.spinnerMaxFrameBytes = value}};
278 return {{.spinnerMaxFrameCells = value}};
290 detail::Access::cold<Spinner>([options = std::move(options), style, policy, resolver = std::move(resolver)](
292 auto effective = detail::controlSpinnerOptions(*context.controlSettings, options);
293 return scene.spinner(parent, std::move(effective), style, policy, resolver);
302template <
typename Name>
303 requires std::convertible_to<Name, std::string_view>
305 return spinner().
preset(std::forward<Name>(name));
315template <
typename Reference>
316 requires std::same_as<std::remove_cvref_t<Reference>,
Ref<Spinner>>
317inline Description<Spinner> spinner(Reference &&reference, SpinnerOptions options = {}, ControlStyle style = {},
319 return spinner(std::move(options), style, policy).reference(std::forward<Reference>(reference));
328inline Description<Gauge> gauge(
double value, GaugeOptions options = {}, ControlStyle style = {},
330 auto description = detail::Access::cold<Gauge>(
331 [value, options, style, policy](ManagedScene &scene, Node<Widget> parent,
detail::MountContext &context) {
332 const auto &settings = *context.controlSettings;
333 const auto effective = detail::controlGaugeOptions(settings, options);
334 const auto effectiveValue = settings.value.value_or(value);
338 return std::expected<Node<Gauge>, ManagedError>(std::unexpected(detail::error(parent, valid.error())));
341 return scene.emplace<Gauge>(parent, effectiveValue, scene.widthPolicy(), effective, style, policy);
356 requires std::same_as<std::remove_cvref_t<R>,
Ref<Gauge>>
357inline Description<Gauge> gauge(R &&reference,
double value, GaugeOptions options = {}, ControlStyle style = {},
359 return gauge(value, options, style, policy).reference(std::forward<R>(reference));
static std::expected< void, TreeError > validate(double value, GaugeOptions options)
constexpr TextValue(const TextValue &other)=default
Copy expression bytes and kind into independent storage.
Single-use owning construction recipe; no mounted widget ownership.
Definition ui_description.hpp:48
Description && preset(SpinnerPreset value) &&
Definition ui_description.hpp:1088
Typed Widget observation; explicit composite specializations reuse their existing weak facades.
Definition ui_ref.hpp:761
PrimitiveGlyphs
One-cell decoration selection under the complete receiving WidthPolicy.
Definition primitives.hpp:20
constexpr SizePolicy DEFAULT_CONTENT_POLICY
Intrinsic content on both axes; explicit policies remain authoritative.
Definition layout.hpp:44
SpinnerDirection
Traversal of the finite owning frame sequence.
Definition spinner.hpp:81
LayoutAlign
Alignment; center assigns floor(free/2) before the child/group.
Definition layout.hpp:172
SpinnerPreset
Original single-row indeterminate animation sequences.
Definition spinner.hpp:16
std::uint64_t SchedulerTime
Monotonic milliseconds; the clock must not move backwards.
Definition scheduler.hpp:18
SpinnerPreset spinnerPreset(std::string_view name) noexcept
Definition spinner.hpp:39
ButtonChrome
Button caption decoration; action routing and identity remain unchanged.
Definition controls.hpp:155
Owning Button decoration pipe stage; shares sparse staging with Description::chrome.
Definition ui_primitives.hpp:10
ButtonChrome value
Owning checked decoration selection.
Definition ui_primitives.hpp:11
friend Description< Button > operator|(Description< Button > &&description, ChromeModifier modifier)
Definition ui_primitives.hpp:17
Owning sparse literals only; never contains IDs, models, handlers or live history.
Definition ui_control_context.hpp:391
std::optional< std::size_t > spinnerMaxFrameCells
Sparse Spinner maxFrameCells setting.
Definition ui_control_context.hpp:471
std::optional< SpinnerPreset > spinnerPreset
Sparse Spinner preset setting.
Definition ui_control_context.hpp:461
std::optional< bool > spinnerReducedMotion
Sparse Spinner reducedMotion setting.
Definition ui_control_context.hpp:467
std::optional< std::int32_t > preferredWidth
Nonnegative Gauge intrinsic width in terminal cells.
Definition ui_control_context.hpp:418
std::optional< double > value
Finite Gauge initial value, checked against its effective range at construction.
Definition ui_control_context.hpp:415
std::optional< std::string > spinnerFrames
Sparse Spinner frames setting.
Definition ui_control_context.hpp:462
std::optional< std::size_t > spinnerMaxFrameBytes
Sparse Spinner maxFrameBytes setting.
Definition ui_control_context.hpp:470
std::optional< double > maximum
Finite Gauge upper bound with a finite positive span.
Definition ui_control_context.hpp:417
std::optional< SchedulerTime > spinnerTick
Sparse Spinner interval setting.
Definition ui_control_context.hpp:463
std::optional< bool > spinnerActive
Sparse Spinner active setting.
Definition ui_control_context.hpp:466
std::optional< TextValue > spinnerLabel
Sparse Spinner label setting.
Definition ui_control_context.hpp:468
std::optional< double > minimum
Finite Gauge lower bound; effective maximum must be greater.
Definition ui_control_context.hpp:416
std::optional< LayoutAlign > spinnerAlignment
Sparse Spinner alignment setting.
Definition ui_control_context.hpp:465
std::optional< std::size_t > spinnerMaxFrames
Sparse Spinner maxFrames setting.
Definition ui_control_context.hpp:469
std::optional< SpinnerDirection > spinnerDirection
Sparse Spinner direction setting.
Definition ui_control_context.hpp:464
Owning Gauge-only scalar pipe stage, checked against the receiving constructor options.
Definition ui_primitives.hpp:70
ControlSettings settings
Owning sparse value/range/preferred-width override.
Definition ui_primitives.hpp:71
friend Description< Gauge > operator|(Description< Gauge > &&description, GaugeScalarModifier modifier)
Definition ui_primitives.hpp:77
Owning native Border/Gauge/scroll decoration pipe stage.
Definition ui_primitives.hpp:30
std::optional< PrimitiveGlyphs > glyphs
Present one-cell decoration mode.
Definition ui_primitives.hpp:31
std::optional< std::size_t > maxPaintCells
Present positive paint-work cap.
Definition ui_primitives.hpp:32
Owning finite Spinner stage; it borrows no widget or scheduler.
Definition ui_primitives.hpp:135
friend Description< Spinner > operator|(Description< Spinner > &&description, SpinnerModifier modifier)
Definition ui_primitives.hpp:142
ControlSettings patch
Sparse checked indicator configuration.
Definition ui_primitives.hpp:136
static Description< T > controlArguments(Description< T > description, ControlSettings arguments)
Retain explicit constructor properties above inherited defaults.
Definition ui_description.hpp:3417
static Description< T > configuredControl(Description< T > description, std::string_view type, bool inherit=true)
Attach a builtin configuration identity to an owning recipe.
Definition ui_description.hpp:3409
Stack-owned transaction bookkeeping, discarded after one description mount.
Definition ui_recipe_context.hpp:554