aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/properties/OptionalPropertyEditor.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-14 22:51:37 +0800
committercrupest <crupest@outlook.com>2022-02-14 22:51:37 +0800
commit21c1c3281cd4186d9810d68122e9e8e92da714ad (patch)
treea458a6329b82145dbd7e255cf11f203c9116dafe /src/theme_builder/components/properties/OptionalPropertyEditor.h
parent6593a25baa01687b9462f792ce91bd46909df229 (diff)
downloadcru-21c1c3281cd4186d9810d68122e9e8e92da714ad.tar.gz
cru-21c1c3281cd4186d9810d68122e9e8e92da714ad.tar.bz2
cru-21c1c3281cd4186d9810d68122e9e8e92da714ad.zip
...
Diffstat (limited to 'src/theme_builder/components/properties/OptionalPropertyEditor.h')
-rw-r--r--src/theme_builder/components/properties/OptionalPropertyEditor.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/theme_builder/components/properties/OptionalPropertyEditor.h b/src/theme_builder/components/properties/OptionalPropertyEditor.h
index 87ddcaa2..03eb759c 100644
--- a/src/theme_builder/components/properties/OptionalPropertyEditor.h
+++ b/src/theme_builder/components/properties/OptionalPropertyEditor.h
@@ -13,7 +13,7 @@ class OptionalPropertyEditor : public ui::components::Component {
OptionalPropertyEditor() {
container_.AddChild(&check_box_);
- container_.AddChild(editor_->GetRootControl());
+ container_.AddChild(editor_.GetRootControl());
editor_.ChangeEvent()->AddHandler([this](std::nullptr_t) {
if (IsEnabled()) {
@@ -34,7 +34,8 @@ class OptionalPropertyEditor : public ui::components::Component {
}
std::optional<PropertyType> GetValue() const {
- return IsEnabled() ? editor_.GetValue() : std::nullopt;
+ return IsEnabled() ? std::optional<PropertyType>(editor_.GetValue())
+ : std::nullopt;
}
void SetValue(std::optional<PropertyType> value, bool trigger_change = true) {