forked from enlightenment/enlightenment
gadcons now can have their contents enabled/disabled depending on what is
providing it. SVN revision: 22478
This commit is contained in:
parent
18216427be
commit
851d41c010
|
@ -49,6 +49,7 @@ static void e_gadcon_layout_pack_aspect_pad_set(Evas_Object *obj, int w, int h);
|
||||||
static void e_gadcon_layout_unpack(Evas_Object *obj);
|
static void e_gadcon_layout_unpack(Evas_Object *obj);
|
||||||
|
|
||||||
static Evas_Hash *providers = NULL;
|
static Evas_Hash *providers = NULL;
|
||||||
|
static Evas_List *providers_list = NULL;
|
||||||
static Evas_List *gadcons = NULL;
|
static Evas_List *gadcons = NULL;
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
|
@ -71,6 +72,7 @@ e_gadcon_provider_register(E_Gadcon_Client_Class *cc)
|
||||||
E_Gadcon *gc;
|
E_Gadcon *gc;
|
||||||
|
|
||||||
providers = evas_hash_direct_add(providers, cc->name, cc);
|
providers = evas_hash_direct_add(providers, cc->name, cc);
|
||||||
|
providers_list = evas_list_append(providers_list, cc);
|
||||||
for (l = gadcons; l; l = l->next)
|
for (l = gadcons; l; l = l->next)
|
||||||
{
|
{
|
||||||
gc = l->data;
|
gc = l->data;
|
||||||
|
@ -102,6 +104,13 @@ e_gadcon_provider_unregister(E_Gadcon_Client_Class *cc)
|
||||||
e_object_del(E_OBJECT(gcc));
|
e_object_del(E_OBJECT(gcc));
|
||||||
}
|
}
|
||||||
providers = evas_hash_del(providers, cc->name, cc);
|
providers = evas_hash_del(providers, cc->name, cc);
|
||||||
|
providers_list = evas_list_remove(providers_list, cc);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Evas_List *
|
||||||
|
e_gadcon_provider_list(void)
|
||||||
|
{
|
||||||
|
return providers_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI E_Gadcon *
|
EAPI E_Gadcon *
|
||||||
|
@ -213,6 +222,7 @@ e_gadcon_populate(E_Gadcon *gc)
|
||||||
E_Gadcon_Client_Class *cc;
|
E_Gadcon_Client_Class *cc;
|
||||||
|
|
||||||
cf_gcc = l->data;
|
cf_gcc = l->data;
|
||||||
|
if (!cf_gcc->name) continue;
|
||||||
cc = evas_hash_find(providers, cf_gcc->name);
|
cc = evas_hash_find(providers, cf_gcc->name);
|
||||||
if (cc)
|
if (cc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,6 +124,7 @@ EAPI int e_gadcon_init(void);
|
||||||
EAPI int e_gadcon_shutdown(void);
|
EAPI int e_gadcon_shutdown(void);
|
||||||
EAPI void e_gadcon_provider_register(E_Gadcon_Client_Class *cc);
|
EAPI void e_gadcon_provider_register(E_Gadcon_Client_Class *cc);
|
||||||
EAPI void e_gadcon_provider_unregister(E_Gadcon_Client_Class *cc);
|
EAPI void e_gadcon_provider_unregister(E_Gadcon_Client_Class *cc);
|
||||||
|
EAPI Evas_List *e_gadcon_provider_list(void);
|
||||||
EAPI E_Gadcon *e_gadcon_swallowed_new(const char *name, char *id, Evas_Object *obj, char *swallow_name);
|
EAPI E_Gadcon *e_gadcon_swallowed_new(const char *name, char *id, Evas_Object *obj, char *swallow_name);
|
||||||
EAPI void e_gadcon_swallowed_min_size_set(E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
EAPI void e_gadcon_swallowed_min_size_set(E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||||
EAPI void e_gadcon_min_size_request_callback_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h), void *data);
|
EAPI void e_gadcon_min_size_request_callback_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h), void *data);
|
||||||
|
|
|
@ -250,8 +250,8 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
Evas_Object *o, *of, *ob, *ot, *ilist, *mt;
|
Evas_Object *o, *of, *ob, *ot, *ilist, *mt;
|
||||||
E_Radio_Group *rg;
|
E_Radio_Group *rg;
|
||||||
E_Module *m;
|
E_Module *m;
|
||||||
|
Evas_List *l;
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
int i;
|
|
||||||
|
|
||||||
o = e_widget_list_add(evas, 1, 0);
|
o = e_widget_list_add(evas, 1, 0);
|
||||||
ot = e_widget_table_add(evas, 1);
|
ot = e_widget_table_add(evas, 1);
|
||||||
|
@ -262,12 +262,12 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
e_widget_on_change_hook_set(ilist, _ilist_cb_change, cfdata);
|
e_widget_on_change_hook_set(ilist, _ilist_cb_change, cfdata);
|
||||||
|
|
||||||
cfdata->state = -1;
|
cfdata->state = -1;
|
||||||
for (i = 0; i < evas_list_count(cfdata->modules); i++)
|
for (l = cfdata->modules; l; l = l->next)
|
||||||
{
|
{
|
||||||
CFModule *cm;
|
CFModule *cm;
|
||||||
Evas_Object *oc;
|
Evas_Object *oc;
|
||||||
|
|
||||||
cm = evas_list_nth(cfdata->modules, i);
|
cm = l->data;
|
||||||
if (cm)
|
if (cm)
|
||||||
{
|
{
|
||||||
cm->state = MOD_UNLOADED;
|
cm->state = MOD_UNLOADED;
|
||||||
|
|
|
@ -13,6 +13,9 @@ static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Co
|
||||||
struct _E_Config_Dialog_Data
|
struct _E_Config_Dialog_Data
|
||||||
{
|
{
|
||||||
E_Gadcon *gc;
|
E_Gadcon *gc;
|
||||||
|
char *cname;
|
||||||
|
int enabled;
|
||||||
|
Evas_Object *o_enabled, *o_disabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* a nice easy setup function that does the dirty work */
|
/* a nice easy setup function that does the dirty work */
|
||||||
|
@ -43,27 +46,7 @@ e_int_gadcon_config(E_Gadcon *gc)
|
||||||
static void
|
static void
|
||||||
_fill_data(E_Config_Dialog_Data *cfdata)
|
_fill_data(E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
/*
|
cfdata->cname = NULL;
|
||||||
if (cfdata->escfg->style)
|
|
||||||
cfdata->style = strdup(cfdata->escfg->style);
|
|
||||||
else
|
|
||||||
cfdata->style = strdup("");
|
|
||||||
cfdata->orient = cfdata->escfg->orient;
|
|
||||||
cfdata->fit_along = cfdata->escfg->fit_along;
|
|
||||||
cfdata->fit_size = cfdata->escfg->fit_size;
|
|
||||||
cfdata->size = cfdata->escfg->size;
|
|
||||||
if ((!cfdata->escfg->popup) &&
|
|
||||||
(cfdata->escfg->layer == 1))
|
|
||||||
cfdata->layering = 0;
|
|
||||||
else if ((cfdata->escfg->popup) &&
|
|
||||||
(cfdata->escfg->layer == 0))
|
|
||||||
cfdata->layering = 1;
|
|
||||||
else if ((cfdata->escfg->popup) &&
|
|
||||||
(cfdata->escfg->layer == 200))
|
|
||||||
cfdata->layering = 2;
|
|
||||||
else
|
|
||||||
cfdata->layering = 2;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -86,7 +69,7 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
/* Free the cfdata */
|
/* Free the cfdata */
|
||||||
cfdata->gc->config_dialog = NULL;
|
cfdata->gc->config_dialog = NULL;
|
||||||
// if (cfdata->style) free(cfdata->style);
|
if (cfdata->cname) free(cfdata->cname);
|
||||||
free(cfdata);
|
free(cfdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,52 +77,94 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
static int
|
static int
|
||||||
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
/*
|
Evas_List *l;
|
||||||
E_Zone *zone;
|
E_Config_Gadcon *cf_gc;
|
||||||
int id;
|
E_Config_Gadcon_Client *cf_gcc;
|
||||||
|
int ok = 0;
|
||||||
|
|
||||||
cfdata->escfg->orient = cfdata->orient;
|
|
||||||
cfdata->escfg->fit_along = cfdata->fit_along;
|
|
||||||
cfdata->escfg->fit_size = cfdata->fit_size;
|
|
||||||
cfdata->escfg->size = cfdata->size;
|
|
||||||
|
|
||||||
if (cfdata->escfg->style) evas_stringshare_del(cfdata->escfg->style);
|
|
||||||
cfdata->escfg->style = evas_stringshare_add(cfdata->style);
|
|
||||||
if (cfdata->layering == 0)
|
|
||||||
{
|
|
||||||
cfdata->escfg->popup = 0;
|
|
||||||
cfdata->escfg->layer = 1;
|
|
||||||
}
|
|
||||||
else if (cfdata->layering == 1)
|
|
||||||
{
|
|
||||||
cfdata->escfg->popup = 1;
|
|
||||||
cfdata->escfg->layer = 0;
|
|
||||||
}
|
|
||||||
else if (cfdata->layering == 2)
|
|
||||||
{
|
|
||||||
cfdata->escfg->popup = 1;
|
|
||||||
cfdata->escfg->layer = 200;
|
|
||||||
}
|
|
||||||
zone = cfdata->es->zone;
|
|
||||||
id = cfdata->es->id;
|
|
||||||
cfdata->es->config_dialog = NULL;
|
|
||||||
e_object_del(E_OBJECT(cfdata->es));
|
|
||||||
cfdata->es = e_shelf_zone_new(zone, cfdata->escfg->name,
|
|
||||||
cfdata->escfg->style,
|
|
||||||
cfdata->escfg->popup,
|
|
||||||
cfdata->escfg->layer, id);
|
|
||||||
cfdata->es->cfg = cfdata->escfg;
|
|
||||||
cfdata->es->fit_along = cfdata->escfg->fit_along;
|
|
||||||
cfdata->es->fit_size = cfdata->escfg->fit_size;
|
|
||||||
e_shelf_orient(cfdata->es, cfdata->escfg->orient);
|
|
||||||
e_shelf_position_calc(cfdata->es);
|
|
||||||
e_shelf_populate(cfdata->es);
|
|
||||||
e_shelf_show(cfdata->es);
|
|
||||||
e_config_save_queue();
|
|
||||||
*/
|
|
||||||
cfdata->gc->config_dialog = cfd;
|
cfdata->gc->config_dialog = cfd;
|
||||||
|
for (l = e_config->gadcons; l; l = l->next)
|
||||||
|
{
|
||||||
|
cf_gc = l->data;
|
||||||
|
if ((!strcmp(cf_gc->name, cfdata->gc->name)) &&
|
||||||
|
(!strcmp(cf_gc->id, cfdata->gc->id)))
|
||||||
|
{
|
||||||
|
ok = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!ok) return;
|
||||||
|
for (l = cf_gc->clients; l; l = l->next)
|
||||||
|
{
|
||||||
|
cf_gcc = l->data;
|
||||||
|
if (!cf_gcc->name) continue;
|
||||||
|
if (!strcmp(cf_gcc->name, cfdata->cname))
|
||||||
|
{
|
||||||
|
if (!cfdata->enabled)
|
||||||
|
{
|
||||||
|
/* remove from list */
|
||||||
|
cf_gc->clients = evas_list_remove_list(cf_gc->clients, l);
|
||||||
|
if (cf_gcc->name) evas_stringshare_del(cf_gcc->name);
|
||||||
|
if (cf_gcc->id) evas_stringshare_del(cf_gcc->id);
|
||||||
|
if (cf_gcc->style) evas_stringshare_del(cf_gcc->style);
|
||||||
|
free(cf_gcc);
|
||||||
|
goto savedone;
|
||||||
|
}
|
||||||
return 1; /* Apply was OK */
|
return 1; /* Apply was OK */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
cf_gcc = E_NEW(E_Config_Gadcon_Client, 1);
|
||||||
|
cf_gcc->name = evas_stringshare_add(cfdata->cname);
|
||||||
|
cf_gcc->id = evas_stringshare_add("default");
|
||||||
|
cf_gcc->geom.res = 800;
|
||||||
|
cf_gcc->geom.size = 80;
|
||||||
|
cf_gcc->geom.pos = cf_gcc->geom.res - cf_gcc->geom.size;
|
||||||
|
cf_gcc->autoscroll = 0;
|
||||||
|
cf_gcc->resizable = 0;
|
||||||
|
cf_gc->clients = evas_list_append(cf_gc->clients, cf_gcc);
|
||||||
|
savedone:
|
||||||
|
e_gadcon_unpopulate(cfdata->gc);
|
||||||
|
e_gadcon_populate(cfdata->gc);
|
||||||
|
e_config_save_queue();
|
||||||
|
return 1; /* Apply was OK */
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_cb_select(void *data)
|
||||||
|
{
|
||||||
|
E_Config_Dialog_Data *cfdata;
|
||||||
|
Evas_List *l;
|
||||||
|
E_Config_Gadcon *cf_gc;
|
||||||
|
E_Config_Gadcon_Client *cf_gcc;
|
||||||
|
int ok = 0, enabled = 0;
|
||||||
|
|
||||||
|
cfdata = data;
|
||||||
|
for (l = e_config->gadcons; l; l = l->next)
|
||||||
|
{
|
||||||
|
cf_gc = l->data;
|
||||||
|
if ((!strcmp(cf_gc->name, cfdata->gc->name)) &&
|
||||||
|
(!strcmp(cf_gc->id, cfdata->gc->id)))
|
||||||
|
{
|
||||||
|
ok = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!ok) return;
|
||||||
|
for (l = cf_gc->clients; l; l = l->next)
|
||||||
|
{
|
||||||
|
cf_gcc = l->data;
|
||||||
|
if (!cf_gcc->name) continue;
|
||||||
|
if (!strcmp(cf_gcc->name, cfdata->cname))
|
||||||
|
{
|
||||||
|
enabled = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
e_widget_disabled_set(cfdata->o_enabled, 0);
|
||||||
|
e_widget_disabled_set(cfdata->o_disabled, 0);
|
||||||
|
e_widget_radio_toggle_set(cfdata->o_enabled, enabled);
|
||||||
|
e_widget_radio_toggle_set(cfdata->o_disabled, 1 - enabled);
|
||||||
|
}
|
||||||
|
|
||||||
/**--GUI--**/
|
/**--GUI--**/
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
|
@ -155,84 +180,42 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
/* FIXME: this is just raw config now - it needs UI improvments */
|
/* FIXME: this is just raw config now - it needs UI improvments */
|
||||||
o = e_widget_list_add(evas, 0, 1);
|
o = e_widget_list_add(evas, 0, 1);
|
||||||
|
|
||||||
/*
|
of = e_widget_framelist_add(evas, _("Available Items"), 0);
|
||||||
o2 = e_widget_list_add(evas, 0, 0);
|
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Stacking"), 0);
|
oi = e_widget_ilist_add(evas, 24, 24, &(cfdata->cname));
|
||||||
rg = e_widget_radio_group_new(&(cfdata->layering));
|
|
||||||
ob = e_widget_radio_add(evas, _("Above Everything"), 2, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Below Windows"), 1, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Below Everything"), 0, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Size"), 0);
|
for (l = e_gadcon_provider_list(); l; l = l->next)
|
||||||
ob = e_widget_check_add(evas, _("Shrink length fit contents"), &(cfdata->fit_along));
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_label_add(evas, _("Shelf Size"));
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_slider_add(evas, 1, 0, _("%3.0f pixels"), 4, 120, 4, 0, NULL, &(cfdata->size), 200);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Layout"), 0);
|
|
||||||
rg = e_widget_radio_group_new(&(cfdata->orient));
|
|
||||||
ob = e_widget_radio_add(evas, _("Left"), E_GADCON_ORIENT_LEFT, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Right"), E_GADCON_ORIENT_RIGHT, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Top"), E_GADCON_ORIENT_TOP, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Bottom"), E_GADCON_ORIENT_BOTTOM, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Top Left"), E_GADCON_ORIENT_CORNER_TL, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Top Right"), E_GADCON_ORIENT_CORNER_TR, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Bottom Left"), E_GADCON_ORIENT_CORNER_BL, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Bottom Right"), E_GADCON_ORIENT_CORNER_BR, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Left Top"), E_GADCON_ORIENT_CORNER_LT, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Right Top"), E_GADCON_ORIENT_CORNER_RT, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Left Bottom"), E_GADCON_ORIENT_CORNER_LB, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
ob = e_widget_radio_add(evas, _("Right Bottom"), E_GADCON_ORIENT_CORNER_RB, rg);
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
|
||||||
|
|
||||||
e_widget_list_object_append(o, o2, 1, 1, 0.5);
|
|
||||||
|
|
||||||
oi = e_widget_ilist_add(evas, 128, 20, &(cfdata->style));
|
|
||||||
|
|
||||||
sel = 0;
|
|
||||||
styles = e_theme_shelf_list();
|
|
||||||
|
|
||||||
for (n = 0, l = styles; l; l = l->next, n++)
|
|
||||||
{
|
{
|
||||||
char buf[4096];
|
E_Gadcon_Client_Class *cc;
|
||||||
|
|
||||||
ob = e_livethumb_add(evas);
|
cc = l->data;
|
||||||
e_livethumb_vsize_set(ob, 256, 40);
|
/* FIXME: need icon */
|
||||||
oj = edje_object_add(e_livethumb_evas_get(ob));
|
e_widget_ilist_append(oi, NULL, cc->name, _cb_select, cfdata, cc->name);
|
||||||
snprintf(buf, sizeof(buf), "shelf/%s/base", (char *)l->data);
|
|
||||||
e_theme_edje_object_set(oj, "base/theme/shelf", buf);
|
|
||||||
e_livethumb_thumb_set(ob, oj);
|
|
||||||
e_widget_ilist_append(oi, ob, (char *)l->data, NULL, NULL, l->data);
|
|
||||||
if (!strcmp(cfdata->es->style, (char *)l->data))
|
|
||||||
sel = n;
|
|
||||||
}
|
}
|
||||||
e_widget_min_size_get(oi, &wmw, &wmh);
|
|
||||||
e_widget_min_size_set(oi, wmw, 250);
|
|
||||||
|
|
||||||
e_widget_ilist_go(oi);
|
e_widget_ilist_go(oi);
|
||||||
e_widget_ilist_selected_set(oi, sel);
|
|
||||||
|
|
||||||
e_widget_list_object_append(o, oi, 1, 1, 0.5);
|
e_widget_min_size_get(oi, &wmw, &wmh);
|
||||||
*/
|
if (wmw < 200) wmw = 200;
|
||||||
|
e_widget_min_size_set(oi, wmw, 250);
|
||||||
|
|
||||||
|
e_widget_framelist_object_append(of, oi);
|
||||||
|
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Status"), 0);
|
||||||
|
|
||||||
|
rg = e_widget_radio_group_new(&(cfdata->enabled));
|
||||||
|
ob = e_widget_radio_add(evas, _("Enabled"), 1, rg);
|
||||||
|
e_widget_disabled_set(ob, 1);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
cfdata->o_enabled = ob;
|
||||||
|
ob = e_widget_radio_add(evas, _("Disabled"), 0, rg);
|
||||||
|
e_widget_disabled_set(ob, 1);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
cfdata->o_disabled = ob;
|
||||||
|
|
||||||
|
e_widget_list_object_append(o, of, 0, 0, 0.0);
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,14 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
return 1; /* Apply was OK */
|
return 1; /* Apply was OK */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_cb_configure(void *data, void *data2)
|
||||||
|
{
|
||||||
|
E_Config_Dialog_Data *cfdata;
|
||||||
|
|
||||||
|
e_int_gadcon_config(cfdata->es->gadcon);
|
||||||
|
}
|
||||||
|
|
||||||
/**--GUI--**/
|
/**--GUI--**/
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||||
|
@ -212,6 +220,10 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
|
|
||||||
e_widget_list_object_append(o, o2, 1, 1, 0.5);
|
e_widget_list_object_append(o, o2, 1, 1, 0.5);
|
||||||
|
|
||||||
|
o2 = e_widget_list_add(evas, 0, 0);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Styles"), 0);
|
||||||
|
|
||||||
oi = e_widget_ilist_add(evas, 128, 20, &(cfdata->style));
|
oi = e_widget_ilist_add(evas, 128, 20, &(cfdata->style));
|
||||||
|
|
||||||
sel = 0;
|
sel = 0;
|
||||||
|
@ -237,7 +249,14 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
e_widget_ilist_go(oi);
|
e_widget_ilist_go(oi);
|
||||||
e_widget_ilist_selected_set(oi, sel);
|
e_widget_ilist_selected_set(oi, sel);
|
||||||
|
|
||||||
e_widget_list_object_append(o, oi, 1, 1, 0.5);
|
e_widget_framelist_object_append(of, oi);
|
||||||
|
|
||||||
|
e_widget_list_object_append(o2, of, 0, 0, 0.5);
|
||||||
|
|
||||||
|
ob = e_widget_button_add(evas, _("Configure Contents..."), "widget/config", _cb_configure, cfdata, NULL);
|
||||||
|
e_widget_list_object_append(o2, ob, 0, 0, 0.5);
|
||||||
|
|
||||||
|
e_widget_list_object_append(o, o2, 0, 0, 0.0);
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,29 @@ e_widget_radio_toggle_set(Evas_Object *obj, int toggle)
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
if (toggle)
|
if (toggle)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
int toggled = 0;
|
||||||
|
|
||||||
|
for (l = wd->group->radios; l; l = l->next)
|
||||||
|
{
|
||||||
|
wd = e_widget_data_get(l->data);
|
||||||
|
if (l->data != obj)
|
||||||
|
{
|
||||||
|
wd = e_widget_data_get(l->data);
|
||||||
|
if (wd->valnum == *(wd->group->valptr))
|
||||||
|
{
|
||||||
|
edje_object_signal_emit(wd->o_radio, "toggle_off", "");
|
||||||
|
toggled = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!toggled) return;
|
||||||
|
wd = e_widget_data_get(obj);
|
||||||
|
*(wd->group->valptr) = wd->valnum;
|
||||||
edje_object_signal_emit(wd->o_radio, "toggle_on", "");
|
edje_object_signal_emit(wd->o_radio, "toggle_on", "");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
edje_object_signal_emit(wd->o_radio, "toggle_off", "");
|
edje_object_signal_emit(wd->o_radio, "toggle_off", "");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue