forked from enlightenment/enlightenment
e17: reveal next selected item after delete in key and mousebindings
get ilist_cound before use in loops, when commands are queued it will be counted each time. SVN revision: 57793
This commit is contained in:
parent
e4d3144cac
commit
4f65b168d9
|
@ -446,15 +446,12 @@ _delete_key_binding_cb(void *data,
|
|||
|
||||
_update_key_binding_list(cfdata, NULL);
|
||||
|
||||
/* FIXME this wont work here as the list will be created when ilist queue is
|
||||
done an ilist_count will always return 0 here */
|
||||
if (sel >= e_widget_ilist_count(cfdata->gui.o_binding_list))
|
||||
sel = e_widget_ilist_count(cfdata->gui.o_binding_list) - 1;
|
||||
|
||||
eina_stringshare_del(cfdata->locals.cur);
|
||||
cfdata->locals.cur = NULL;
|
||||
|
||||
e_widget_ilist_selected_set(cfdata->gui.o_binding_list, sel);
|
||||
if (sel < 0)
|
||||
{
|
||||
e_widget_ilist_unselect(cfdata->gui.o_action_list);
|
||||
|
@ -462,6 +459,11 @@ _delete_key_binding_cb(void *data,
|
|||
e_widget_disabled_set(cfdata->gui.o_params, 1);
|
||||
_update_buttons(cfdata);
|
||||
}
|
||||
else
|
||||
{
|
||||
e_widget_ilist_selected_set(cfdata->gui.o_binding_list, sel);
|
||||
e_widget_ilist_nth_show(cfdata->gui.o_binding_list, sel, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -652,7 +654,7 @@ static void
|
|||
_update_action_list(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Binding_Key *bi;
|
||||
int j = -1, i, n;
|
||||
int j = -1, i, n, cnt;
|
||||
const char *action, *params;
|
||||
|
||||
if (!cfdata->locals.cur) return;
|
||||
|
@ -678,7 +680,8 @@ _update_action_list(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (j >= 0)
|
||||
{
|
||||
for (i = 0; i < e_widget_ilist_count(cfdata->gui.o_action_list); i++)
|
||||
cnt = e_widget_ilist_count(cfdata->gui.o_action_list);
|
||||
for (i = 0; i < cnt; i++)
|
||||
{
|
||||
if (i > j) break;
|
||||
if (e_widget_ilist_nth_is_header(cfdata->gui.o_action_list, i)) j++;
|
||||
|
|
|
@ -535,7 +535,6 @@ _delete_mouse_binding_cb(void *data, void *data2 __UNUSED__)
|
|||
if (sel >= e_widget_ilist_count(cfdata->gui.o_binding_list))
|
||||
sel = e_widget_ilist_count(cfdata->gui.o_binding_list) - 1;
|
||||
|
||||
|
||||
eina_stringshare_del(cfdata->locals.cur);
|
||||
cfdata->locals.cur = NULL;
|
||||
|
||||
|
@ -552,6 +551,7 @@ _delete_mouse_binding_cb(void *data, void *data2 __UNUSED__)
|
|||
{
|
||||
if (e_widget_ilist_nth_is_header(cfdata->gui.o_binding_list, sel)) sel++;
|
||||
e_widget_ilist_selected_set(cfdata->gui.o_binding_list, sel);
|
||||
e_widget_ilist_nth_show(cfdata->gui.o_binding_list, sel, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -645,7 +645,7 @@ _cb_adv_categories_change(void *data, Evas_Object *obj __UNUSED__)
|
|||
Eina_List *themes = NULL;
|
||||
E_Config_Theme *t;
|
||||
Evas_Object *ic = NULL;
|
||||
int n;
|
||||
int n, cnt;
|
||||
|
||||
if (!(cfdata = data)) return;
|
||||
|
||||
|
@ -671,7 +671,8 @@ _cb_adv_categories_change(void *data, Evas_Object *obj __UNUSED__)
|
|||
}
|
||||
if (!file) return;
|
||||
|
||||
for (n = 0; n < e_widget_ilist_count(cfdata->o_files_ilist); n++)
|
||||
cnt = e_widget_ilist_count(cfdata->o_files_ilist);
|
||||
for (n = 0; n < cnt; n++)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
|
@ -843,7 +844,7 @@ _cb_adv_btn_assign(void *data1, void *data2 __UNUSED__)
|
|||
Evas_Object *ic = NULL, *oc = NULL, *of = NULL;
|
||||
char buf[1024];
|
||||
const char *label;
|
||||
int n;
|
||||
int n, cnt;
|
||||
|
||||
if (!(cfdata = data1)) return;
|
||||
|
||||
|
@ -882,7 +883,8 @@ _cb_adv_btn_assign(void *data1, void *data2 __UNUSED__)
|
|||
|
||||
if (!_theme_file_used(cfdata->theme_list, filename))
|
||||
{
|
||||
for (n = 0; n < e_widget_ilist_count(of); n++)
|
||||
cnt = e_widget_ilist_count(of);
|
||||
for (n = 0; n < cnt; n++)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
|
@ -920,7 +922,7 @@ _cb_adv_btn_clear(void *data1, void *data2 __UNUSED__)
|
|||
char cat[1024];
|
||||
const char *label;
|
||||
const char *filename = NULL;
|
||||
int n;
|
||||
int n, cnt;
|
||||
|
||||
if (!(cfdata = data1)) return;
|
||||
|
||||
|
@ -948,7 +950,8 @@ _cb_adv_btn_clear(void *data1, void *data2 __UNUSED__)
|
|||
|
||||
if ((filename) && (!_theme_file_used(cfdata->theme_list, filename)))
|
||||
{
|
||||
for (n = 0; n < e_widget_ilist_count(of); n++)
|
||||
cnt = e_widget_ilist_count(of);
|
||||
for (n = 0; n < cnt; n++)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
|
|
Loading…
Reference in New Issue