summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-03-11 16:52:04 -0800
committerCedric Bail <cedric@osg.samsung.com>2017-03-11 16:55:05 -0800
commit343d2e0d8778f8e7df207ae94eb88d873b3c3487 (patch)
tree381b484efc377299213aea1c3e84843a98ed43ac
parent17c04aef7f43bbf065758c9cd35aea9ab4535820 (diff)
elementary: force elm_code line fill on object resize.
This fix elementary_test use of elm_code where the object needed to get clicked to have their content displayed. The reason was that the line where appended while the object size was 0 and once it was resized the line where not displayed.
-rw-r--r--src/lib/elementary/elm_code_widget.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 994518a397..c4db18404c 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -1944,7 +1944,34 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline)
1944 evas_object_size_hint_min_set(grid, w*cw, ch); 1944 evas_object_size_hint_min_set(grid, w*cw, ch);
1945 } 1945 }
1946 1946
1947 if (!newline) return; 1947 if (!newline)
1948 {
1949 Evas_Coord scroll_y, scroll_h, oy;
1950 unsigned int first_row, last_row;
1951 unsigned int y;
1952
1953 evas_object_geometry_get(widget, NULL, &oy, NULL, NULL);
1954 elm_scroller_region_get(pd->scroller, NULL, &scroll_y, NULL, &scroll_h);
1955 if (scroll_h == 0)
1956 return;
1957
1958 elm_code_widget_position_at_coordinates_get(widget, 0, oy, &first_row, NULL);
1959 elm_code_widget_position_at_coordinates_get(widget, 0, oy + scroll_h, &last_row, NULL);
1960 if (last_row > elm_code_file_lines_get(pd->code->file))
1961 last_row = elm_code_file_lines_get(pd->code->file);
1962
1963 // cursor will be shown if it should be visible
1964 evas_object_hide(pd->cursor_rect);
1965 for (y = first_row; y <= last_row; y++)
1966 {
1967 line = elm_code_file_line_get(pd->code->file, y);
1968 if (line)
1969 _elm_code_widget_fill_line(widget, line);
1970 }
1971
1972 return;
1973 }
1974 _elm_code_widget_fill_line(widget, line);
1948 1975
1949 if (pd->gravity_x == 1.0 || pd->gravity_y == 1.0) 1976 if (pd->gravity_x == 1.0 || pd->gravity_y == 1.0)
1950 _elm_code_widget_scroll_by(widget, 1977 _elm_code_widget_scroll_by(widget,