aboutsummaryrefslogtreecommitdiff
path: root/src/ThemeBuilder
diff options
context:
space:
mode:
Diffstat (limited to 'src/ThemeBuilder')
-rw-r--r--src/ThemeBuilder/components/StyleRuleSetEditor.cpp2
-rw-r--r--src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp2
-rw-r--r--src/ThemeBuilder/components/properties/MeasureLengthPropertyEditor.cpp9
-rw-r--r--src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp2
-rw-r--r--src/ThemeBuilder/components/stylers/PreferredSizeStylerEditor.cpp4
5 files changed, 9 insertions, 10 deletions
diff --git a/src/ThemeBuilder/components/StyleRuleSetEditor.cpp b/src/ThemeBuilder/components/StyleRuleSetEditor.cpp
index 9159e966..f077d31a 100644
--- a/src/ThemeBuilder/components/StyleRuleSetEditor.cpp
+++ b/src/ThemeBuilder/components/StyleRuleSetEditor.cpp
@@ -24,7 +24,7 @@ StyleRuleSetEditor::StyleRuleSetEditor() {
"cru.theme_builder.icon-button.style"));
add_button_.SetIconWithSvgPathDataStringResourceKey("icon.plus",
{0, 0, 16, 16});
- add_button_.SetPreferredSize({24, 24});
+ add_button_.SetSuggestSize({24, 24});
add_button_.SetPadding(ui::Thickness(2));
add_button_.SetIconFillColor(ui::colors::green);
diff --git a/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp b/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
index 8501d7cd..d84f05e2 100644
--- a/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
+++ b/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
@@ -30,7 +30,7 @@ CompoundConditionEditor::CompoundConditionEditor() {
"cru.theme_builder.icon-button.style"));
add_child_button_.GetButton()->SetIconWithSvgPathDataStringResourceKey(
"icon.plus", {0, 0, 16, 16});
- add_child_button_.GetButton()->SetPreferredSize({24, 24});
+ add_child_button_.GetButton()->SetSuggestSize({24, 24});
add_child_button_.GetButton()->SetPadding(ui::Thickness(2));
add_child_button_.GetButton()->SetIconFillColor(ui::colors::green);
add_child_button_.SetMenuItems({"And Condition", "Or Condition",
diff --git a/src/ThemeBuilder/components/properties/MeasureLengthPropertyEditor.cpp b/src/ThemeBuilder/components/properties/MeasureLengthPropertyEditor.cpp
index 001665ae..32723a6d 100644
--- a/src/ThemeBuilder/components/properties/MeasureLengthPropertyEditor.cpp
+++ b/src/ThemeBuilder/components/properties/MeasureLengthPropertyEditor.cpp
@@ -14,8 +14,7 @@ MeasureLengthPropertyEditor::MeasureLengthPropertyEditor() {
auto measure_length_mapper = ui::mapper::MapperRegistry::GetInstance()
->GetMapper<ui::render::MeasureLength>();
try {
- auto measure_length =
- measure_length_mapper->MapFromString(text);
+ auto measure_length = measure_length_mapper->MapFromString(text);
measure_length_ = measure_length;
is_text_valid_ = true;
RaiseChangeEvent();
@@ -31,8 +30,8 @@ MeasureLengthPropertyEditor::~MeasureLengthPropertyEditor() {}
void MeasureLengthPropertyEditor::SetValue(
const ui::render::MeasureLength& value, bool trigger_change) {
if (!trigger_change) SuppressNextChangeEvent();
- text_.SetText(measure_length_.IsNotSpecified()
- ? "unspecified"
- : std::to_string(measure_length_.GetLengthOrUndefined()));
+ text_.SetText(measure_length_.IsSpecified()
+ ? std::to_string(measure_length_.GetLengthOrUndefined())
+ : "unspecified");
}
} // namespace cru::theme_builder::components::properties
diff --git a/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp b/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp
index 698cc699..fb144e60 100644
--- a/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp
+++ b/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp
@@ -25,7 +25,7 @@ CompoundStylerEditor::CompoundStylerEditor() {
"cru.theme_builder.icon-button.style"));
add_child_button_.GetButton()->SetIconWithSvgPathDataStringResourceKey(
"icon.plus", {0, 0, 16, 16});
- add_child_button_.GetButton()->SetPreferredSize({24, 24});
+ add_child_button_.GetButton()->SetSuggestSize({24, 24});
add_child_button_.GetButton()->SetPadding(ui::Thickness(2));
add_child_button_.GetButton()->SetIconFillColor(ui::colors::green);
add_child_button_.SetMenuItems({"Compound Styler", "Border Styler",
diff --git a/src/ThemeBuilder/components/stylers/PreferredSizeStylerEditor.cpp b/src/ThemeBuilder/components/stylers/PreferredSizeStylerEditor.cpp
index 8c7c751f..d230e09c 100644
--- a/src/ThemeBuilder/components/stylers/PreferredSizeStylerEditor.cpp
+++ b/src/ThemeBuilder/components/stylers/PreferredSizeStylerEditor.cpp
@@ -24,8 +24,8 @@ PreferredSizeStylerEditor::GetValue() {
void PreferredSizeStylerEditor::SetValue(ui::style::PreferredSizeStyler* styler,
bool trigger_change) {
- width_editor_.SetValue(styler->GetPreferredSize().width, false);
- height_editor_.SetValue(styler->GetPreferredSize().height, false);
+ width_editor_.SetValue(styler->GetSuggestSize().width, false);
+ height_editor_.SetValue(styler->GetSuggestSize().height, false);
if (trigger_change) {
RaiseChangeEvent();