aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/stylers/CompoundStylerEditor.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-26 21:13:52 +0800
committercrupest <crupest@outlook.com>2022-02-26 21:13:52 +0800
commit38221428a5ea4bc71f03508dafdc6ad65ebfbea1 (patch)
tree3248edb39faf98aa19647f30477bcc6cf734ebb3 /src/theme_builder/components/stylers/CompoundStylerEditor.cpp
parent8da596f7b5fdbcf11fbda4aa66efc87a219f58ae (diff)
downloadcru-38221428a5ea4bc71f03508dafdc6ad65ebfbea1.tar.gz
cru-38221428a5ea4bc71f03508dafdc6ad65ebfbea1.tar.bz2
cru-38221428a5ea4bc71f03508dafdc6ad65ebfbea1.zip
...
Diffstat (limited to 'src/theme_builder/components/stylers/CompoundStylerEditor.cpp')
-rw-r--r--src/theme_builder/components/stylers/CompoundStylerEditor.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/theme_builder/components/stylers/CompoundStylerEditor.cpp b/src/theme_builder/components/stylers/CompoundStylerEditor.cpp
index ac1cc0ea..258eeb26 100644
--- a/src/theme_builder/components/stylers/CompoundStylerEditor.cpp
+++ b/src/theme_builder/components/stylers/CompoundStylerEditor.cpp
@@ -2,6 +2,7 @@
#include "BorderStylerEditor.h"
#include "CursorStylerEditor.h"
#include "cru/common/ClonablePtr.h"
+#include "cru/ui/ThemeManager.h"
#include "cru/ui/style/Styler.h"
namespace cru::theme_builder::components::stylers {
@@ -11,8 +12,12 @@ CompoundStylerEditorChild::CompoundStylerEditorChild(
container_.SetFlexDirection(ui::controls::FlexDirection::Horizontal);
container_.AddChild(&remove_button_);
+ 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_.SetText(u"x");
+ remove_button_text_.SetTextColor(ui::colors::red);
container_.AddChild(styler_editor_->GetRootControl());
@@ -24,10 +29,17 @@ CompoundStylerEditorChild::~CompoundStylerEditorChild() {}
CompoundStylerEditor::CompoundStylerEditor() {
SetLabel(u"Compound Styler");
- children_container_.SetFlexDirection(ui::controls::FlexDirection::Vertical);
GetContainer()->AddChild(&children_container_);
+ children_container_.SetFlexDirection(ui::controls::FlexDirection::Vertical);
+ children_container_.SetItemCrossAlign(
+ 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_.SetMenuItems({
u"Compound Styler",
u"Border Styler",