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

Owning catalog input; legacy factories run synchronously once per explicit preview attempt on UI. Legacy factories must not block. The preparedTheme factory explicitly opts into worker preparation; captured input, closure copying and deletion must then be worker-safe. Borrowed captures must outlive their use, including eventual worker return after cancellation. UI captures are never moved implicitly. More...

#include <theme_selection.hpp>

Public Member Functions

template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<StyleSheet, StyleError>>)
 ThemeChoice (std::string_view id, TextValue label, Factory factory, std::optional< TextValue > description={})
template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<StyleSheet, StyleError>>)
 ThemeChoice (std::string_view id, std::string_view label, Factory factory, std::optional< TextValue > description={})
 ~ThemeChoice ()=default
 Retain fallible ordinary copies of the owning catalog input.

Friends

class portals::ManagedScene
struct detail::PreparedThemeAccess

Detailed Description

Owning catalog input; legacy factories run synchronously once per explicit preview attempt on UI. Legacy factories must not block. The preparedTheme factory explicitly opts into worker preparation; captured input, closure copying and deletion must then be worker-safe. Borrowed captures must outlive their use, including eventual worker return after cancellation. UI captures are never moved implicitly.

Constructor & Destructor Documentation

◆ ThemeChoice() [1/2]

template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<StyleSheet, StyleError>>)
portals::ui::ThemeChoice::ThemeChoice ( std::string_view id,
TextValue label,
Factory factory,
std::optional< TextValue > description = {} )
inline
Template Parameters
FactoryCopyable nullary callable returning StyleSheet or exactly expected<StyleSheet,StyleError>.
Parameters
idNonempty unique application ID, copied immediately.
labelOwning literal/resource expression, resolved during setup.
factoryOwning synchronous candidate producer; construction may allocate.
descriptionOptional owning expression resolved during setup.

◆ ThemeChoice() [2/2]

template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<StyleSheet, StyleError>>)
portals::ui::ThemeChoice::ThemeChoice ( std::string_view id,
std::string_view label,
Factory factory,
std::optional< TextValue > description = {} )
inline
Template Parameters
FactorySame synchronous factory contract as the owning-text overload.
Parameters
idApplication ID copied immediately.
labelLiteral bytes copied immediately.
factoryOwning candidate producer.
descriptionOptional owning explanation.

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