载入中...
搜索中...
未找到
UiDocumentProperty.cpp
浏览该文件的文档.
43 if (path == PropertyPath("layout.position")) return EditorValue::Array{widget.layout.x, widget.layout.y};
85 if (path == PropertyPath("content.fillStretch") || path == PropertyPath("content.fillClockwise")) {
96 if (!direction || (*direction != "right" && *direction != "left" && *direction != "down" && *direction != "up"))
101 if (path == PropertyPath("content.fontAsset") || path == PropertyPath("content.textureAsset")) {
160 if (*text != "start" && *text != "center" && *text != "end" && *text != "stretch") return false;
174 for (int i = 0; i < 4; ++i) { const auto* number = (*tuple)[i].getIf<double>(); if (!number || *number < 0.0) return false; values[i] = *number; }
178 widget.style.tintR = values[0]; widget.style.tintG = values[1]; widget.style.tintB = values[2]; widget.style.tintA = values[3];
180 widget.content.textR = values[0]; widget.content.textG = values[1]; widget.content.textB = values[2]; widget.content.textA = values[3];
183 widget.style.marginLeft = values[0]; widget.style.marginTop = values[1]; widget.style.marginRight = values[2]; widget.style.marginBottom = values[3];
185 widget.style.paddingLeft = values[0]; widget.style.paddingTop = values[1]; widget.style.paddingRight = values[2]; widget.style.paddingBottom = values[3];
216eve::Result<eve::Revision> UiDocumentTarget::currentRevision(const SelectionSnapshot& selection) const {
239 uiProperty("content.horizontalAlign", "editor.ui.horizontalAlign", PropertyType::Enum, "start", "content"),
240 uiProperty("content.verticalAlign", "editor.ui.verticalAlign", PropertyType::Enum, "start", "content"),
241 uiProperty("content.textureAsset", "editor.ui.textureAsset", PropertyType::AssetRef, "", "content"),
244 uiProperty("content.fillDirection", "editor.ui.fillDirection", PropertyType::Enum, "right", "content"),
245 uiProperty("content.fillStretch", "editor.ui.fillStretch", PropertyType::Bool, false, "content"),
246 uiProperty("content.fillStartDegrees", "editor.ui.fillStartDegrees", PropertyType::Float, -90.0, "content"),
247 uiProperty("content.fillClockwise", "editor.ui.fillClockwise", PropertyType::Bool, true, "content"),
248 uiProperty("content.fillInnerRadius", "editor.ui.fillInnerRadius", PropertyType::Float, 0.0, "content"),
252 uiProperty("layout.position", "editor.ui.position", PropertyType::Vec2, EditorValue::Array{0.0, 0.0}, "layout"),
253 uiProperty("layout.size", "editor.ui.size", PropertyType::Vec2, EditorValue::Array{0.0, 0.0}, "layout"),
254 uiProperty("layout.anchor", "editor.ui.anchor", PropertyType::Vec2, EditorValue::Array{0.0, 0.0}, "layout"),
255 uiProperty("layout.pivot", "editor.ui.pivot", PropertyType::Vec2, EditorValue::Array{0.0, 0.0}, "layout"),
256 uiProperty("style.margin", "editor.ui.margin", PropertyType::Vec4, EditorValue::Array{0.0, 0.0, 0.0, 0.0},
258 uiProperty("style.padding", "editor.ui.padding", PropertyType::Vec4, EditorValue::Array{0.0, 0.0, 0.0, 0.0},
260 uiProperty("style.tint", "editor.ui.tint", PropertyType::Color, EditorValue::Array{1.0, 1.0, 1.0, 1.0},
283 return common ? PropertyReadResult{PropertyReadState::Value, *common, {}} : PropertyReadResult{};
292 return eve::editing::failed<DomainOperation>(EditorStatus::Unsupported, RuleId("editor.ui.property-mode"),
295 return eve::editing::failed<DomainOperation>(EditorStatus::Unsupported, RuleId("editor.ui.property-path"),
302 return eve::editing::failed<DomainOperation>(EditorStatus::Rejected, RuleId("editor.ui.property-target"),
306 return eve::editing::failed<DomainOperation>(EditorStatus::NotFound, RuleId("editor.ui.widget-not-found"),
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
const std::string & value() const noexcept
Returns the exact legacy or canonical compatibility spelling.
Definition Identity.h:365
Revision revisionValue() const noexcept
Return the revision as the shared protocol revision type.
Definition EditableTarget.h:169
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:23
PropertyReadResult read(const SelectionSnapshot &selection, const PropertyPath &path) const override
Reads .
Definition UiDocumentProperty.cpp:271
PropertySchema schema(const SelectionSnapshot &selection) const override
Schema.
Definition UiDocumentProperty.cpp:229
Result< DomainOperation > makeReset(const SelectionSnapshot &selection, const PropertyPath &path) const override
Make reset.
Definition UiDocumentProperty.cpp:326
Result< DomainOperation > makeSet(const SelectionSnapshot &selection, const PropertyPath &path, const EditorValue &value, PropertySetMode mode) const override
Make set.
Definition UiDocumentProperty.cpp:286
eve::Result< eve::Revision > currentRevision(const SelectionSnapshot &selection) const override
Current revision.
Definition UiDocumentProperty.cpp:216
editing::PropertyDescriptor PropertyDescriptor
Definition ArchSpaceTarget.h:31
editing::PropertyPath PropertyPath
Definition ArchSpaceTarget.h:33
Definition UiDocument.cpp:9
@ InvalidArgument
PropertyDescriptorLookup find(const PropertyPath &path) const
Finds find.
Definition EditingProperty.cpp:9
std::vector< SelectionItem > items
Definition EditingSelection.h:22
Immutable widget snapshot used across editor/runtime boundaries.
Definition UiDocument.h:102