Skip to content

Commit

Permalink
gui: fix invalid handling of group parts in edje
Browse files Browse the repository at this point in the history
For some reason, there was a behavior change between efl 1.20.3 that
makes the edje theme behave as I was expected in latest EFL, but was
completely broken in efl <= 1.20.3 (maybe 1.20.4 also? untested).

We now stop relying on an undefined behavior and actually do handle the
swallowed text parts as they should.

Fixes #20
  • Loading branch information
Jean Guyomarc'h committed Jan 3, 2018
1 parent 8c0c3b1 commit 2e68483
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ gui_add(s_gui *gui,
* Command-Line GUI objects
* ===================================================================== */

gui->cmdline.obj = edje_object_part_swallow_get(gui->edje, "eovim.cmdline");
gui->cmdline.info = edje_object_part_swallow_get(gui->edje, "eovim.cmdline_info");

/* Table: will hold both the spacer and the genlist */
gui->cmdline.table = o = elm_table_add(gui->layout);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
Expand Down Expand Up @@ -997,9 +994,10 @@ gui_cmdline_show(s_gui *gui,
.str = (char *)firstc,
};
termview_cursor_visibility_set(gui->termview, EINA_FALSE);
edje_object_message_send(gui->cmdline.info, EDJE_MESSAGE_STRING,
edje_object_message_send(gui->edje, EDJE_MESSAGE_STRING,
THEME_MSG_CMDLINE_INFO, (void *)(&msg));
edje_object_part_text_unescaped_set(gui->cmdline.obj, "eovim.cmdline.text",
edje_object_part_text_unescaped_set(gui->edje,
"eovim.cmdline:eovim.cmdline.text",
content);

/* Show the completion panel */
Expand All @@ -1020,7 +1018,8 @@ gui_cmdline_cursor_pos_set(s_gui *gui,
size_t pos)
{
gui->cmdline.cpos = pos;
edje_object_part_text_cursor_pos_set(gui->cmdline.obj, "eovim.cmdline.text",
edje_object_part_text_cursor_pos_set(gui->edje,
"eovim.cmdline:eovim.cmdline.text",
EDJE_CURSOR_MAIN, (int)pos);
}

Expand Down Expand Up @@ -1206,9 +1205,8 @@ _wildmenu_resize(s_gui *gui)
int item_height;
evas_object_geometry_get(track, NULL, NULL, NULL, &item_height);

int win_h, info_x, info_y, info_h, menu_w;
int win_h, menu_w;
evas_object_geometry_get(gui->win, NULL, NULL, NULL, &win_h);
evas_object_geometry_get(gui->cmdline.info, &info_x, &info_y, NULL, &info_h);
evas_object_geometry_get(gui->cmdline.table, NULL, NULL, &menu_w, NULL);

const int height = item_height * (int)(gui->cmdline.items_count) + 2;
Expand Down
2 changes: 0 additions & 2 deletions src/include/eovim/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ struct gui
} completion;

struct {
Evas_Object *obj;
Evas_Object *info;
Evas_Object *menu;
Evas_Object *table;
Evas_Object *spacer;
Expand Down

0 comments on commit 2e68483

Please sign in to comment.