aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/stylers/MarginStylerEditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/theme_builder/components/stylers/MarginStylerEditor.cpp')
-rw-r--r--src/theme_builder/components/stylers/MarginStylerEditor.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/theme_builder/components/stylers/MarginStylerEditor.cpp b/src/theme_builder/components/stylers/MarginStylerEditor.cpp
new file mode 100644
index 00000000..d7d89acb
--- /dev/null
+++ b/src/theme_builder/components/stylers/MarginStylerEditor.cpp
@@ -0,0 +1,28 @@
+#include "MarginStylerEditor.h"
+#include "cru/ui/style/Styler.h"
+
+namespace cru::theme_builder::components::stylers {
+MarginStylerEditor::MarginStylerEditor() {
+ SetLabel(u"Margin Styler");
+ GetContainer()->AddChild(thickness_editor_.GetRootControl());
+
+ thickness_editor_.SetLabel(u"Thickness");
+
+ ConnectChangeEvent(thickness_editor_);
+}
+
+MarginStylerEditor::~MarginStylerEditor() {}
+
+ClonablePtr<ui::style::MarginStyler> MarginStylerEditor::GetValue() {
+ return ui::style::MarginStyler::Create(thickness_editor_.GetValue());
+}
+
+void MarginStylerEditor::SetValue(ui::style::MarginStyler* styler,
+ bool trigger_change) {
+ thickness_editor_.SetValue(styler->GetMargin(), false);
+
+ if (trigger_change) {
+ RaiseChangeEvent();
+ }
+}
+} // namespace cru::theme_builder::components::stylers