diff options
author | crupest <crupest@outlook.com> | 2022-03-11 21:18:10 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-03-11 21:18:10 +0800 |
commit | 3d74364e78fadbc0b36081097e4a3a22a8ee26f2 (patch) | |
tree | 7c0e8eca39dc63d388963d348d1e2e8fbd92b9d0 /src/theme_builder/components/stylers | |
parent | f99d56cf4091baf34636436de42ac84f4f92ae66 (diff) | |
download | cru-3d74364e78fadbc0b36081097e4a3a22a8ee26f2.tar.gz cru-3d74364e78fadbc0b36081097e4a3a22a8ee26f2.tar.bz2 cru-3d74364e78fadbc0b36081097e4a3a22a8ee26f2.zip |
...
Diffstat (limited to 'src/theme_builder/components/stylers')
-rw-r--r-- | src/theme_builder/components/stylers/CompoundStylerEditor.cpp | 13 | ||||
-rw-r--r-- | src/theme_builder/components/stylers/CompoundStylerEditor.h | 5 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/theme_builder/components/stylers/CompoundStylerEditor.cpp b/src/theme_builder/components/stylers/CompoundStylerEditor.cpp index 258eeb26..e5a7f32e 100644 --- a/src/theme_builder/components/stylers/CompoundStylerEditor.cpp +++ b/src/theme_builder/components/stylers/CompoundStylerEditor.cpp @@ -15,9 +15,9 @@ CompoundStylerEditorChild::CompoundStylerEditorChild( remove_button_.GetStyleRuleSet()->SetParent( ui::ThemeManager::GetInstance()->GetResourceStyleRuleSet( u"cru.theme_builder.icon-button.style")); - remove_button_.SetChild(&remove_button_text_); - remove_button_text_.SetText(u"x"); - remove_button_text_.SetTextColor(ui::colors::red); + remove_button_.SetIconWithSvgPathDataStringResourceKey(u"icon.close", + {0, 0, 16, 16}); + remove_button_.SetIconFillColor(ui::colors::red); container_.AddChild(styler_editor_->GetRootControl()); @@ -35,11 +35,14 @@ CompoundStylerEditor::CompoundStylerEditor() { ui::controls::FlexCrossAlignment::Start); GetHeadContainer()->AddChild(add_child_button_.GetRootControl()); - add_child_button_.SetButtonText(u"+"); add_child_button_.GetButton()->GetStyleRuleSet()->SetParent( ui::ThemeManager::GetInstance()->GetResourceStyleRuleSet( u"cru.theme_builder.icon-button.style")); - add_child_button_.SetButtonTextColor(ui::colors::green); + add_child_button_.GetButton()->SetIconWithSvgPathDataStringResourceKey( + u"icon.plus", {0, 0, 16, 16}); + add_child_button_.GetButton()->SetPreferredSize({24, 24}); + add_child_button_.GetButton()->SetPadding(ui::Thickness(2)); + add_child_button_.GetButton()->SetIconFillColor(ui::colors::green); add_child_button_.SetMenuItems({ u"Compound Styler", u"Border Styler", diff --git a/src/theme_builder/components/stylers/CompoundStylerEditor.h b/src/theme_builder/components/stylers/CompoundStylerEditor.h index 33a3d7cf..fe9fb47c 100644 --- a/src/theme_builder/components/stylers/CompoundStylerEditor.h +++ b/src/theme_builder/components/stylers/CompoundStylerEditor.h @@ -20,8 +20,7 @@ class CompoundStylerEditorChild : public ui::components::Component { private: ui::controls::FlexLayout container_; - ui::controls::Button remove_button_; - ui::controls::TextBlock remove_button_text_; + ui::controls::IconButton remove_button_; std::unique_ptr<StylerEditor> styler_editor_; Event<std::nullptr_t> remove_event_; @@ -45,6 +44,6 @@ class CompoundStylerEditor : public StylerEditor { private: ui::controls::FlexLayout children_container_; std::vector<std::unique_ptr<CompoundStylerEditorChild>> children_; - ui::components::PopupMenuTextButton add_child_button_; + ui::components::PopupMenuIconButton add_child_button_; }; } // namespace cru::theme_builder::components::stylers |