summaryrefslogtreecommitdiffstats
path: root/scene/gui/scroll_bar.cpp
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2017-08-22 20:02:08 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2017-08-22 20:04:19 +0100
commit24c6c097f360c4bdaf20e9057177995c76784f6c (patch)
tree9e526bfa5c65430e9631eca3bc4c2e43404d7ccc /scene/gui/scroll_bar.cpp
parent294e912a843cde241f9abf619f5d40df9ef6ef9f (diff)
downloadredot-engine-24c6c097f360c4bdaf20e9057177995c76784f6c.tar.gz
Stops scrolling when the user issues another command
Diffstat (limited to 'scene/gui/scroll_bar.cpp')
-rw-r--r--scene/gui/scroll_bar.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp
index 6519cde6d3..4242ee4523 100644
--- a/scene/gui/scroll_bar.cpp
+++ b/scene/gui/scroll_bar.cpp
@@ -40,6 +40,11 @@ void ScrollBar::set_can_focus_by_default(bool p_can_focus) {
void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
+ Ref<InputEventMouseMotion> m = p_event;
+ if (!m.is_valid() || drag.active) {
+ emit_signal("scrolling");
+ }
+
Ref<InputEventMouseButton> b = p_event;
if (b.is_valid()) {
@@ -143,8 +148,6 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
}
}
- Ref<InputEventMouseMotion> m = p_event;
-
if (m.is_valid()) {
accept_event();
@@ -823,6 +826,8 @@ void ScrollBar::_bind_methods() {
ClassDB::bind_method(D_METHOD("_drag_slave_input"), &ScrollBar::_drag_slave_input);
ClassDB::bind_method(D_METHOD("_drag_slave_exit"), &ScrollBar::_drag_slave_exit);
+ ADD_SIGNAL(MethodInfo("scrolling"));
+
ADD_PROPERTY(PropertyInfo(Variant::REAL, "custom_step", PROPERTY_HINT_RANGE, "-1,4096"), "set_custom_step", "get_custom_step");
}