summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp3
-rw-r--r--scene/gui/graph_node.cpp4
-rw-r--r--scene/gui/line_edit.cpp8
-rw-r--r--scene/gui/tree.cpp2
4 files changed, 10 insertions, 7 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 52fcea2a71..4f71481280 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -115,9 +115,6 @@ void BaseButton::_notification(int p_what) {
}
}
- if (p_what == NOTIFICATION_ENTER_TREE) {
- }
-
if (p_what == NOTIFICATION_EXIT_TREE || (p_what == NOTIFICATION_VISIBILITY_CHANGED && !is_visible_in_tree())) {
if (!toggle_mode) {
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index 6463ee5ad5..222c75b21d 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -599,6 +599,8 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) {
Vector2 mpos = Vector2(mb->get_position().x, mb->get_position().y);
if (close_rect.size != Size2() && close_rect.has_point(mpos)) {
+ //send focus to parent
+ get_parent_control()->grab_focus();
emit_signal("close_request");
accept_event();
return;
@@ -615,9 +617,7 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) {
return;
}
- //send focus to parent
emit_signal("raise_request");
- get_parent_control()->grab_focus();
}
if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 3dcbf64e7c..d5347edb87 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -999,6 +999,8 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
Ref<StyleBox> style = get_stylebox("normal");
int pixel_ofs = 0;
Size2 size = get_size();
+ bool display_clear_icon = !text.empty() && is_editable() && clear_button_enabled;
+ int r_icon_width = Control::get_icon("clear")->get_width();
switch (align) {
@@ -1013,10 +1015,16 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
pixel_ofs = int(style->get_offset().x);
else
pixel_ofs = int(size.width - (cached_width)) / 2;
+
+ if (display_clear_icon)
+ pixel_ofs -= int(r_icon_width / 2 + style->get_margin(MARGIN_RIGHT));
} break;
case ALIGN_RIGHT: {
pixel_ofs = int(size.width - style->get_margin(MARGIN_RIGHT) - (cached_width));
+
+ if (display_clear_icon)
+ pixel_ofs -= int(r_icon_width + style->get_margin(MARGIN_RIGHT));
} break;
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 4005505830..814100afdc 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2921,8 +2921,6 @@ void Tree::_notification(int p_what) {
drag_touching = false;
drag_touching_deaccel = false;
}
-
- } else {
}
}