diff options
Diffstat (limited to 'src/theme_builder/components/StyleRuleEditor.h')
-rw-r--r-- | src/theme_builder/components/StyleRuleEditor.h | 21 |
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 |