载入中...
搜索中...
未找到
UiThemeEditor.cpp
浏览该文件的文档.
12ui_editing::Result<T> editorError(ui_editing::EditorStatus status, std::string rule, std::string message) {
30ui_editing::Result<void> UiThemeEditor::configureWorkspace(editor::EditorWorkspace& workspace) const {
82 return editorError(begun.code(), "editor.ui-theme.begin", "Could not begin the theme transaction");
98 return editorError(preview_.status, "editor.ui-theme.preview", "Could not rebuild the theme preview");
109ui_editing::Result<void> UiThemeEditor::createFromPreset(std::string id, std::string name, std::string preset) {
113 auto created = commit(target_.makeCreateFromPreset(ui_editing::ObjectId(id), name, presetFromName(preset)),
122 commit(target_.makeDuplicate(ui_editing::ObjectId(selectedId_), ui_editing::ObjectId(id), std::move(name)),
138 auto activated = commit(target_.makeSetActive(ui_editing::ObjectId(selectedId_)), "Activate theme");
162 if (!previewed.ok()) return ui_editing::Result<editor::TransactionReceipt>::failure(previewed.status());
170 if (!previewed.ok()) return ui_editing::Result<editor::TransactionReceipt>::failure(previewed.status());
178 if (preview_.status != ui_editing::EditorStatus::Applied || preview_.documentRevision != target_.revision()) {
UI-neutral named Theme catalog editor: workspace, gallery preview, undo.
void ignore(std::string_view reason={}) const noexcept
Explicitly discard this result after documenting the reason.
Definition Result.h:537
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Dotted property path (layout.size) compared and persisted as text.
Definition EditingIds.h:78
Deterministic owning value tree shared by authoring hosts.
Definition EditingValue.h:19
Composition model shared by project-specific developer and runtime editors.
Definition EditorWorkspace.h:43
bool setPanelContext(const std::string &id, const std::string &context)
Attach a semantic input context such as scene, graph, or timeline.
Definition EditorWorkspace.cpp:137
Result< WorkspacePanelDescriptor > registerPanel(WorkspacePanelDescriptor descriptor)
Register a checked owning panel descriptor.
Definition EditorWorkspace.cpp:48
Result< WorkspacePanelDescriptor > activatePanel(const StableId &id)
Activate a visible panel with structured not-found/rejected results.
Definition EditorWorkspace.cpp:169
bool setPanelCapability(const std::string &id, const std::string &capability)
Attach a capability requirement used by the host when filtering panels.
Definition EditorWorkspace.cpp:128
Result< TransactionReceipt > commit() override
Preflight and commit all active operations through the authority.
Definition EditorTransactionService.cpp:74
Result< TransactionId > begin(TransactionSpec specification) override
Begin a transaction with a stable id and base revision.
Definition EditorTransactionService.cpp:60
Result< TransactionReceipt > undo() override
Compensate the most recent committed transaction.
Definition EditorTransactionService.cpp:82
Result< void > discard() override
Discard the active, not-yet-committed operation list.
Definition EditorTransactionService.cpp:76
Result< TransactionReceipt > redo() override
Reapply the most recently compensated transaction.
Definition EditorTransactionService.cpp:84
Result< void > append(DomainOperation operation) override
Append an operation to the active transaction without applying it.
Definition EditorTransactionService.cpp:68
static eve::OptionalRef< UIHost > resolve(UIHostHandle handle) noexcept
Resolves a UI host handle with ECS generation checking.
Definition UIHost.cpp:61
static UIHostHandle findHost(const std::string &name)
Lookup by Meta.name across the UIHost View.
Definition UISystem.cpp:1691
Result< DomainOperation > makeDelete(const ObjectId &id) const
Make delete.
Definition UiTheme.cpp:276
Result< DomainOperation > makeSetActive(const ObjectId &id) const
Make set active.
Definition UiTheme.cpp:292
Result< DomainOperation > makeResetToBase(const ObjectId &id) const
Make reset to base.
Definition UiTheme.cpp:301
const ObjectId & activeId() const noexcept
Active publication id; empty only if the catalog failed to seed.
Definition UiTheme.h:93
Result< UiThemeAsset > theme(const ObjectId &id) const
Copy one named theme, or NotFound.
Definition UiTheme.cpp:143
PropertyReadResult read(const SelectionSnapshot &selection, const PropertyPath &path) const override
Reads .
Definition UiThemeProperty.cpp:31
Result< DomainOperation > makeCreateFromPreset(const ObjectId &id, std::string name, UiThemeBasePreset preset) const
Make create from preset.
Definition UiTheme.cpp:212
Result< DomainOperation > makeSet(const SelectionSnapshot &selection, const PropertyPath &path, const EditorValue &value, PropertySetMode mode) const override
Make set.
Definition UiThemeProperty.cpp:45
const std::vector< UiThemeAsset > & themes() const noexcept
Borrow authored themes in catalog order.
Definition UiTheme.h:91
Result< DomainOperation > makeDuplicate(const ObjectId &source, const ObjectId &id, std::string name) const
Make duplicate.
Definition UiTheme.cpp:237
UiThemePreviewSnapshot build(const UiThemeCatalogTarget &catalog, const ObjectId &themeId, Revision expectedRevision) const
Copy tokens for themeId when expectedRevision matches the catalog.
Definition UiThemePreview.cpp:16
Result< void > publish(const UiThemeCatalogTarget &catalog) const
Replace the process global theme with the catalog's active asset.
Definition UiThemePreview.cpp:40
ui_editing::Result< void > duplicateSelected(std::string id, std::string name)
Definition UiThemeEditor.cpp:120
ui_editing::Result< void > deleteSelected()
Definition UiThemeEditor.cpp:129
ui_editing::Result< void > configureWorkspace(editor::EditorWorkspace &workspace) const
Install Themes / Preview / Inspector panels.
Definition UiThemeEditor.cpp:30
ui_editing::Result< void > setToken(const std::string &path, const ui_editing::EditorValue &value)
Definition UiThemeEditor.cpp:149
ui_editing::Result< void > setActiveSelected()
Definition UiThemeEditor.cpp:137
ui_editing::Result< editor::TransactionReceipt > redo()
Definition UiThemeEditor.cpp:166
ui_editing::Result< void > applyPreviewHost(const std::string &hostName)
Copy the selected theme onto a live UIHost without changing globalTheme.
Definition UiThemeEditor.cpp:174
ui_editing::Result< void > createFromPreset(std::string id, std::string name, std::string preset)
Definition UiThemeEditor.cpp:109
UiThemeEditor(std::string targetId)
Construct a catalog seeded with built-in Dark and Light assets.
Definition UiThemeEditor.cpp:23
ui_editing::Result< void > resetSelectedToBase()
Definition UiThemeEditor.cpp:145
ui_editing::Result< editor::TransactionReceipt > undo()
Definition UiThemeEditor.cpp:156
float getColorChannel(const std::string &path, int channel) const
Returns the color channel.
Definition UiThemeEditor.cpp:212
ui_editing::Result< void > selectTheme(std::string id)
Definition UiThemeEditor.cpp:102
Definition UiEditorModule.cpp:6
Definition Container.h:602
std::vector< SelectionItem > items
Definition EditingSelection.h:22
std::optional< SelectionItem > primary
Definition EditingSelection.h:23
Revision documentRevision
Definition UiTheme.h:165