diff options
Diffstat (limited to 'src/theme_builder/components/properties')
-rw-r--r-- | src/theme_builder/components/properties/CornerRadiusPropertyEditor.cpp | 11 | ||||
-rw-r--r-- | src/theme_builder/components/properties/OptionalPropertyEditor.h | 7 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/theme_builder/components/properties/CornerRadiusPropertyEditor.cpp b/src/theme_builder/components/properties/CornerRadiusPropertyEditor.cpp index 91e2c614..fc86b0ed 100644 --- a/src/theme_builder/components/properties/CornerRadiusPropertyEditor.cpp +++ b/src/theme_builder/components/properties/CornerRadiusPropertyEditor.cpp @@ -1,12 +1,15 @@ #include "CornerRadiusPropertyEditor.h" #include "cru/ui/Base.h" +#include "cru/ui/controls/FlexLayout.h" namespace cru::theme_builder::components::properties { CornerRadiusPropertyEditor::CornerRadiusPropertyEditor() { - left_top_editor_.SetLabel(u"Left Top"); - right_top_editor_.SetLabel(u"Right Top"); - left_bottom_editor_.SetLabel(u"Left Bottom"); - right_bottom_editor_.SetLabel(u"Right Bottom"); + container_.SetItemCrossAlign(ui::controls::FlexCrossAlignment::Start); + + left_top_editor_.SetLabel(u"⌜"); + right_top_editor_.SetLabel(u"⌝"); + left_bottom_editor_.SetLabel(u"⌞"); + right_bottom_editor_.SetLabel(u"⌟"); container_.SetFlexDirection(ui::controls::FlexDirection::Vertical); container_.AddChild(left_top_editor_.GetRootControl()); diff --git a/src/theme_builder/components/properties/OptionalPropertyEditor.h b/src/theme_builder/components/properties/OptionalPropertyEditor.h index d7362d50..0f22616a 100644 --- a/src/theme_builder/components/properties/OptionalPropertyEditor.h +++ b/src/theme_builder/components/properties/OptionalPropertyEditor.h @@ -2,6 +2,7 @@ #include "../Editor.h" #include "cru/ui/controls/CheckBox.h" #include "cru/ui/controls/FlexLayout.h" +#include "cru/ui/controls/TextBlock.h" #include <optional> @@ -12,7 +13,9 @@ class OptionalPropertyEditor : public Editor { using PropertyType = typename TEditor::PropertyType; OptionalPropertyEditor() { + container_.AddChild(&label_); container_.AddChild(&check_box_); + check_box_.SetMargin({0, 0, 10, 0}); container_.AddChild(editor_.GetRootControl()); editor_.ChangeEvent()->AddHandler([this](std::nullptr_t) { @@ -25,6 +28,9 @@ class OptionalPropertyEditor : public Editor { ui::controls::Control* GetRootControl() override { return &container_; } + String GetLabel() const { return label_.GetText(); } + void SetLabel(String label) { label_.SetText(std::move(label)); } + bool IsEnabled() const { return check_box_.IsChecked(); } void SetEnabled(bool enabled, bool trigger_change = true) { check_box_.SetChecked(enabled); @@ -52,6 +58,7 @@ class OptionalPropertyEditor : public Editor { private: ui::controls::FlexLayout container_; + ui::controls::TextBlock label_; ui::controls::CheckBox check_box_; TEditor editor_; }; |