summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-07-14 12:11:48 +0100
committerAlastair Poole <netstar@gmail.com>2020-07-14 12:16:30 +0100
commitf0aede60522033859be46f077212d179ff5bfaa5 (patch)
tree66f7e432029cfbf7152e33871333c9c4200e1b08
parent9f7fde560aac4953cfbb801b4a8d115a7a0039e0 (diff)
elm_code: cursor visbility fix.
If the widget is scrollable on the x axis, the cursor was being displayed in some rare cases when scrolling and the code widget did not cover the whole window region. e.g. a filepanel to the left of the widget could potentially have the cursor erroneously shown. This fixes as per the y axis hide. @fix
-rw-r--r--src/lib/elementary/elm_code_widget.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 870a73cee6..0507abd909 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -311,7 +311,7 @@ _elm_code_widget_fill_whitespace(Elm_Code_Widget *widget, Eina_Unicode character
311static void 311static void
312_elm_code_widget_cursor_update(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd) 312_elm_code_widget_cursor_update(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd)
313{ 313{
314 Evas_Coord oy, oh; 314 Evas_Coord ox, oy, ow, oh;
315 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; 315 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0;
316 316
317 elm_code_widget_geometry_for_position_get(widget, pd->cursor_line, pd->cursor_col, &cx, &cy, &cw, &ch); 317 elm_code_widget_geometry_for_position_get(widget, pd->cursor_line, pd->cursor_col, &cx, &cy, &cw, &ch);
@@ -327,9 +327,9 @@ _elm_code_widget_cursor_update(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd
327 327
328 evas_object_smart_calculate(pd->scroller); 328 evas_object_smart_calculate(pd->scroller);
329 evas_object_smart_calculate(pd->gridbox); 329 evas_object_smart_calculate(pd->gridbox);
330 evas_object_geometry_get(widget, NULL, &oy, NULL, &oh); 330 evas_object_geometry_get(widget, &ox, &oy, &ow, &oh);
331 331
332 if ((cy < oy) || (cy > (oy + oh - ch))) 332 if ((cx < ox) || (cx > (ox + ow)) || (cy < oy) || (cy > (oy + oh - ch)))
333 evas_object_hide(pd->cursor_rect); 333 evas_object_hide(pd->cursor_rect);
334 else 334 else
335 { 335 {
@@ -1198,7 +1198,6 @@ _elm_code_widget_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj
1198 _elm_code_widget_selection_type_set(widget, ELM_CODE_WIDGET_SELECTION_MOUSE); 1198 _elm_code_widget_selection_type_set(widget, ELM_CODE_WIDGET_SELECTION_MOUSE);
1199 _elm_code_widget_selection_in_progress_set(widget, EINA_TRUE); 1199 _elm_code_widget_selection_in_progress_set(widget, EINA_TRUE);
1200 1200
1201
1202 elm_code_widget_selection_end(widget, row, col); 1201 elm_code_widget_selection_end(widget, row, col);
1203} 1202}
1204 1203