From 21c1c3281cd4186d9810d68122e9e8e92da714ad Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 14 Feb 2022 22:51:37 +0800 Subject: ... --- src/theme_builder/components/properties/OptionalPropertyEditor.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/theme_builder/components/properties') 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 GetValue() const { - return IsEnabled() ? editor_.GetValue() : std::nullopt; + return IsEnabled() ? std::optional(editor_.GetValue()) + : std::nullopt; } void SetValue(std::optional value, bool trigger_change = true) { -- cgit v1.2.3