aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/stylers/PreferredSizeStylerEditor.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-24 16:06:27 +0800
committercrupest <crupest@outlook.com>2022-02-24 16:06:27 +0800
commita7f5275267e1b504b119e2e3b7fcd46a88874821 (patch)
tree0a61d692e0b4bd267f11527c552175424e6105a2 /src/theme_builder/components/stylers/PreferredSizeStylerEditor.h
parent640401bf2f4b3da3708970a1408b27e159f93631 (diff)
downloadcru-a7f5275267e1b504b119e2e3b7fcd46a88874821.tar.gz
cru-a7f5275267e1b504b119e2e3b7fcd46a88874821.tar.bz2
cru-a7f5275267e1b504b119e2e3b7fcd46a88874821.zip
...
Diffstat (limited to 'src/theme_builder/components/stylers/PreferredSizeStylerEditor.h')
-rw-r--r--src/theme_builder/components/stylers/PreferredSizeStylerEditor.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/theme_builder/components/stylers/PreferredSizeStylerEditor.h b/src/theme_builder/components/stylers/PreferredSizeStylerEditor.h
new file mode 100644
index 00000000..4a64da10
--- /dev/null
+++ b/src/theme_builder/components/stylers/PreferredSizeStylerEditor.h
@@ -0,0 +1,27 @@
+#pragma once
+#include "../properties/MeasureLengthPropertyEditor.h"
+#include "StylerEditor.h"
+#include "cru/common/ClonablePtr.h"
+#include "cru/ui/style/Styler.h"
+
+namespace cru::theme_builder::components::stylers {
+class PreferredSizeStylerEditor : public StylerEditor {
+ public:
+ PreferredSizeStylerEditor();
+ ~PreferredSizeStylerEditor() override;
+
+ ClonablePtr<ui::style::PreferredSizeStyler> GetValue();
+ void SetValue(ui::style::PreferredSizeStyler* styler,
+ bool trigger_change = true);
+ void SetValue(const ClonablePtr<ui::style::PreferredSizeStyler>& styler,
+ bool trigger_change = true) {
+ SetValue(styler.get(), trigger_change);
+ }
+
+ ClonablePtr<ui::style::Styler> GetStyler() override { return GetValue(); }
+
+ private:
+ properties::MeasureLengthPropertyEditor width_editor_;
+ properties::MeasureLengthPropertyEditor height_editor_;
+};
+} // namespace cru::theme_builder::components::stylers