aboutsummaryrefslogtreecommitdiff
path: root/src/ThemeBuilder/components/properties/SelectPropertyEditor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ThemeBuilder/components/properties/SelectPropertyEditor.h')
-rw-r--r--src/ThemeBuilder/components/properties/SelectPropertyEditor.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/ThemeBuilder/components/properties/SelectPropertyEditor.h b/src/ThemeBuilder/components/properties/SelectPropertyEditor.h
index 0d6cbfcd..c58c1829 100644
--- a/src/ThemeBuilder/components/properties/SelectPropertyEditor.h
+++ b/src/ThemeBuilder/components/properties/SelectPropertyEditor.h
@@ -1,11 +1,11 @@
#pragma once
#include "../Editor.h"
+#include "../LabeledMixin.h"
#include "cru/ui/components/Select.h"
#include "cru/ui/controls/FlexLayout.h"
-#include "cru/ui/controls/TextBlock.h"
namespace cru::theme_builder::components::properties {
-class SelectPropertyEditor : public Editor {
+class SelectPropertyEditor : public Editor, public LabeledMixin {
public:
using PropertyType = Index;
@@ -15,28 +15,24 @@ class SelectPropertyEditor : public Editor {
public:
ui::controls::Control* GetRootControl() override { return &container_; }
- std::string GetLabel() const { return label_.GetText(); }
- void SetLabel(std::string label) { label_.SetText(std::move(label)); }
-
- Index GetSelectedIndex() const { return select_.GetSelectedIndex(); }
+ Index GetSelectedIndex() { return select_.GetSelectedIndex(); }
void SetSelectedIndex(Index index, bool trigger_change = true) {
if (trigger_change == false) SuppressNextChangeEvent();
select_.SetSelectedIndex(index);
}
- std::vector<std::string> GetItems() const { return select_.GetItems(); }
+ std::vector<std::string> GetItems() { return select_.GetItems(); }
void SetItems(std::vector<std::string> items) {
select_.SetItems(std::move(items));
}
- Index GetValue() const { return GetSelectedIndex(); }
+ Index GetValue() { return GetSelectedIndex(); }
void SetValue(Index value, bool trigger_change = true) {
SetSelectedIndex(value, trigger_change);
}
private:
ui::controls::FlexLayout container_;
- ui::controls::TextBlock label_;
ui::components::Select select_;
};
} // namespace cru::theme_builder::components::properties