summaryrefslogtreecommitdiff
path: root/editor/pane_drag.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/pane_drag.cpp')
-rw-r--r--editor/pane_drag.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/editor/pane_drag.cpp b/editor/pane_drag.cpp
index ce90fa94dc..09f2b90b90 100644
--- a/editor/pane_drag.cpp
+++ b/editor/pane_drag.cpp
@@ -31,23 +31,19 @@
#include "pane_drag.h"
void PaneDrag::_gui_input(const Ref<InputEvent> &p_input) {
-
Ref<InputEventMouseMotion> mm = p_input;
if (mm.is_valid() && mm->get_button_mask() & BUTTON_MASK_LEFT) {
-
emit_signal("dragged", Point2(mm->get_relative().x, mm->get_relative().y));
}
}
void PaneDrag::_notification(int p_what) {
-
switch (p_what) {
-
case NOTIFICATION_DRAW: {
-
Ref<Texture2D> icon = mouse_over ? get_theme_icon("PaneDragHover", "EditorIcons") : get_theme_icon("PaneDrag", "EditorIcons");
- if (!icon.is_null())
+ if (!icon.is_null()) {
icon->draw(get_canvas_item(), Point2(0, 0));
+ }
} break;
case NOTIFICATION_MOUSE_ENTER:
@@ -60,21 +56,20 @@ void PaneDrag::_notification(int p_what) {
break;
}
}
-Size2 PaneDrag::get_minimum_size() const {
+Size2 PaneDrag::get_minimum_size() const {
Ref<Texture2D> icon = get_theme_icon("PaneDrag", "EditorIcons");
- if (!icon.is_null())
+ if (!icon.is_null()) {
return icon->get_size();
+ }
return Size2();
}
void PaneDrag::_bind_methods() {
-
ClassDB::bind_method("_gui_input", &PaneDrag::_gui_input);
ADD_SIGNAL(MethodInfo("dragged", PropertyInfo(Variant::VECTOR2, "amount")));
}
PaneDrag::PaneDrag() {
-
mouse_over = false;
}