aboutsummaryrefslogtreecommitdiff
path: root/src/ThemeBuilder/components/conditions/CompoundConditionEditor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ThemeBuilder/components/conditions/CompoundConditionEditor.h')
-rw-r--r--src/ThemeBuilder/components/conditions/CompoundConditionEditor.h32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/ThemeBuilder/components/conditions/CompoundConditionEditor.h b/src/ThemeBuilder/components/conditions/CompoundConditionEditor.h
index 2948df36..6c1beeac 100644
--- a/src/ThemeBuilder/components/conditions/CompoundConditionEditor.h
+++ b/src/ThemeBuilder/components/conditions/CompoundConditionEditor.h
@@ -1,12 +1,8 @@
#pragma once
#include "ConditionEditor.h"
-#include "cru/base/ClonablePtr.h"
-#include "cru/base/Event.h"
-#include "cru/ui/components/Component.h"
+#include "cru/base/ClonePtr.h"
#include "cru/ui/components/PopupButton.h"
-#include "cru/ui/controls/Button.h"
#include "cru/ui/controls/FlexLayout.h"
-#include "cru/ui/controls/TextBlock.h"
#include "cru/ui/style/Condition.h"
namespace cru::theme_builder::components::conditions {
@@ -16,56 +12,48 @@ class CompoundConditionEditor : public ConditionEditor {
~CompoundConditionEditor();
protected:
- std::vector<ClonablePtr<ui::style::Condition>> GetChildren();
- void SetChildren(std::vector<ClonablePtr<ui::style::Condition>> children,
+ std::vector<ClonePtr<ui::style::Condition>> GetChildren();
+ void SetChildren(std::vector<ClonePtr<ui::style::Condition>> children,
bool trigger_change = true);
private:
ui::components::PopupMenuIconButton add_child_button_;
ui::controls::FlexLayout children_container_;
- std::vector<ui::DeleteLaterPtr<ConditionEditor>> children_;
+ std::vector<platform::gui::DeleteLaterPtr<ConditionEditor>> children_;
};
class AndConditionEditor : public CompoundConditionEditor {
public:
- AndConditionEditor() = default;
- ~AndConditionEditor() override = default;
-
- public:
- ClonablePtr<ui::style::AndCondition> GetValue() {
+ ClonePtr<ui::style::AndCondition> GetValue() {
return ui::style::AndCondition::Create(GetChildren());
}
void SetValue(ui::style::AndCondition* value, bool trigger_change = true) {
SetChildren(value->GetChildren(), trigger_change);
}
- void SetValue(const ClonablePtr<ui::style::AndCondition>& value,
+ void SetValue(const ClonePtr<ui::style::AndCondition>& value,
bool trigger_change = true) {
SetValue(value.get(), trigger_change);
}
- ClonablePtr<ui::style::Condition> GetCondition() override {
+ ClonePtr<ui::style::Condition> GetCondition() override {
return GetValue();
}
};
class OrConditionEditor : public CompoundConditionEditor {
public:
- OrConditionEditor() = default;
- ~OrConditionEditor() override = default;
-
- public:
- ClonablePtr<ui::style::OrCondition> GetValue() {
+ ClonePtr<ui::style::OrCondition> GetValue() {
return ui::style::OrCondition::Create(GetChildren());
}
void SetValue(ui::style::OrCondition* value, bool trigger_change = true) {
SetChildren(value->GetChildren(), trigger_change);
}
- void SetValue(const ClonablePtr<ui::style::OrCondition>& value,
+ void SetValue(const ClonePtr<ui::style::OrCondition>& value,
bool trigger_change = true) {
SetValue(value.get(), trigger_change);
}
- ClonablePtr<ui::style::Condition> GetCondition() override {
+ ClonePtr<ui::style::Condition> GetCondition() override {
return GetValue();
}
};