aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/stylers
diff options
context:
space:
mode:
Diffstat (limited to 'src/theme_builder/components/stylers')
-rw-r--r--src/theme_builder/components/stylers/BorderStylerEditor.cpp5
-rw-r--r--src/theme_builder/components/stylers/CompoundStylerEditor.cpp16
-rw-r--r--src/theme_builder/components/stylers/StylerEditor.cpp7
-rw-r--r--src/theme_builder/components/stylers/StylerEditor.h3
4 files changed, 28 insertions, 3 deletions
diff --git a/src/theme_builder/components/stylers/BorderStylerEditor.cpp b/src/theme_builder/components/stylers/BorderStylerEditor.cpp
index b2522786..81eb66d3 100644
--- a/src/theme_builder/components/stylers/BorderStylerEditor.cpp
+++ b/src/theme_builder/components/stylers/BorderStylerEditor.cpp
@@ -15,6 +15,11 @@ BorderStylerEditor::BorderStylerEditor() {
GetContainer()->AddChild(foreground_brush_editor_.GetRootControl());
GetContainer()->AddChild(background_brush_editor_.GetRootControl());
+ thickness_editor_.GetEditor()->SetLabel(u"Thickness");
+ brush_editor_.GetEditor()->SetLabel(u"Border");
+ foreground_brush_editor_.GetEditor()->SetLabel(u"Foreground");
+ background_brush_editor_.GetEditor()->SetLabel(u"Background");
+
ConnectChangeEvent(corner_radius_editor_);
ConnectChangeEvent(thickness_editor_);
ConnectChangeEvent(brush_editor_);
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",
diff --git a/src/theme_builder/components/stylers/StylerEditor.cpp b/src/theme_builder/components/stylers/StylerEditor.cpp
index 030a3752..56dec813 100644
--- a/src/theme_builder/components/stylers/StylerEditor.cpp
+++ b/src/theme_builder/components/stylers/StylerEditor.cpp
@@ -5,12 +5,17 @@
#include "MarginStylerEditor.h"
#include "PaddingStylerEditor.h"
#include "PreferredSizeStylerEditor.h"
+#include "cru/ui/controls/FlexLayout.h"
+#include "cru/ui/render/FlexLayoutRenderObject.h"
#include "cru/ui/style/Styler.h"
namespace cru::theme_builder::components::stylers {
StylerEditor::StylerEditor() {
container_.SetFlexDirection(ui::controls::FlexDirection::Vertical);
- container_.AddChild(&label_);
+ container_.AddChild(&head_container_);
+ container_.SetItemCrossAlign(ui::controls::FlexCrossAlignment::Start);
+ head_container_.SetFlexDirection(ui::render::FlexDirection::Horizontal);
+ head_container_.AddChild(&label_);
}
StylerEditor::~StylerEditor() {}
diff --git a/src/theme_builder/components/stylers/StylerEditor.h b/src/theme_builder/components/stylers/StylerEditor.h
index 02005481..482cce7d 100644
--- a/src/theme_builder/components/stylers/StylerEditor.h
+++ b/src/theme_builder/components/stylers/StylerEditor.h
@@ -15,6 +15,8 @@ class StylerEditor : public Editor {
ui::controls::FlexLayout* GetContainer() { return &container_; }
+ ui::controls::FlexLayout* GetHeadContainer() { return &head_container_; }
+
String GetLabel() const { return label_.GetText(); }
void SetLabel(String label) { label_.SetText(std::move(label)); }
@@ -22,6 +24,7 @@ class StylerEditor : public Editor {
private:
ui::controls::FlexLayout container_;
+ ui::controls::FlexLayout head_container_;
ui::controls::TextBlock label_;
};