forked from enlightenment/enlightenment
parent
886a0bca01
commit
1231a05e4a
|
@ -17,13 +17,7 @@ struct _E_Config_Dialog_Data
|
|||
} gui;
|
||||
};
|
||||
|
||||
struct _Disable_Array
|
||||
{
|
||||
int size;
|
||||
Evas_Object **obj_array;
|
||||
};
|
||||
|
||||
struct _Disable_Array show_label_array;
|
||||
Eina_List *show_label_list = NULL;
|
||||
|
||||
/* Protos */
|
||||
static void *_create_data(E_Config_Dialog *cfd);
|
||||
|
@ -31,7 +25,7 @@ static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|||
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static void _cb_disable_check(void *data, Evas_Object *obj);
|
||||
static void _cb_disable_check_array(void *data, Evas_Object *obj);
|
||||
static void _cb_disable_check_list(void *data, Evas_Object *obj);
|
||||
|
||||
static void _cb_zone_policy_change(void *data, Evas_Object *obj);
|
||||
|
||||
|
@ -76,10 +70,6 @@ _create_data(E_Config_Dialog *cfd)
|
|||
E_Config_Dialog_Data *cfdata;
|
||||
Config_Item *ci;
|
||||
|
||||
// define the number of items in the "Show Icon Label" radio group
|
||||
show_label_array.size = 5;
|
||||
show_label_array.obj_array = malloc (sizeof(Evas_Object*) * show_label_array.size);
|
||||
|
||||
ci = cfd->data;
|
||||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||
_fill_data(ci, cfdata);
|
||||
|
@ -89,9 +79,16 @@ _create_data(E_Config_Dialog *cfd)
|
|||
static void
|
||||
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Eina_List *l = NULL;
|
||||
|
||||
// delete the list
|
||||
for (l = show_label_list; l; l = eina_list_next(l))
|
||||
{
|
||||
show_label_list = eina_list_remove_list(show_label_list, l);
|
||||
}
|
||||
|
||||
ibox_config->config_dialog = eina_list_remove(ibox_config->config_dialog, cfd);
|
||||
free(cfdata);
|
||||
free(show_label_array.obj_array);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
|
@ -113,31 +110,31 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
|
||||
ob = e_widget_radio_add(evas, _("Display Name"), 0, rg);
|
||||
e_widget_disabled_set(ob, !cfdata->show_label); // set state from saved config
|
||||
show_label_array.obj_array[0] = ob;
|
||||
show_label_list = eina_list_append (show_label_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_radio_add(evas, _("Display Title"), 1, rg);
|
||||
e_widget_disabled_set(ob, !cfdata->show_label); // set state from saved config
|
||||
show_label_array.obj_array[1] = ob;
|
||||
show_label_list = eina_list_append (show_label_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_radio_add(evas, _("Display Class"), 2, rg);
|
||||
e_widget_disabled_set(ob, !cfdata->show_label); // set state from saved config
|
||||
show_label_array.obj_array[2] = ob;
|
||||
show_label_list = eina_list_append (show_label_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_radio_add(evas, _("Display Icon Name"), 3, rg);
|
||||
e_widget_disabled_set(ob, !cfdata->show_label); // set state from saved config
|
||||
show_label_array.obj_array[3] = ob;
|
||||
show_label_list = eina_list_append (show_label_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_radio_add(evas, _("Display Border Caption"), 4, rg);
|
||||
e_widget_disabled_set(ob, !cfdata->show_label); // set state from saved config
|
||||
show_label_array.obj_array[4] = ob;
|
||||
show_label_list = eina_list_append (show_label_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
// handler for enable/disable widget array
|
||||
e_widget_on_change_hook_set(show_check, _cb_disable_check_array, &show_label_array);
|
||||
e_widget_on_change_hook_set(show_check, _cb_disable_check_list, show_label_list);
|
||||
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
|
||||
|
@ -240,20 +237,20 @@ _cb_disable_check(void *data, Evas_Object *obj)
|
|||
}
|
||||
|
||||
/*!
|
||||
* @param data A struct _Disable_Array to chain together with the checkbox
|
||||
* @param data A Eina_List of Evas_Object to chain widgets together with the checkbox
|
||||
* @param obj A Evas_Object checkbox created with e_widget_check_add()
|
||||
*/
|
||||
static void
|
||||
_cb_disable_check_array(void *data, Evas_Object *obj)
|
||||
_cb_disable_check_list(void *data, Evas_Object *obj)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
struct _Disable_Array *disable_array = (struct _Disable_Array*) data;
|
||||
Eina_List *list = (Eina_List*) data;
|
||||
Eina_List *l = NULL;
|
||||
Evas_Object *o = NULL;
|
||||
|
||||
if (data <= 0) return;
|
||||
for (l = list, o = eina_list_data_get(l); l; l = eina_list_next(l),
|
||||
o = eina_list_data_get(l))
|
||||
|
||||
for (i = 0; i < disable_array->size; ++i)
|
||||
{
|
||||
e_widget_disabled_set(disable_array->obj_array[i],
|
||||
!e_widget_check_checked_get(obj));
|
||||
e_widget_disabled_set(o, !e_widget_check_checked_get(obj));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue