aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/StyleRuleEditor.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-16 21:17:09 +0800
committercrupest <crupest@outlook.com>2022-02-16 21:17:09 +0800
commit2711b7032cafdc9bdbd6ae06db0325c91e6e7f63 (patch)
tree9f19ec2697e1cf27895540f989d52946dcf4adab /src/theme_builder/components/StyleRuleEditor.h
parentc6de932f727ed324cf875ea3fca9ca44775a820e (diff)
downloadcru-2711b7032cafdc9bdbd6ae06db0325c91e6e7f63.tar.gz
cru-2711b7032cafdc9bdbd6ae06db0325c91e6e7f63.tar.bz2
cru-2711b7032cafdc9bdbd6ae06db0325c91e6e7f63.zip
...
Diffstat (limited to 'src/theme_builder/components/StyleRuleEditor.h')
-rw-r--r--src/theme_builder/components/StyleRuleEditor.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/theme_builder/components/StyleRuleEditor.h b/src/theme_builder/components/StyleRuleEditor.h
index 5a14161e..204b65b4 100644
--- a/src/theme_builder/components/StyleRuleEditor.h
+++ b/src/theme_builder/components/StyleRuleEditor.h
@@ -1,8 +1,11 @@
#pragma once
+#include "conditions/ConditionEditor.h"
#include "cru/ui/components/Component.h"
+#include "cru/ui/controls/Button.h"
#include "cru/ui/controls/Control.h"
#include "cru/ui/controls/FlexLayout.h"
#include "cru/ui/style/StyleRule.h"
+#include "stylers/StylerEditor.h"
namespace cru::theme_builder {
class StyleRuleEditor : public ui::components::Component {
@@ -17,14 +20,22 @@ class StyleRuleEditor : public ui::components::Component {
public:
ui::controls::Control* GetRootControl() override { return &main_layout_; }
- void BindStyleRule(ui::style::StyleRule* rule);
+ ui::style::StyleRule GetValue() const;
+ void SetValue(const ui::style::StyleRule& style_rule,
+ bool trigger_change = true);
- private:
- void UpdateView();
+ IEvent<std::nullptr_t>* ChangeEvent() { return &change_event_; }
+ IEvent<std::nullptr_t>* RemoveEvent() { return &remove_event_; }
private:
ui::controls::FlexLayout main_layout_;
-
- ui::style::StyleRule* style_rule_;
+ ui::controls::Button remove_button_;
+ ui::controls::TextBlock remove_button_text_;
+ ui::controls::FlexLayout right_layout_;
+ std::unique_ptr<components::conditions::ConditionEditor> condition_editor_;
+ std::unique_ptr<components::stylers::StylerEditor> styler_editor_;
+
+ Event<std::nullptr_t> change_event_;
+ Event<std::nullptr_t> remove_event_;
};
} // namespace cru::theme_builder