summaryrefslogtreecommitdiffstats
path: root/scene/gui/color_picker.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-07-01 10:55:35 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-07-01 10:55:35 -0300
commit8cbb154466c4555f8ea44ebb9ea98f8a0e4c9877 (patch)
tree6e69479cfb3f3d5929727a24aaed085de6016d49 /scene/gui/color_picker.cpp
parent3185ce64c5c27c3ce7c4ce755bfc890bac172f04 (diff)
downloadredot-engine-8cbb154466c4555f8ea44ebb9ea98f8a0e4c9877.tar.gz
Color picker was getting too much focus, made it get not as much focus.
This abuse of focus was the original culprit of #5354
Diffstat (limited to 'scene/gui/color_picker.cpp')
-rw-r--r--scene/gui/color_picker.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index d6bbdf2d21..06f8c27957 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -72,13 +72,16 @@ void ColorPicker::_notification(int p_what) {
_update_color();
}
- case NOTIFICATION_VISIBILITY_CHANGED: {
- c_text->call_deferred("grab_focus");
- c_text->call_deferred("select");
- } break;
+
}
}
+void ColorPicker::set_focus_on_line_edit() {
+
+ c_text->grab_focus();
+ c_text->select();
+}
+
void ColorPicker::_update_controls() {
if (edit_alpha) {
@@ -628,6 +631,7 @@ void ColorPickerButton::pressed() {
popup->set_pos(get_global_pos()-Size2(0,ms.height));
popup->set_size(ms);
popup->popup();
+ picker->set_focus_on_line_edit();
}