aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/cru/common/ClonablePtr.h2
-rw-r--r--src/theme_builder/CMakeLists.txt1
-rw-r--r--src/theme_builder/components/properties/OptionalPropertyEditor.h5
-rw-r--r--src/theme_builder/components/stylers/BorderStylerEditor.cpp (renamed from src/theme_builder/components/styler/BorderStylerEditor.cpp)4
-rw-r--r--src/theme_builder/components/stylers/BorderStylerEditor.h (renamed from src/theme_builder/components/styler/BorderStylerEditor.h)4
5 files changed, 9 insertions, 7 deletions
diff --git a/include/cru/common/ClonablePtr.h b/include/cru/common/ClonablePtr.h
index 39b5b454..a2a88758 100644
--- a/include/cru/common/ClonablePtr.h
+++ b/include/cru/common/ClonablePtr.h
@@ -88,7 +88,7 @@ class ClonablePtr {
public:
pointer get() const noexcept { return ptr_.get(); }
- operator bool() const noexcept { return ptr_; }
+ operator bool() const noexcept { return ptr_ != nullptr; }
element_type& operator*() const noexcept { return *ptr_; }
pointer operator->() const noexcept { return ptr_.get(); }
diff --git a/src/theme_builder/CMakeLists.txt b/src/theme_builder/CMakeLists.txt
index 5c57f12b..902173fd 100644
--- a/src/theme_builder/CMakeLists.txt
+++ b/src/theme_builder/CMakeLists.txt
@@ -9,6 +9,7 @@ add_executable(cru_theme_builder
components/properties/PointPropertyEditor.cpp
components/properties/TextPropertyEditor.cpp
components/properties/ThicknessPropertyEditor.cpp
+ components/stylers/BorderStylerEditor.cpp
)
if(APPLE)
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) {
diff --git a/src/theme_builder/components/styler/BorderStylerEditor.cpp b/src/theme_builder/components/stylers/BorderStylerEditor.cpp
index 819e67c0..4f36aec8 100644
--- a/src/theme_builder/components/styler/BorderStylerEditor.cpp
+++ b/src/theme_builder/components/stylers/BorderStylerEditor.cpp
@@ -6,7 +6,7 @@
#include "cru/ui/style/ApplyBorderStyleInfo.h"
#include "cru/ui/style/Styler.h"
-namespace cru::theme_builder::components::styler {
+namespace cru::theme_builder::components::stylers {
BorderStylerEditor::BorderStylerEditor() {
container_.AddChild(corner_radius_editor_.GetRootControl());
container_.AddChild(thickness_editor_.GetRootControl());
@@ -92,4 +92,4 @@ void BorderStylerEditor::SetValue(
}
}
-} // namespace cru::theme_builder::components::styler
+} // namespace cru::theme_builder::components::stylers
diff --git a/src/theme_builder/components/styler/BorderStylerEditor.h b/src/theme_builder/components/stylers/BorderStylerEditor.h
index 991647e7..8e9a4e6f 100644
--- a/src/theme_builder/components/styler/BorderStylerEditor.h
+++ b/src/theme_builder/components/stylers/BorderStylerEditor.h
@@ -10,7 +10,7 @@
#include "cru/ui/controls/FlexLayout.h"
#include "cru/ui/style/Styler.h"
-namespace cru::theme_builder::components::styler {
+namespace cru::theme_builder::components::stylers {
class BorderStylerEditor : public ui::components::Component {
public:
BorderStylerEditor();
@@ -38,4 +38,4 @@ class BorderStylerEditor : public ui::components::Component {
Event<std::nullptr_t> change_event_;
};
-} // namespace cru::theme_builder::components::styler
+} // namespace cru::theme_builder::components::stylers