2006-04-22 23:56:22 -07:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
#include "e.h"
|
|
|
|
|
|
|
|
/* PROTOTYPES - same all the time */
|
|
|
|
static void *_create_data(E_Config_Dialog *cfd);
|
|
|
|
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
|
|
static int _basic_apply_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);
|
2006-06-02 19:27:13 -07:00
|
|
|
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
|
|
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
2009-04-16 14:03:43 -07:00
|
|
|
static void _cb_disable_check_list(void *data, Evas_Object *obj);
|
2009-10-02 13:53:05 -07:00
|
|
|
static void _calibrate_binginds(void);
|
2006-04-22 23:56:22 -07:00
|
|
|
|
2009-07-23 18:56:00 -07:00
|
|
|
#define MODE_CUSTOM 0
|
|
|
|
#define MODE_BOTTOM_MIDDLE 1
|
|
|
|
#define MODE_BOTTOM_ALL 2
|
|
|
|
#define MODE_BOTTOM_DESKTOP 3
|
|
|
|
#define MODE_TOP_ALL 4
|
|
|
|
#define MODE_TOP_DESKTOP 5
|
2006-06-16 01:20:36 -07:00
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
/* Actual config data we will be playing with whil the dialog is active */
|
|
|
|
struct _E_Config_Dialog_Data
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
E_Config_Shelf *escfg;
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2006-06-16 01:20:36 -07:00
|
|
|
/* BASIC */
|
|
|
|
int mode;
|
2006-09-19 18:01:52 -07:00
|
|
|
int basic_size;
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2006-06-16 01:20:36 -07:00
|
|
|
/* ADVANCED */
|
2009-03-11 08:13:42 -07:00
|
|
|
const char *style;
|
2006-04-22 23:56:22 -07:00
|
|
|
int orient;
|
|
|
|
int fit_along;
|
|
|
|
int fit_size;
|
|
|
|
int size;
|
|
|
|
int layering;
|
2006-10-01 13:10:37 -07:00
|
|
|
int overlapping;
|
2007-03-02 09:00:20 -08:00
|
|
|
int autohiding;
|
2007-06-10 04:01:41 -07:00
|
|
|
int autohiding_show_action;
|
2007-04-11 08:37:04 -07:00
|
|
|
double hide_timeout;
|
|
|
|
double hide_duration;
|
2007-09-04 16:59:01 -07:00
|
|
|
|
|
|
|
int desk_show_mode;
|
2009-04-18 06:47:29 -07:00
|
|
|
Eina_List *desk_list;
|
|
|
|
Eina_List *autohide_list;
|
2007-09-04 16:59:01 -07:00
|
|
|
|
|
|
|
Evas_Object *desk_sel_list;
|
2006-04-28 20:51:27 -07:00
|
|
|
};
|
2006-04-22 23:56:22 -07:00
|
|
|
|
2009-04-16 14:03:43 -07:00
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
/* a nice easy setup function that does the dirty work */
|
|
|
|
EAPI void
|
|
|
|
e_int_shelf_config(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_Config_Dialog *cfd;
|
|
|
|
E_Config_Dialog_View *v;
|
|
|
|
|
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
if (!v) return;
|
|
|
|
|
|
|
|
/* methods */
|
|
|
|
v->create_cfdata = _create_data;
|
|
|
|
v->free_cfdata = _free_data;
|
|
|
|
v->basic.apply_cfdata = _basic_apply_data;
|
|
|
|
v->basic.create_widgets = _basic_create_widgets;
|
|
|
|
v->advanced.apply_cfdata = _advanced_apply_data;
|
|
|
|
v->advanced.create_widgets = _advanced_create_widgets;
|
|
|
|
|
|
|
|
v->override_auto_apply = 1;
|
2006-04-22 23:56:22 -07:00
|
|
|
|
2009-07-23 18:56:00 -07:00
|
|
|
/* create config diaolg for bd object/data */
|
|
|
|
cfd = e_config_dialog_new(es->zone->container,
|
|
|
|
_("Shelf Settings"),
|
|
|
|
"E", "_shelf_config_dialog",
|
|
|
|
"preferences-desktop-shelf", 0, v, es);
|
|
|
|
es->config_dialog = cfd;
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**--CREATE--**/
|
|
|
|
static void
|
|
|
|
_fill_data(E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
2006-06-16 01:20:36 -07:00
|
|
|
cfdata->mode = MODE_CUSTOM;
|
|
|
|
if ((cfdata->escfg->orient == E_GADCON_ORIENT_BOTTOM) &&
|
2009-07-23 18:56:00 -07:00
|
|
|
((cfdata->escfg->style) &&
|
|
|
|
(!strcmp(cfdata->escfg->style, "default"))) &&
|
2006-06-16 01:20:36 -07:00
|
|
|
(cfdata->escfg->fit_along == 1) &&
|
|
|
|
(cfdata->escfg->popup) &&
|
|
|
|
(cfdata->escfg->layer == 200))
|
|
|
|
cfdata->mode = MODE_BOTTOM_MIDDLE;
|
|
|
|
else
|
|
|
|
if ((cfdata->escfg->orient == E_GADCON_ORIENT_BOTTOM) &&
|
2009-07-23 18:56:00 -07:00
|
|
|
((cfdata->escfg->style) &&
|
|
|
|
(!strcmp(cfdata->escfg->style, "default"))) &&
|
2006-06-16 01:20:36 -07:00
|
|
|
(cfdata->escfg->fit_along == 0) &&
|
|
|
|
(cfdata->escfg->popup) &&
|
|
|
|
(cfdata->escfg->layer == 200))
|
|
|
|
cfdata->mode = MODE_BOTTOM_ALL;
|
|
|
|
else
|
|
|
|
if ((cfdata->escfg->orient == E_GADCON_ORIENT_BOTTOM) &&
|
2009-07-23 18:56:00 -07:00
|
|
|
((cfdata->escfg->style) &&
|
|
|
|
(!strcmp(cfdata->escfg->style, "invisible"))) &&
|
2006-06-16 01:20:36 -07:00
|
|
|
(cfdata->escfg->fit_along == 0) &&
|
|
|
|
(!cfdata->escfg->popup) &&
|
|
|
|
(cfdata->escfg->layer == 1))
|
|
|
|
cfdata->mode = MODE_BOTTOM_DESKTOP;
|
|
|
|
else
|
|
|
|
if ((cfdata->escfg->orient == E_GADCON_ORIENT_TOP) &&
|
2009-07-23 18:56:00 -07:00
|
|
|
((cfdata->escfg->style) &&
|
|
|
|
(!strcmp(cfdata->escfg->style, "default"))) &&
|
2006-06-16 01:20:36 -07:00
|
|
|
(cfdata->escfg->fit_along == 0) &&
|
|
|
|
(cfdata->escfg->popup) &&
|
|
|
|
(cfdata->escfg->layer == 200))
|
|
|
|
cfdata->mode = MODE_TOP_ALL;
|
|
|
|
else
|
|
|
|
if ((cfdata->escfg->orient == E_GADCON_ORIENT_TOP) &&
|
2009-07-23 18:56:00 -07:00
|
|
|
((cfdata->escfg->style) &&
|
|
|
|
(!strcmp(cfdata->escfg->style, "invisible"))) &&
|
2006-06-16 01:20:36 -07:00
|
|
|
(cfdata->escfg->fit_along == 0) &&
|
|
|
|
(!cfdata->escfg->popup) &&
|
|
|
|
(cfdata->escfg->layer == 1))
|
|
|
|
cfdata->mode = MODE_TOP_DESKTOP;
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
if (cfdata->escfg->style)
|
2009-03-11 08:13:42 -07:00
|
|
|
cfdata->style = eina_stringshare_ref(cfdata->escfg->style);
|
2006-04-22 23:56:22 -07:00
|
|
|
else
|
2009-03-11 08:13:42 -07:00
|
|
|
cfdata->style = eina_stringshare_add("");
|
2006-04-22 23:56:22 -07:00
|
|
|
cfdata->orient = cfdata->escfg->orient;
|
|
|
|
cfdata->fit_along = cfdata->escfg->fit_along;
|
|
|
|
cfdata->fit_size = cfdata->escfg->fit_size;
|
|
|
|
cfdata->size = cfdata->escfg->size;
|
2006-10-01 13:10:37 -07:00
|
|
|
cfdata->overlapping = cfdata->escfg->overlap;
|
2007-03-02 09:00:20 -08:00
|
|
|
cfdata->autohiding = cfdata->escfg->autohide;
|
2007-06-10 04:01:41 -07:00
|
|
|
cfdata->autohiding_show_action = cfdata->escfg->autohide_show_action;
|
2007-04-11 08:37:04 -07:00
|
|
|
cfdata->hide_timeout = cfdata->escfg->hide_timeout;
|
|
|
|
cfdata->hide_duration = cfdata->escfg->hide_duration;
|
2007-09-04 16:59:01 -07:00
|
|
|
cfdata->desk_show_mode = cfdata->escfg->desk_show_mode;
|
|
|
|
cfdata->desk_list = cfdata->escfg->desk_list;
|
2006-09-19 18:01:52 -07:00
|
|
|
if (cfdata->size <= 24)
|
|
|
|
cfdata->basic_size = 24;
|
|
|
|
else if (cfdata->size <= 32)
|
|
|
|
cfdata->basic_size = 32;
|
|
|
|
else if (cfdata->size <= 40)
|
|
|
|
cfdata->basic_size = 40;
|
|
|
|
else if (cfdata->size <= 48)
|
|
|
|
cfdata->basic_size = 48;
|
|
|
|
else if (cfdata->size >= 48)
|
|
|
|
cfdata->basic_size = 56;
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2007-09-04 16:59:01 -07:00
|
|
|
static void
|
|
|
|
_desk_sel_list_load(E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
Evas *evas;
|
|
|
|
int x, y;
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2007-09-04 16:59:01 -07:00
|
|
|
if (!cfdata->desk_sel_list) return;
|
|
|
|
evas = evas_object_evas_get(cfdata->desk_sel_list);
|
|
|
|
evas_event_freeze(evas);
|
|
|
|
edje_freeze();
|
|
|
|
e_widget_ilist_freeze(cfdata->desk_sel_list);
|
|
|
|
e_widget_ilist_clear(cfdata->desk_sel_list);
|
|
|
|
|
|
|
|
for (y = 0; y < e_config->zone_desks_y_count; y++)
|
|
|
|
for (x = 0; x < e_config->zone_desks_x_count; x++)
|
|
|
|
{
|
|
|
|
E_Desk *desk;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l = NULL;
|
2009-08-21 08:08:49 -07:00
|
|
|
E_Config_Shelf_Desk *sd;
|
2007-09-04 16:59:01 -07:00
|
|
|
|
|
|
|
desk = e_desk_at_xy_get(cfdata->es->zone, x, y);
|
2009-07-23 18:56:00 -07:00
|
|
|
e_widget_ilist_append(cfdata->desk_sel_list, NULL, desk->name,
|
|
|
|
NULL, NULL, NULL);
|
2007-09-04 16:59:01 -07:00
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(cfdata->desk_list, l, sd)
|
2007-09-04 16:59:01 -07:00
|
|
|
{
|
2009-08-21 08:08:49 -07:00
|
|
|
if (!sd) continue;
|
2007-09-04 16:59:01 -07:00
|
|
|
if ((sd->x != x) || (sd->y != y)) continue;
|
|
|
|
|
2009-07-23 18:56:00 -07:00
|
|
|
e_widget_ilist_multi_select(cfdata->desk_sel_list,
|
|
|
|
e_widget_ilist_count(cfdata->desk_sel_list));
|
2007-09-04 16:59:01 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
e_widget_ilist_go(cfdata->desk_sel_list);
|
|
|
|
e_widget_ilist_thaw(cfdata->desk_sel_list);
|
|
|
|
edje_thaw();
|
|
|
|
evas_event_thaw(evas);
|
|
|
|
}
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
static void *
|
|
|
|
_create_data(E_Config_Dialog *cfd)
|
|
|
|
{
|
|
|
|
/* Create cfdata - cfdata is a temporary block of config data that this
|
|
|
|
* dialog will be dealing with while configuring. it will be applied to
|
|
|
|
* the running systems/config in the apply methods
|
|
|
|
*/
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
|
|
|
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
|
|
|
cfdata->es = cfd->data;
|
|
|
|
cfdata->escfg = cfdata->es->cfg;
|
|
|
|
_fill_data(cfdata);
|
|
|
|
return cfdata;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
2009-04-18 06:47:29 -07:00
|
|
|
eina_list_free(cfdata->autohide_list);
|
2009-04-16 14:03:43 -07:00
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
/* Free the cfdata */
|
|
|
|
cfdata->es->config_dialog = NULL;
|
2009-03-11 08:13:42 -07:00
|
|
|
eina_stringshare_del(cfdata->style);
|
2009-07-23 18:56:00 -07:00
|
|
|
E_FREE(cfdata);
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**--APPLY--**/
|
|
|
|
static int
|
|
|
|
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
2006-06-02 19:27:13 -07:00
|
|
|
{
|
|
|
|
E_Zone *zone;
|
|
|
|
|
2006-06-16 01:20:36 -07:00
|
|
|
switch (cfdata->mode)
|
|
|
|
{
|
|
|
|
case MODE_BOTTOM_MIDDLE:
|
|
|
|
cfdata->escfg->orient = E_GADCON_ORIENT_BOTTOM;
|
2008-10-15 08:12:56 -07:00
|
|
|
if (cfdata->escfg->style) eina_stringshare_del(cfdata->escfg->style);
|
|
|
|
cfdata->escfg->style = eina_stringshare_add("default");
|
2006-06-16 01:20:36 -07:00
|
|
|
cfdata->escfg->fit_along = 1;
|
|
|
|
cfdata->escfg->popup = 1;
|
|
|
|
cfdata->escfg->layer = 200;
|
|
|
|
break;
|
|
|
|
case MODE_BOTTOM_ALL:
|
|
|
|
cfdata->escfg->orient = E_GADCON_ORIENT_BOTTOM;
|
2008-10-15 08:12:56 -07:00
|
|
|
if (cfdata->escfg->style) eina_stringshare_del(cfdata->escfg->style);
|
|
|
|
cfdata->escfg->style = eina_stringshare_add("default");
|
2006-06-16 01:20:36 -07:00
|
|
|
cfdata->escfg->fit_along = 0;
|
|
|
|
cfdata->escfg->popup = 1;
|
|
|
|
cfdata->escfg->layer = 200;
|
|
|
|
break;
|
|
|
|
case MODE_BOTTOM_DESKTOP:
|
|
|
|
cfdata->escfg->orient = E_GADCON_ORIENT_BOTTOM;
|
2008-10-15 08:12:56 -07:00
|
|
|
if (cfdata->escfg->style) eina_stringshare_del(cfdata->escfg->style);
|
|
|
|
cfdata->escfg->style = eina_stringshare_add("invisible");
|
2006-06-16 01:20:36 -07:00
|
|
|
cfdata->escfg->fit_along = 0;
|
|
|
|
cfdata->escfg->popup = 0;
|
|
|
|
cfdata->escfg->layer = 1;
|
|
|
|
break;
|
|
|
|
case MODE_TOP_ALL:
|
|
|
|
cfdata->escfg->orient = E_GADCON_ORIENT_TOP;
|
2008-10-15 08:12:56 -07:00
|
|
|
if (cfdata->escfg->style) eina_stringshare_del(cfdata->escfg->style);
|
|
|
|
cfdata->escfg->style = eina_stringshare_add("default");
|
2006-06-16 01:20:36 -07:00
|
|
|
cfdata->escfg->fit_along = 0;
|
|
|
|
cfdata->escfg->popup = 1;
|
|
|
|
cfdata->escfg->layer = 200;
|
|
|
|
break;
|
|
|
|
case MODE_TOP_DESKTOP:
|
|
|
|
cfdata->escfg->orient = E_GADCON_ORIENT_TOP;
|
2008-10-15 08:12:56 -07:00
|
|
|
if (cfdata->escfg->style) eina_stringshare_del(cfdata->escfg->style);
|
|
|
|
cfdata->escfg->style = eina_stringshare_add("invisible");
|
2006-06-16 01:20:36 -07:00
|
|
|
cfdata->escfg->fit_along = 0;
|
|
|
|
cfdata->escfg->popup = 0;
|
|
|
|
cfdata->escfg->layer = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-06-02 19:27:13 -07:00
|
|
|
|
2006-09-19 18:01:52 -07:00
|
|
|
cfdata->escfg->size = cfdata->basic_size;
|
|
|
|
cfdata->size = cfdata->basic_size;
|
|
|
|
|
2006-06-02 19:27:13 -07:00
|
|
|
zone = cfdata->es->zone;
|
|
|
|
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,
|
2007-10-04 23:05:16 -07:00
|
|
|
cfdata->escfg->layer,
|
|
|
|
cfdata->escfg->id);
|
2006-06-02 19:27:13 -07:00
|
|
|
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);
|
2007-04-23 10:21:38 -07:00
|
|
|
e_shelf_toggle(cfdata->es, 1);
|
2006-06-02 19:27:13 -07:00
|
|
|
e_shelf_show(cfdata->es);
|
2009-10-02 13:53:05 -07:00
|
|
|
_calibrate_binginds();
|
2006-06-02 19:27:13 -07:00
|
|
|
e_config_save_queue();
|
|
|
|
cfdata->es->config_dialog = cfd;
|
|
|
|
return 1; /* Apply was OK */
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
2006-04-22 23:56:22 -07:00
|
|
|
{
|
|
|
|
E_Zone *zone;
|
2007-10-04 23:05:16 -07:00
|
|
|
int idx;
|
2006-07-26 23:21:56 -07:00
|
|
|
int restart = 0;
|
|
|
|
|
|
|
|
/* Only change style is we need to */
|
|
|
|
if (!cfdata->escfg->style)
|
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
cfdata->escfg->style = eina_stringshare_ref(cfdata->style);
|
2006-07-26 23:21:56 -07:00
|
|
|
e_shelf_style_set(cfdata->es, cfdata->style);
|
|
|
|
}
|
|
|
|
else if ((cfdata->escfg->style) &&
|
|
|
|
(strcmp(cfdata->escfg->style, cfdata->style)))
|
|
|
|
{
|
2008-10-15 08:12:56 -07:00
|
|
|
if (cfdata->escfg->style) eina_stringshare_del(cfdata->escfg->style);
|
2009-03-11 08:13:42 -07:00
|
|
|
cfdata->escfg->style = eina_stringshare_ref(cfdata->style);
|
2006-07-26 23:21:56 -07:00
|
|
|
e_shelf_style_set(cfdata->es, cfdata->style);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Only Change Orient if we need to */
|
|
|
|
if (cfdata->escfg->orient != cfdata->orient)
|
|
|
|
{
|
|
|
|
cfdata->escfg->orient = cfdata->orient;
|
|
|
|
e_shelf_orient(cfdata->es, cfdata->orient);
|
|
|
|
e_shelf_position_calc(cfdata->es);
|
2006-08-30 21:16:43 -07:00
|
|
|
restart = 1;
|
2006-07-26 23:21:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Only Change fit along if we need to */
|
|
|
|
if (cfdata->escfg->fit_along != cfdata->fit_along)
|
|
|
|
{
|
|
|
|
cfdata->escfg->fit_along = cfdata->fit_along;
|
|
|
|
cfdata->es->fit_along = cfdata->fit_along;
|
|
|
|
restart = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Only Change fit size if we need to */
|
|
|
|
if (cfdata->escfg->fit_size != cfdata->fit_size)
|
|
|
|
{
|
|
|
|
/* Not sure if this will need a restart or not */
|
|
|
|
cfdata->escfg->fit_size = cfdata->fit_size;
|
|
|
|
cfdata->es->fit_size = cfdata->fit_size;
|
|
|
|
restart = 1;
|
|
|
|
}
|
2006-04-22 23:56:22 -07:00
|
|
|
|
2006-07-26 23:21:56 -07:00
|
|
|
/* Only Change size if we need to */
|
|
|
|
if (cfdata->escfg->size != cfdata->size)
|
|
|
|
{
|
2006-09-19 18:01:52 -07:00
|
|
|
if (cfdata->size <= 24)
|
|
|
|
cfdata->basic_size = 24;
|
|
|
|
else if (cfdata->size <= 32)
|
|
|
|
cfdata->basic_size = 32;
|
|
|
|
else if (cfdata->size <= 40)
|
|
|
|
cfdata->basic_size = 40;
|
|
|
|
else if (cfdata->size <= 48)
|
|
|
|
cfdata->basic_size = 48;
|
|
|
|
else if (cfdata->size >= 48)
|
|
|
|
cfdata->basic_size = 56;
|
|
|
|
|
2006-07-26 23:21:56 -07:00
|
|
|
cfdata->escfg->size = cfdata->size;
|
|
|
|
cfdata->es->size = cfdata->size;
|
|
|
|
restart = 1;
|
|
|
|
}
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
if (cfdata->layering == 0)
|
|
|
|
{
|
2006-07-26 23:21:56 -07:00
|
|
|
if ((cfdata->escfg->popup != 0) || (cfdata->escfg->layer != 1))
|
|
|
|
{
|
|
|
|
restart = 1;
|
|
|
|
cfdata->escfg->popup = 0;
|
|
|
|
cfdata->escfg->layer = 1;
|
|
|
|
}
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
|
|
|
else if (cfdata->layering == 1)
|
|
|
|
{
|
2009-07-23 18:56:00 -07:00
|
|
|
if ((cfdata->escfg->popup != 0) || (cfdata->escfg->layer != 1))
|
2006-07-26 23:21:56 -07:00
|
|
|
{
|
|
|
|
restart = 1;
|
|
|
|
cfdata->escfg->popup = 1;
|
|
|
|
cfdata->escfg->layer = 0;
|
|
|
|
}
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
|
|
|
else if (cfdata->layering == 2)
|
|
|
|
{
|
2006-07-26 23:21:56 -07:00
|
|
|
if ((cfdata->escfg->popup != 1) || (cfdata->escfg->layer != 200))
|
|
|
|
{
|
|
|
|
restart = 1;
|
|
|
|
cfdata->escfg->popup = 1;
|
|
|
|
cfdata->escfg->layer = 200;
|
|
|
|
}
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
2006-07-26 23:21:56 -07:00
|
|
|
|
2006-10-01 13:10:37 -07:00
|
|
|
cfdata->escfg->overlap = cfdata->overlapping;
|
2007-04-11 08:37:04 -07:00
|
|
|
|
2007-03-02 09:00:20 -08:00
|
|
|
cfdata->escfg->autohide = cfdata->autohiding;
|
2007-06-10 04:01:41 -07:00
|
|
|
cfdata->escfg->autohide_show_action = cfdata->autohiding_show_action;
|
2007-04-11 08:37:04 -07:00
|
|
|
cfdata->escfg->hide_timeout = cfdata->hide_timeout;
|
|
|
|
cfdata->escfg->hide_duration = cfdata->hide_duration;
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2007-09-04 16:59:01 -07:00
|
|
|
cfdata->escfg->desk_show_mode = cfdata->desk_show_mode;
|
|
|
|
cfdata->escfg->desk_list = NULL;
|
|
|
|
if (cfdata->desk_show_mode)
|
|
|
|
{
|
2009-07-23 18:56:00 -07:00
|
|
|
Eina_List *l = NULL;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *desk_list = NULL;
|
2009-08-21 08:08:49 -07:00
|
|
|
E_Ilist_Item *item;
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
idx = -1;
|
|
|
|
EINA_LIST_FOREACH(e_widget_ilist_items_get(cfdata->desk_sel_list), l, item)
|
2007-09-04 16:59:01 -07:00
|
|
|
{
|
|
|
|
E_Desk *desk;
|
|
|
|
E_Config_Shelf_Desk *sd;
|
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
idx++;
|
2007-09-04 16:59:01 -07:00
|
|
|
if ((!item) || (!item->selected)) continue;
|
|
|
|
|
|
|
|
desk = e_desk_at_pos_get(cfdata->es->zone, idx);
|
|
|
|
if (!desk) continue;
|
|
|
|
|
|
|
|
sd = E_NEW(E_Config_Shelf_Desk, 1);
|
|
|
|
sd->x = desk->x;
|
|
|
|
sd->y = desk->y;
|
2008-10-22 04:49:33 -07:00
|
|
|
desk_list = eina_list_append(desk_list, sd);
|
2007-09-04 16:59:01 -07:00
|
|
|
}
|
|
|
|
cfdata->escfg->desk_list = desk_list;
|
|
|
|
}
|
|
|
|
|
2006-07-26 23:21:56 -07:00
|
|
|
if (restart)
|
|
|
|
{
|
|
|
|
zone = cfdata->es->zone;
|
|
|
|
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,
|
2007-10-04 23:05:16 -07:00
|
|
|
cfdata->escfg->layer,
|
|
|
|
cfdata->escfg->id);
|
2006-07-26 23:21:56 -07:00
|
|
|
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);
|
|
|
|
}
|
2007-09-04 16:59:01 -07:00
|
|
|
if (cfdata->escfg->desk_show_mode)
|
|
|
|
{
|
|
|
|
E_Desk *desk;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l;
|
2009-08-21 08:08:49 -07:00
|
|
|
E_Config_Shelf_Desk *sd;
|
2007-09-04 16:59:01 -07:00
|
|
|
int show_shelf=0;
|
|
|
|
|
|
|
|
desk = e_desk_current_get(cfdata->es->zone);
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(cfdata->escfg->desk_list, l, sd)
|
2007-09-04 16:59:01 -07:00
|
|
|
{
|
|
|
|
if ((desk->x == sd->x) && (desk->y == sd->y))
|
|
|
|
{
|
|
|
|
show_shelf=1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (show_shelf)
|
|
|
|
e_shelf_show(cfdata->es);
|
|
|
|
else
|
|
|
|
e_shelf_hide(cfdata->es);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
e_shelf_show(cfdata->es);
|
2006-07-26 23:21:56 -07:00
|
|
|
|
2009-04-16 20:15:27 -07:00
|
|
|
if (cfdata->escfg->autohide && !cfdata->es->hidden)
|
|
|
|
e_shelf_toggle(cfdata->es, 0);
|
|
|
|
else if (!cfdata->escfg->autohide && cfdata->es->hidden)
|
|
|
|
e_shelf_toggle(cfdata->es, 1);
|
|
|
|
|
2009-04-22 19:24:59 -07:00
|
|
|
e_zone_useful_geometry_dirty(cfdata->es->zone);
|
2009-10-02 13:53:05 -07:00
|
|
|
_calibrate_binginds();
|
2006-07-26 23:21:56 -07:00
|
|
|
e_config_save_queue();
|
2006-04-22 23:56:22 -07:00
|
|
|
cfdata->es->config_dialog = cfd;
|
2006-07-26 23:21:56 -07:00
|
|
|
return 1; /* Apply was OK */
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
|
|
|
|
2006-05-07 02:49:37 -07:00
|
|
|
static void
|
|
|
|
_cb_configure(void *data, void *data2)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
2006-05-07 05:55:07 -07:00
|
|
|
|
|
|
|
cfdata = data;
|
|
|
|
if (!cfdata->es->gadcon->config_dialog)
|
2007-11-09 15:53:38 -08:00
|
|
|
e_int_gadcon_config_shelf(cfdata->es->gadcon);
|
2006-05-07 02:49:37 -07:00
|
|
|
}
|
2009-10-02 13:53:05 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_calibrate_binginds(void)
|
|
|
|
{
|
|
|
|
E_Binding_Edge *bind;
|
|
|
|
Eina_List *l;
|
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
#define EDGE_BINDING_REMOVE(type, click, delay) \
|
|
|
|
bind = e_bindings_edge_get("shelf_show", type, click); \
|
|
|
|
if (bind) \
|
|
|
|
e_bindings_edge_del(E_BINDING_CONTEXT_ZONE, type, \
|
|
|
|
0, 1, "shelf_show", NULL, delay);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_LEFT, 0, 0.0);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_RIGHT, 0, 0.0);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_TOP, 0, 0.0);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_BOTTOM, 0, 0.0);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_LEFT, 1, -1.0);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_RIGHT, 1, -1.0);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_TOP, 1, -1.0);
|
|
|
|
EDGE_BINDING_REMOVE(E_ZONE_EDGE_BOTTOM, 1, -1.0);
|
|
|
|
#undef EDGE_BINDING_REMOVE
|
|
|
|
|
|
|
|
#define EDGE_BINDING_ADD(es, type) \
|
|
|
|
if (es->cfg->autohide) \
|
|
|
|
{ \
|
|
|
|
if (es->cfg->autohide_show_action) \
|
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, type, \
|
|
|
|
0, 1, "shelf_show", NULL, -1.0); \
|
|
|
|
else \
|
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, type, \
|
|
|
|
0, 1, "shelf_show", NULL, 0.0); \
|
|
|
|
}
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(e_shelf_list(), l, es)
|
|
|
|
{
|
|
|
|
switch(es->gadcon->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
EDGE_BINDING_ADD(es, E_ZONE_EDGE_LEFT)
|
|
|
|
break;
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
EDGE_BINDING_ADD(es, E_ZONE_EDGE_RIGHT)
|
|
|
|
break;
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
EDGE_BINDING_ADD(es, E_ZONE_EDGE_TOP)
|
|
|
|
break;
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
|
|
|
EDGE_BINDING_ADD(es, E_ZONE_EDGE_BOTTOM)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#undef EDGE_BINDING_ADD
|
|
|
|
}
|
2006-05-07 02:49:37 -07:00
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
/**--GUI--**/
|
|
|
|
static Evas_Object *
|
|
|
|
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
2006-06-02 19:27:13 -07:00
|
|
|
{
|
|
|
|
/* generate the core widget layout for a basic dialog */
|
2006-06-16 01:20:36 -07:00
|
|
|
Evas_Object *o, *of, *ob, *ol;
|
|
|
|
E_Radio_Group *rg;
|
2006-06-02 19:27:13 -07:00
|
|
|
|
|
|
|
o = e_widget_list_add(evas, 0, 0);
|
2006-06-16 01:20:36 -07:00
|
|
|
|
|
|
|
ol = e_widget_list_add(evas, 0, 1);
|
2006-06-02 19:27:13 -07:00
|
|
|
|
2006-06-16 01:20:36 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Layout"), 0);
|
|
|
|
rg = e_widget_radio_group_new(&(cfdata->mode));
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-desktop-shelf-dock",
|
|
|
|
64, 24, MODE_BOTTOM_MIDDLE, rg);
|
2006-06-02 19:27:13 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-desktop-shelf-panel",
|
|
|
|
64, 24, MODE_BOTTOM_ALL, rg);
|
2006-06-02 19:27:13 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-desktop-shelf-bottom-desk",
|
|
|
|
64, 24, MODE_BOTTOM_DESKTOP, rg);
|
2006-06-02 19:27:13 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-desktop-shelf-menu-bar",
|
|
|
|
64, 24, MODE_TOP_ALL, rg);
|
2006-06-16 01:20:36 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-desktop-shelf-top-desk",
|
|
|
|
64, 24, MODE_TOP_DESKTOP, rg);
|
2006-06-16 01:20:36 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-desktop-shelf-custom",
|
|
|
|
64, 24, MODE_CUSTOM, rg);
|
2006-06-16 01:20:36 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
e_widget_list_object_append(ol, of, 1, 1, 0.5);
|
2006-09-19 18:01:52 -07:00
|
|
|
|
2006-06-16 01:20:36 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Size"), 0);
|
2006-09-19 18:01:52 -07:00
|
|
|
rg = e_widget_radio_group_new(&(cfdata->basic_size));
|
2006-06-16 01:20:36 -07:00
|
|
|
ob = e_widget_radio_add(evas, _("Tiny"), 24, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_radio_add(evas, _("Small"), 32, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_radio_add(evas, _("Medium"), 40, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_radio_add(evas, _("Large"), 48, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_radio_add(evas, _("Huge"), 56, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
e_widget_list_object_append(ol, of, 1, 1, 0.5);
|
2006-06-02 19:27:13 -07:00
|
|
|
|
2006-06-16 01:20:36 -07:00
|
|
|
e_widget_list_object_append(o, ol, 0, 0, 0.5);
|
2009-07-23 18:56:00 -07:00
|
|
|
|
|
|
|
ob = e_widget_button_add(evas, _("Set Contents..."), "configure",
|
|
|
|
_cb_configure, cfdata, NULL);
|
2006-06-02 19:27:13 -07:00
|
|
|
e_widget_list_object_append(o, ob, 0, 0, 0.5);
|
|
|
|
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
2006-04-22 23:56:22 -07:00
|
|
|
{
|
|
|
|
/* generate the core widget layout for a basic dialog */
|
2006-04-28 20:51:27 -07:00
|
|
|
Evas_Object *o, *o2, *of, *ob, *oi, *oj;
|
2009-04-16 14:03:43 -07:00
|
|
|
Evas_Object *autohide_check;
|
2006-04-22 23:56:22 -07:00
|
|
|
E_Radio_Group *rg;
|
2006-04-28 20:51:27 -07:00
|
|
|
Evas_Coord wmw, wmh;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *styles, *l;
|
2009-08-21 08:08:49 -07:00
|
|
|
char *style;
|
2006-04-22 23:56:22 -07:00
|
|
|
int sel, n;
|
2006-04-28 20:51:27 -07:00
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
/* FIXME: this is just raw config now - it needs UI improvments */
|
2006-04-29 20:43:47 -07:00
|
|
|
o = e_widget_list_add(evas, 0, 1);
|
2006-04-28 20:51:27 -07:00
|
|
|
|
|
|
|
o2 = e_widget_list_add(evas, 0, 0);
|
2006-04-22 23:56:22 -07:00
|
|
|
|
|
|
|
of = e_widget_framelist_add(evas, _("Stacking"), 0);
|
|
|
|
rg = e_widget_radio_group_new(&(cfdata->layering));
|
2006-04-29 21:31:42 -07:00
|
|
|
ob = e_widget_radio_add(evas, _("Above Everything"), 2, rg);
|
2006-04-22 23:56:22 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_radio_add(evas, _("Below Windows"), 1, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
2006-04-29 21:31:42 -07:00
|
|
|
ob = e_widget_radio_add(evas, _("Below Everything"), 0, rg);
|
2006-04-22 23:56:22 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_check_add(evas, _("Allow windows to overlap the shelf"),
|
|
|
|
&(cfdata->overlapping));
|
2006-10-01 13:10:37 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2006-04-28 20:51:27 -07:00
|
|
|
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2009-04-18 06:43:05 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Layout"), 0);
|
|
|
|
oi = e_widget_table_add(evas, 1);
|
2006-05-21 04:00:04 -07:00
|
|
|
rg = e_widget_radio_group_new(&(cfdata->orient));
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-left",
|
|
|
|
24, 24, E_GADCON_ORIENT_LEFT, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 0, 2, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-right",
|
|
|
|
24, 24, E_GADCON_ORIENT_RIGHT, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 2, 2, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-top",
|
|
|
|
24, 24, E_GADCON_ORIENT_TOP, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 1, 0, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-bottom",
|
|
|
|
24, 24, E_GADCON_ORIENT_BOTTOM, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 1, 4, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-top-left",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_TL, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 0, 0, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-top-right",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_TR, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 2, 0, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-bottom-left",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_BL, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 0, 4, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-bottom-right",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_BR, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 2, 4, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-left-top",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_LT, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 0, 1, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-right-top",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_RT, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 2, 1, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-left-bottom",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_LB, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 0, 3, 1, 1, 1, 1, 1, 1);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_radio_icon_add(evas, NULL, "preferences-position-right-bottom",
|
|
|
|
24, 24, E_GADCON_ORIENT_CORNER_RB, rg);
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_table_object_append(oi, ob, 2, 3, 1, 1, 1, 1, 1, 1);
|
|
|
|
|
|
|
|
e_widget_framelist_object_append(of, oi);
|
|
|
|
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_check_add(evas, _("Shrink to Content Size"),
|
|
|
|
&(cfdata->fit_along));
|
2009-04-18 06:43:05 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
|
2006-05-21 04:00:04 -07:00
|
|
|
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
2009-04-18 06:43:05 -07:00
|
|
|
|
2006-05-21 04:00:04 -07:00
|
|
|
e_widget_list_object_append(o, o2, 1, 1, 0.5);
|
|
|
|
|
|
|
|
o2 = e_widget_list_add(evas, 0, 0);
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Size"), 0);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_slider_add(evas, 1, 0, _("%3.0f pixels"), 4, 120, 4, 0,
|
|
|
|
NULL, &(cfdata->size), 100);
|
2006-04-22 23:56:22 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2006-04-28 20:51:27 -07:00
|
|
|
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
2006-04-22 23:56:22 -07:00
|
|
|
|
2006-05-07 02:49:37 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Styles"), 0);
|
|
|
|
|
2009-04-18 07:03:31 -07:00
|
|
|
oi = e_widget_ilist_add(evas, 60, 20, &(cfdata->style));
|
2006-04-28 20:51:27 -07:00
|
|
|
|
|
|
|
sel = 0;
|
|
|
|
styles = e_theme_shelf_list();
|
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
n = 0;
|
|
|
|
EINA_LIST_FOREACH(styles, l, style)
|
2006-04-28 20:51:27 -07:00
|
|
|
{
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
ob = e_livethumb_add(evas);
|
2009-04-18 07:03:31 -07:00
|
|
|
e_livethumb_vsize_set(ob, 120, 40);
|
2006-04-28 20:51:27 -07:00
|
|
|
oj = edje_object_add(e_livethumb_evas_get(ob));
|
2009-08-21 08:08:49 -07:00
|
|
|
snprintf(buf, sizeof(buf), "e/shelf/%s/base", style);
|
2006-04-28 20:51:27 -07:00
|
|
|
e_theme_edje_object_set(oj, "base/theme/shelf", buf);
|
|
|
|
e_livethumb_thumb_set(ob, oj);
|
2009-08-21 08:08:49 -07:00
|
|
|
e_widget_ilist_append(oi, ob, style, NULL, NULL, style);
|
|
|
|
if (!strcmp(cfdata->es->style, style)) sel = n;
|
|
|
|
n++;
|
2006-04-28 20:51:27 -07:00
|
|
|
}
|
2009-09-01 06:34:42 -07:00
|
|
|
e_widget_size_min_get(oi, &wmw, &wmh);
|
|
|
|
e_widget_size_min_set(oi, wmw, 160);
|
2006-04-28 20:51:27 -07:00
|
|
|
|
|
|
|
e_widget_ilist_go(oi);
|
|
|
|
e_widget_ilist_selected_set(oi, sel);
|
|
|
|
|
2006-05-07 02:49:37 -07:00
|
|
|
e_widget_framelist_object_append(of, oi);
|
|
|
|
|
2009-03-05 17:56:09 -08:00
|
|
|
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
2006-05-07 02:49:37 -07:00
|
|
|
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_button_add(evas, _("Set Contents..."), "configure",
|
|
|
|
_cb_configure, cfdata, NULL);
|
2006-05-07 02:49:37 -07:00
|
|
|
e_widget_list_object_append(o2, ob, 0, 0, 0.5);
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2007-06-18 04:29:02 -07:00
|
|
|
e_widget_list_object_append(o, o2, 0, 0, 0.0);
|
|
|
|
|
|
|
|
o2 = e_widget_list_add(evas, 0, 0);
|
|
|
|
|
|
|
|
of = e_widget_framelist_add(evas, _("Auto Hide"), 0);
|
2009-07-23 18:56:00 -07:00
|
|
|
autohide_check = e_widget_check_add(evas, _("Auto-hide the shelf"),
|
|
|
|
&(cfdata->autohiding));
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_framelist_object_append(of, autohide_check);
|
2007-06-18 04:29:02 -07:00
|
|
|
rg = e_widget_radio_group_new(&(cfdata->autohiding_show_action));
|
|
|
|
ob = e_widget_radio_add(evas, _("Show on mouse in"), 0, rg);
|
2009-04-18 06:47:29 -07:00
|
|
|
cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ob);
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_disabled_set(ob, !cfdata->autohiding); // set state from saved config
|
2007-06-18 04:29:02 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_radio_add(evas, _("Show on mouse click"), 1, rg);
|
2009-04-18 06:47:29 -07:00
|
|
|
cfdata->autohide_list = eina_list_append (cfdata->autohide_list, ob);
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_disabled_set(ob, !cfdata->autohiding); // set state from saved config
|
2007-06-18 04:29:02 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_label_add(evas, _("Hide timeout"));
|
2009-04-18 06:47:29 -07:00
|
|
|
cfdata->autohide_list = eina_list_append (cfdata->autohide_list, ob);
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_disabled_set(ob, !cfdata->autohiding); // set state from saved config
|
2007-06-18 04:29:02 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_slider_add(evas, 1, 0, _("%.1f seconds"), 0.2, 6.0, 0.2, 0,
|
|
|
|
&(cfdata->hide_timeout), NULL, 60);
|
2009-04-18 06:47:29 -07:00
|
|
|
cfdata->autohide_list = eina_list_append (cfdata->autohide_list, ob);
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_disabled_set(ob, !cfdata->autohiding); // set state from saved config
|
2007-06-18 04:29:02 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_label_add(evas, _("Hide duration"));
|
2009-04-18 06:47:29 -07:00
|
|
|
cfdata->autohide_list = eina_list_append (cfdata->autohide_list, ob);
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_disabled_set(ob, !cfdata->autohiding); // set state from saved config
|
2007-06-18 04:29:02 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
2009-07-23 18:56:00 -07:00
|
|
|
ob = e_widget_slider_add(evas, 1, 0, _("%.1f seconds"), 0.1, 2.0, 0.1, 0,
|
|
|
|
&(cfdata->hide_duration), NULL, 60);
|
2009-04-18 06:47:29 -07:00
|
|
|
cfdata->autohide_list = eina_list_append (cfdata->autohide_list, ob);
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_disabled_set(ob, !cfdata->autohiding); // set state from saved config
|
2007-06-18 04:29:02 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
2009-04-16 14:03:43 -07:00
|
|
|
// handler for enable/disable widget array
|
2009-07-23 18:56:00 -07:00
|
|
|
e_widget_on_change_hook_set(autohide_check, _cb_disable_check_list,
|
|
|
|
cfdata->autohide_list);
|
2007-06-18 04:29:02 -07:00
|
|
|
|
2007-09-04 16:59:01 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Desktop"), 0);
|
|
|
|
rg = e_widget_radio_group_new(&(cfdata->desk_show_mode));
|
|
|
|
ob = e_widget_radio_add(evas, _("Show on all Desktops"), 0, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
ob = e_widget_radio_add(evas, _("Show on specified Desktops"), 1, rg);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
|
|
|
|
ob = e_widget_ilist_add(evas, 16, 16, NULL);
|
2009-04-16 14:03:43 -07:00
|
|
|
e_widget_disabled_set(ob, 1); // set state from saved config
|
2007-09-04 16:59:01 -07:00
|
|
|
cfdata->desk_sel_list = ob;
|
|
|
|
e_widget_ilist_multi_select_set(ob, 1);
|
|
|
|
_desk_sel_list_load(cfdata);
|
2009-09-01 06:34:42 -07:00
|
|
|
e_widget_size_min_get(ob, &wmw, &wmh);
|
|
|
|
e_widget_size_min_set(ob, wmw, 64);
|
2007-09-04 16:59:01 -07:00
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
|
|
|
|
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
2006-05-07 02:49:37 -07:00
|
|
|
e_widget_list_object_append(o, o2, 0, 0, 0.0);
|
2009-07-23 18:56:00 -07:00
|
|
|
|
2006-06-02 19:27:13 -07:00
|
|
|
return o;
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
2009-04-16 14:03:43 -07:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* @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_list(void *data, Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Eina_List *list = (Eina_List*) data;
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *o;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(list, l, o)
|
2009-07-23 18:56:00 -07:00
|
|
|
e_widget_disabled_set(o, !e_widget_check_checked_get(obj));
|
2009-04-16 14:03:43 -07:00
|
|
|
}
|