summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-01-11 11:50:50 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-01-11 11:50:50 +0100
commitcbdcd99b858d48e14d11ec186b34f7b398cfc11d (patch)
tree8f0802c85c87c825821c72677748b22fe49fd58f /scene
parent3db379376fd55a1d5851bf6172affd0765b67b7c (diff)
parenta906bce9a0cd452d3fa44ab6843661e84b368845 (diff)
Merge pull request #3257 from TheHX/pr-range-properties
Fix error caused by dragging a Range property
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/range.cpp16
-rw-r--r--scene/gui/range.h4
2 files changed, 10 insertions, 10 deletions
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index d3b7521c9a..ffcdf98519 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -48,20 +48,20 @@ void Range::Shared::emit_value_changed() {
}
}
-void Range::_changed_notify() {
+void Range::_changed_notify(const char *p_what) {
emit_signal("changed",shared->val);
update();
- _change_notify();
+ _change_notify(p_what);
}
-void Range::Shared::emit_changed() {
+void Range::Shared::emit_changed(const char *p_what) {
for (Set<Range*>::Element *E=owners.front();E;E=E->next()) {
Range *r=E->get();
if (!r->is_inside_tree())
continue;
- r->_changed_notify();
+ r->_changed_notify(p_what);
}
}
@@ -94,20 +94,20 @@ void Range::set_min(double p_min) {
shared->min=p_min;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/min");
}
void Range::set_max(double p_max) {
shared->max=p_max;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/max");
}
void Range::set_step(double p_step) {
shared->step=p_step;
- shared->emit_changed();
+ shared->emit_changed("range/step");
}
void Range::set_page(double p_page) {
@@ -115,7 +115,7 @@ void Range::set_page(double p_page) {
shared->page=p_page;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/page");
}
double Range::get_val() const {
diff --git a/scene/gui/range.h b/scene/gui/range.h
index 2967c2790c..d96ecdfb0b 100644
--- a/scene/gui/range.h
+++ b/scene/gui/range.h
@@ -44,7 +44,7 @@ class Range : public Control {
bool exp_unit_value;
Set<Range*> owners;
void emit_value_changed();
- void emit_changed();
+ void emit_changed(const char *p_what="");
};
Shared *shared;
@@ -55,7 +55,7 @@ class Range : public Control {
void _share(Node *p_range);
void _value_changed_notify();
- void _changed_notify();
+ void _changed_notify(const char *p_what="");
protected: