diff options
author | crupest <crupest@outlook.com> | 2022-02-14 22:46:54 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-14 22:46:54 +0800 |
commit | 6593a25baa01687b9462f792ce91bd46909df229 (patch) | |
tree | e9ee5ae8d67ef68fdfccca7e07c7d4b26f20c1d7 /src/theme_builder/components/properties/ThicknessPropertyEditor.cpp | |
parent | 091c0419a254a28f80963193b36bf0a7f30d6590 (diff) | |
download | cru-6593a25baa01687b9462f792ce91bd46909df229.tar.gz cru-6593a25baa01687b9462f792ce91bd46909df229.tar.bz2 cru-6593a25baa01687b9462f792ce91bd46909df229.zip |
...
Diffstat (limited to 'src/theme_builder/components/properties/ThicknessPropertyEditor.cpp')
-rw-r--r-- | src/theme_builder/components/properties/ThicknessPropertyEditor.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/theme_builder/components/properties/ThicknessPropertyEditor.cpp b/src/theme_builder/components/properties/ThicknessPropertyEditor.cpp index 56374e86..2d922b69 100644 --- a/src/theme_builder/components/properties/ThicknessPropertyEditor.cpp +++ b/src/theme_builder/components/properties/ThicknessPropertyEditor.cpp @@ -15,7 +15,7 @@ ThicknessPropertyEditor::ThicknessPropertyEditor() { auto thickness = thickness_mapper->MapFromString(text.ToString()); thickness_ = thickness; is_text_valid_ = true; - thickness_change_event_.Raise(thickness); + change_event_.Raise(nullptr); } catch (const Exception &) { is_text_valid_ = false; // TODO: Show error! @@ -27,11 +27,12 @@ ThicknessPropertyEditor::~ThicknessPropertyEditor() { container_.RemoveFromParent(); } -void ThicknessPropertyEditor::SetThickness(const ui::Thickness &thickness) { +void ThicknessPropertyEditor::SetValue(const ui::Thickness &thickness, + bool trigger_change) { thickness_ = thickness; text_.SetText(Format(u"{} {} {} {}", thickness_.left, thickness_.top, thickness_.right, thickness_.bottom)); is_text_valid_ = true; - thickness_change_event_.Raise(thickness_); + if (trigger_change) change_event_.Raise(nullptr); } } // namespace cru::theme_builder::components::properties |