summaryrefslogtreecommitdiff
path: root/scene/gui/line_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r--scene/gui/line_edit.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 4f44ad0c1b..fb8396e4ff 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -355,7 +355,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
handled = false;
break;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
case KEY_LEFT: {
#ifndef APPLE_STYLE_KEYS
@@ -411,7 +411,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
handled = false;
break;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
case KEY_RIGHT: {
#ifndef APPLE_STYLE_KEYS
@@ -530,7 +530,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
handled = false;
break;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
case KEY_HOME: {
@@ -543,7 +543,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
handled = false;
break;
}
- FALLTHROUGH;
+ [[fallthrough]];
}
case KEY_END: {
@@ -655,7 +655,7 @@ bool LineEdit::_is_over_clear_button(const Point2 &p_pos) const {
if (!clear_button_enabled || !has_point(p_pos)) {
return false;
}
- Ref<Texture> icon = Control::get_icon("clear");
+ Ref<Texture2D> icon = Control::get_icon("clear");
int x_ofs = get_stylebox("normal")->get_offset().x;
return p_pos.x > get_size().width - icon->get_width() - x_ofs;
}
@@ -669,8 +669,8 @@ void LineEdit::_notification(int p_what) {
cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false));
cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65));
- if (!EditorSettings::get_singleton()->is_connected("settings_changed", this, "_editor_settings_changed")) {
- EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed");
+ if (!EditorSettings::get_singleton()->is_connected_compat("settings_changed", this, "_editor_settings_changed")) {
+ EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_editor_settings_changed");
}
}
} break;
@@ -769,7 +769,7 @@ void LineEdit::_notification(int p_what) {
bool display_clear_icon = !using_placeholder && is_editable() && clear_button_enabled;
if (right_icon.is_valid() || display_clear_icon) {
- Ref<Texture> r_icon = display_clear_icon ? Control::get_icon("clear") : right_icon;
+ Ref<Texture2D> r_icon = display_clear_icon ? Control::get_icon("clear") : right_icon;
Color color_icon(1, 1, 1, !is_editable() ? .5 * .9 : .9);
if (display_clear_icon) {
if (clear_button_status.press_attempt && clear_button_status.pressing_inside) {
@@ -1330,7 +1330,7 @@ void LineEdit::set_cursor_position(int p_pos) {
int window_width = get_size().width - style->get_minimum_size().width;
bool display_clear_icon = !text.empty() && is_editable() && clear_button_enabled;
if (right_icon.is_valid() || display_clear_icon) {
- Ref<Texture> r_icon = display_clear_icon ? Control::get_icon("clear") : right_icon;
+ Ref<Texture2D> r_icon = display_clear_icon ? Control::get_icon("clear") : right_icon;
window_width -= r_icon->get_width();
}
@@ -1671,7 +1671,7 @@ bool LineEdit::is_selecting_enabled() const {
return selecting_enabled;
}
-void LineEdit::set_right_icon(const Ref<Texture> &p_icon) {
+void LineEdit::set_right_icon(const Ref<Texture2D> &p_icon) {
if (right_icon == p_icon) {
return;
}
@@ -1680,7 +1680,7 @@ void LineEdit::set_right_icon(const Ref<Texture> &p_icon) {
update();
}
-Ref<Texture> LineEdit::get_right_icon() {
+Ref<Texture2D> LineEdit::get_right_icon() {
return right_icon;
}
@@ -1853,10 +1853,10 @@ void LineEdit::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "right_icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_right_icon", "get_right_icon");
ADD_GROUP("Placeholder", "placeholder_");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "placeholder_text"), "set_placeholder", "get_placeholder");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "placeholder_alpha", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_placeholder_alpha", "get_placeholder_alpha");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "placeholder_alpha", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_placeholder_alpha", "get_placeholder_alpha");
ADD_GROUP("Caret", "caret_");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), "cursor_set_blink_enabled", "cursor_get_blink_enabled");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "caret_blink_speed", PROPERTY_HINT_RANGE, "0.1,10,0.01"), "cursor_set_blink_speed", "cursor_get_blink_speed");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "caret_blink_speed", PROPERTY_HINT_RANGE, "0.1,10,0.01"), "cursor_set_blink_speed", "cursor_get_blink_speed");
ADD_PROPERTY(PropertyInfo(Variant::INT, "caret_position"), "set_cursor_position", "get_cursor_position");
}
@@ -1891,7 +1891,7 @@ LineEdit::LineEdit() {
caret_blink_timer = memnew(Timer);
add_child(caret_blink_timer);
caret_blink_timer->set_wait_time(0.65);
- caret_blink_timer->connect("timeout", this, "_toggle_draw_caret");
+ caret_blink_timer->connect_compat("timeout", this, "_toggle_draw_caret");
cursor_set_blink_enabled(false);
context_menu_enabled = true;
@@ -1899,7 +1899,7 @@ LineEdit::LineEdit() {
add_child(menu);
editable = false; // Initialise to opposite first, so we get past the early-out in set_editable.
set_editable(true);
- menu->connect("id_pressed", this, "menu_option");
+ menu->connect_compat("id_pressed", this, "menu_option");
expand_to_text_length = false;
}