aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/properties/PointPropertyEditor.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-14 22:46:54 +0800
committercrupest <crupest@outlook.com>2022-02-14 22:46:54 +0800
commit6593a25baa01687b9462f792ce91bd46909df229 (patch)
treee9ee5ae8d67ef68fdfccca7e07c7d4b26f20c1d7 /src/theme_builder/components/properties/PointPropertyEditor.cpp
parent091c0419a254a28f80963193b36bf0a7f30d6590 (diff)
downloadcru-6593a25baa01687b9462f792ce91bd46909df229.tar.gz
cru-6593a25baa01687b9462f792ce91bd46909df229.tar.bz2
cru-6593a25baa01687b9462f792ce91bd46909df229.zip
...
Diffstat (limited to 'src/theme_builder/components/properties/PointPropertyEditor.cpp')
-rw-r--r--src/theme_builder/components/properties/PointPropertyEditor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/theme_builder/components/properties/PointPropertyEditor.cpp b/src/theme_builder/components/properties/PointPropertyEditor.cpp
index dde97b79..9b5a5e83 100644
--- a/src/theme_builder/components/properties/PointPropertyEditor.cpp
+++ b/src/theme_builder/components/properties/PointPropertyEditor.cpp
@@ -16,7 +16,7 @@ PointPropertyEditor::PointPropertyEditor() {
auto point = point_mapper->MapFromString(text.ToString());
point_ = point;
is_text_valid_ = true;
- point_change_event_.Raise(point);
+ change_event_.Raise(nullptr);
} catch (const Exception&) {
is_text_valid_ = false;
// TODO: Show error!
@@ -26,11 +26,12 @@ PointPropertyEditor::PointPropertyEditor() {
PointPropertyEditor::~PointPropertyEditor() { container_.RemoveFromParent(); }
-void PointPropertyEditor::SetPoint(const ui::Point& point) {
+void PointPropertyEditor::SetValue(const ui::Point& point,
+ bool trigger_change) {
point_ = point;
text_.SetText(ConvertPointToString(point));
is_text_valid_ = true;
- point_change_event_.Raise(point);
+ if (trigger_change) change_event_.Raise(nullptr);
}
String PointPropertyEditor::ConvertPointToString(const ui::Point& point) {