diff options
author | crupest <crupest@outlook.com> | 2022-02-16 22:42:34 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-16 22:42:34 +0800 |
commit | f75ab0bd662c73d15057d746347d09bf94a992a6 (patch) | |
tree | 91efc33de481edf5304001d80b914b69cc0fb338 /src/theme_builder/components/StyleRuleSetEditor.cpp | |
parent | 2711b7032cafdc9bdbd6ae06db0325c91e6e7f63 (diff) | |
download | cru-f75ab0bd662c73d15057d746347d09bf94a992a6.tar.gz cru-f75ab0bd662c73d15057d746347d09bf94a992a6.tar.bz2 cru-f75ab0bd662c73d15057d746347d09bf94a992a6.zip |
...
Diffstat (limited to 'src/theme_builder/components/StyleRuleSetEditor.cpp')
-rw-r--r-- | src/theme_builder/components/StyleRuleSetEditor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/theme_builder/components/StyleRuleSetEditor.cpp b/src/theme_builder/components/StyleRuleSetEditor.cpp index 57671776..b5e6de91 100644 --- a/src/theme_builder/components/StyleRuleSetEditor.cpp +++ b/src/theme_builder/components/StyleRuleSetEditor.cpp @@ -6,6 +6,9 @@ namespace cru::theme_builder { using namespace cru::ui::controls; StyleRuleSetEditor::StyleRuleSetEditor() { + scroll_view_.SetChild(&container_); + + rules_layout_.SetFlexDirection(ui::controls::FlexDirection::Vertical); container_.AddChild(&rules_layout_); container_.AddChild(&add_button_); @@ -13,7 +16,7 @@ StyleRuleSetEditor::StyleRuleSetEditor() { add_button_text_.SetText(u"+"); add_button_.ClickEvent()->AddSpyOnlyHandler([this] { - auto rule_set = ui::style::StyleRule(ui::style::AndCondition::Create({}), + auto rule_set = ui::style::StyleRule(ui::style::NoCondition::Create(), ui::style::CompoundStyler::Create({})); style_rule_set_->AddStyleRule(rule_set); style_rule_editors_.push_back(std::make_unique<StyleRuleEditor>()); @@ -22,7 +25,7 @@ StyleRuleSetEditor::StyleRuleSetEditor() { }); } -StyleRuleSetEditor::~StyleRuleSetEditor() { rules_layout_.RemoveFromParent(); } +StyleRuleSetEditor::~StyleRuleSetEditor() { scroll_view_.RemoveFromParent(); } void StyleRuleSetEditor::BindStyleRuleSet( std::shared_ptr<ui::style::StyleRuleSet> rule_set) { |