aboutsummaryrefslogtreecommitdiff
path: root/src/ThemeBuilder/components/stylers/BorderStylerEditor.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-05-15 14:15:31 +0800
committercrupest <crupest@outlook.com>2022-05-15 14:15:31 +0800
commit34a64e6ffefaab007578932ddbab931a25f1d56e (patch)
tree541fdb8279e829a129df62288d09916bf23c9200 /src/ThemeBuilder/components/stylers/BorderStylerEditor.h
parent8ad2966933957ac5d6ff8dcd5e732736fd5e4dc6 (diff)
downloadcru-34a64e6ffefaab007578932ddbab931a25f1d56e.tar.gz
cru-34a64e6ffefaab007578932ddbab931a25f1d56e.tar.bz2
cru-34a64e6ffefaab007578932ddbab931a25f1d56e.zip
...
Diffstat (limited to 'src/ThemeBuilder/components/stylers/BorderStylerEditor.h')
-rw-r--r--src/ThemeBuilder/components/stylers/BorderStylerEditor.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/ThemeBuilder/components/stylers/BorderStylerEditor.h b/src/ThemeBuilder/components/stylers/BorderStylerEditor.h
new file mode 100644
index 00000000..539262d6
--- /dev/null
+++ b/src/ThemeBuilder/components/stylers/BorderStylerEditor.h
@@ -0,0 +1,36 @@
+#pragma once
+#include "../properties/ColorPropertyEditor.h"
+#include "../properties/CornerRadiusPropertyEditor.h"
+#include "../properties/OptionalPropertyEditor.h"
+#include "../properties/ThicknessPropertyEditor.h"
+#include "StylerEditor.h"
+#include "cru/common/ClonablePtr.h"
+
+namespace cru::theme_builder::components::stylers {
+class BorderStylerEditor : public StylerEditor {
+ public:
+ BorderStylerEditor();
+ ~BorderStylerEditor() override;
+
+ ClonablePtr<ui::style::BorderStyler> GetValue();
+ void SetValue(ui::style::BorderStyler* styler, bool trigger_change = true);
+ void SetValue(const ClonablePtr<ui::style::BorderStyler>& styler,
+ bool trigger_change = true) {
+ SetValue(styler.get(), trigger_change);
+ }
+
+ ClonablePtr<ui::style::Styler> GetStyler() override { return GetValue(); }
+
+ private:
+ properties::OptionalPropertyEditor<properties::CornerRadiusPropertyEditor>
+ corner_radius_editor_;
+ properties::OptionalPropertyEditor<properties::ThicknessPropertyEditor>
+ thickness_editor_;
+ properties::OptionalPropertyEditor<properties::ColorPropertyEditor>
+ brush_editor_;
+ properties::OptionalPropertyEditor<properties::ColorPropertyEditor>
+ foreground_brush_editor_;
+ properties::OptionalPropertyEditor<properties::ColorPropertyEditor>
+ background_brush_editor_;
+};
+} // namespace cru::theme_builder::components::stylers