1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Fix TextEdit cusor shape when mouse is held

This commit is contained in:
kit
2025-02-07 14:34:04 -05:00
parent 36d90c73a8
commit 65b7e1c73c
2 changed files with 13 additions and 0 deletions

View File

@@ -660,6 +660,10 @@ Control::CursorShape CodeEdit::get_cursor_shape(const Point2 &p_pos) const {
return CURSOR_POINTING_HAND; return CURSOR_POINTING_HAND;
} }
if (is_dragging_cursor()) {
return TextEdit::get_cursor_shape(p_pos);
}
if ((code_completion_active && code_completion_rect.has_point(p_pos)) || (!is_editable() && (!is_selecting_enabled() || get_line_count() == 0))) { if ((code_completion_active && code_completion_rect.has_point(p_pos)) || (!is_editable() && (!is_selecting_enabled() || get_line_count() == 0))) {
return CURSOR_ARROW; return CURSOR_ARROW;
} }

View File

@@ -1674,6 +1674,7 @@ void TextEdit::_notification(int p_what) {
selection_drag_attempt = false; selection_drag_attempt = false;
drag_action = false; drag_action = false;
drag_caret_force_displayed = false; drag_caret_force_displayed = false;
dragging_selection = false;
} break; } break;
case NOTIFICATION_MOUSE_EXIT_SELF: { case NOTIFICATION_MOUSE_EXIT_SELF: {
@@ -3112,6 +3113,14 @@ void TextEdit::drop_data(const Point2 &p_point, const Variant &p_data) {
} }
Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const { Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const {
if (dragging_selection) {
return get_default_cursor_shape();
}
if (dragging_minimap) {
return CURSOR_ARROW;
}
Vector2i current_hovered_gutter = _get_hovered_gutter(p_pos); Vector2i current_hovered_gutter = _get_hovered_gutter(p_pos);
if (current_hovered_gutter != Vector2i(-1, -1)) { if (current_hovered_gutter != Vector2i(-1, -1)) {
if (gutters[current_hovered_gutter.x].clickable || is_line_gutter_clickable(current_hovered_gutter.y, current_hovered_gutter.x)) { if (gutters[current_hovered_gutter.x].clickable || is_line_gutter_clickable(current_hovered_gutter.y, current_hovered_gutter.x)) {