new basic mode shelf config - simpler with "pre-defined" recipies - this

should stop people asking stupid things like "how can i get gadgets on the
desktop" as its a 1 click option. things like "they look like shit - cokie
cutter" are hidden so silly peolpe who dont listen to advice and dont select
below everything - have it selected for them. don't like the basic set of
options given - use advanced to fiddle to your hearts content.


SVN revision: 23456
This commit is contained in:
Carsten Haitzler 2006-06-16 08:20:36 +00:00
parent b36a6cbe12
commit 0c8af50544
10 changed files with 244 additions and 48 deletions

2
TODO
View File

@ -58,8 +58,6 @@ Some of the things (in very short form) that need to be done to E17...
that we have little choice but to implement a .desktop file loader. this that we have little choice but to implement a .desktop file loader. this
is not to hard - it's the xml jungle of the system menus that is sucky. the is not to hard - it's the xml jungle of the system menus that is sucky. the
real problems are where to find the icons for the .desktop files. real problems are where to find the icons for the .desktop files.
* shelf config dialog needs to have basic modce be simple recipies like "on
desktop", "at the top" "panel" etc.
* middle mouse on gadgets as a quick move/resize thing? * middle mouse on gadgets as a quick move/resize thing?
* on xrandr screen res change e moves and resizes windows to fit in the new * on xrandr screen res change e moves and resizes windows to fit in the new
resolution. this is good and bad. if some other app temporarily changes resolution. this is good and bad. if some other app temporarily changes

View File

@ -46,6 +46,12 @@ images {
image: "e17_shelf_top_left.png" COMP; image: "e17_shelf_top_left.png" COMP;
image: "e17_shelf_top.png" COMP; image: "e17_shelf_top.png" COMP;
image: "e17_shelf_top_right.png" COMP; image: "e17_shelf_top_right.png" COMP;
image: "e17_shelf_bottom_desk.png" COMP;
image: "e17_shelf_custom.png" COMP;
image: "e17_shelf_dock.png" COMP;
image: "e17_shelf_menu_bar.png" COMP;
image: "e17_shelf_panel.png" COMP;
image: "e17_shelf_top_desk.png" COMP;
} }
group { group {
@ -796,3 +802,111 @@ group {
} }
} }
} }
group {
name: "icons/enlightenment/shelf_bottom_desk";
max: 24 24;
parts {
part {
name: "icon";
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
max: 24 24;
image {
normal: "e17_shelf_bottom_desk.png";
}
}
}
}
}
group {
name: "icons/enlightenment/shelf_custom";
max: 24 24;
parts {
part {
name: "icon";
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
max: 24 24;
image {
normal: "e17_shelf_custom.png";
}
}
}
}
}
group {
name: "icons/enlightenment/shelf_dock";
max: 24 24;
parts {
part {
name: "icon";
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
max: 24 24;
image {
normal: "e17_shelf_dock.png";
}
}
}
}
}
group {
name: "icons/enlightenment/shelf_menu_bar";
max: 24 24;
parts {
part {
name: "icon";
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
max: 24 24;
image {
normal: "e17_shelf_menu_bar.png";
}
}
}
}
}
group {
name: "icons/enlightenment/shelf_panel";
max: 24 24;
parts {
part {
name: "icon";
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
max: 24 24;
image {
normal: "e17_shelf_panel.png";
}
}
}
}
}
group {
name: "icons/enlightenment/shelf_top_desk";
max: 24 24;
parts {
part {
name: "icon";
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
max: 24 24;
image {
normal: "e17_shelf_top_desk.png";
}
}
}
}
}

View File

@ -435,5 +435,11 @@ e17_shelf_right.png \
e17_shelf_right_top.png \ e17_shelf_right_top.png \
e17_shelf_top_left.png \ e17_shelf_top_left.png \
e17_shelf_top.png \ e17_shelf_top.png \
e17_shelf_top_right.png e17_shelf_top_right.png \
e17_shelf_bottom_desk.png \
e17_shelf_custom.png \
e17_shelf_dock.png \
e17_shelf_menu_bar.png \
e17_shelf_panel.png \
e17_shelf_top_desk.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

View File

@ -11,11 +11,21 @@ static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Co
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); 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); static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
#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
/* Actual config data we will be playing with whil the dialog is active */ /* Actual config data we will be playing with whil the dialog is active */
struct _E_Config_Dialog_Data struct _E_Config_Dialog_Data
{ {
E_Shelf *es; E_Shelf *es;
E_Config_Shelf *escfg; E_Config_Shelf *escfg;
/* BASIC */
int mode;
/* ADVANCED */
char *style; char *style;
int orient; int orient;
int fit_along; int fit_along;
@ -55,6 +65,42 @@ e_int_shelf_config(E_Shelf *es)
static void static void
_fill_data(E_Config_Dialog_Data *cfdata) _fill_data(E_Config_Dialog_Data *cfdata)
{ {
cfdata->mode = MODE_CUSTOM;
if ((cfdata->escfg->orient == E_GADCON_ORIENT_BOTTOM) &&
((cfdata->escfg->style) && (!strcmp(cfdata->escfg->style, "default"))) &&
(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) &&
((cfdata->escfg->style) && (!strcmp(cfdata->escfg->style, "default"))) &&
(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) &&
((cfdata->escfg->style) && (!strcmp(cfdata->escfg->style, "invisible"))) &&
(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) &&
((cfdata->escfg->style) && (!strcmp(cfdata->escfg->style, "default"))) &&
(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) &&
((cfdata->escfg->style) && (!strcmp(cfdata->escfg->style, "invisible"))) &&
(cfdata->escfg->fit_along == 0) &&
(!cfdata->escfg->popup) &&
(cfdata->escfg->layer == 1))
cfdata->mode = MODE_TOP_DESKTOP;
if (cfdata->escfg->style) if (cfdata->escfg->style)
cfdata->style = strdup(cfdata->escfg->style); cfdata->style = strdup(cfdata->escfg->style);
else else
@ -108,12 +154,53 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
E_Zone *zone; E_Zone *zone;
int id; int id;
cfdata->escfg->fit_along = cfdata->fit_along; switch (cfdata->mode)
cfdata->escfg->fit_size = cfdata->fit_size; {
cfdata->escfg->size = cfdata->size; case MODE_BOTTOM_MIDDLE:
cfdata->escfg->orient = E_GADCON_ORIENT_BOTTOM;
if (cfdata->escfg->style) evas_stringshare_del(cfdata->escfg->style);
cfdata->escfg->style = evas_stringshare_add("default");
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;
if (cfdata->escfg->style) evas_stringshare_del(cfdata->escfg->style);
cfdata->escfg->style = evas_stringshare_add("default");
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;
if (cfdata->escfg->style) evas_stringshare_del(cfdata->escfg->style);
cfdata->escfg->style = evas_stringshare_add("invisible");
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;
if (cfdata->escfg->style) evas_stringshare_del(cfdata->escfg->style);
cfdata->escfg->style = evas_stringshare_add("default");
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;
if (cfdata->escfg->style) evas_stringshare_del(cfdata->escfg->style);
cfdata->escfg->style = evas_stringshare_add("invisible");
cfdata->escfg->fit_along = 0;
cfdata->escfg->popup = 0;
cfdata->escfg->layer = 1;
break;
default:
break;
}
if (cfdata->escfg->style) evas_stringshare_del(cfdata->escfg->style); cfdata->escfg->size = cfdata->size;
cfdata->escfg->style = evas_stringshare_add(cfdata->style);
zone = cfdata->es->zone; zone = cfdata->es->zone;
id = cfdata->es->id; id = cfdata->es->id;
@ -198,53 +285,44 @@ 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)
{ {
/* generate the core widget layout for a basic dialog */ /* generate the core widget layout for a basic dialog */
Evas_Object *o, *of, *ob, *oi, *oj; Evas_Object *o, *of, *ob, *ol;
Evas_Coord wmw, wmh; E_Radio_Group *rg;
Evas_List *styles, *l;
int sel, n;
o = e_widget_list_add(evas, 0, 0); o = e_widget_list_add(evas, 0, 0);
ol = e_widget_list_add(evas, 0, 1);
of = e_widget_framelist_add(evas, _("Layout"), 0);
rg = e_widget_radio_group_new(&(cfdata->mode));
ob = e_widget_radio_icon_add(evas, NULL, "enlightenment/shelf_dock", 64, 24, MODE_BOTTOM_MIDDLE, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "enlightenment/shelf_panel", 64, 24, MODE_BOTTOM_ALL, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "enlightenment/shelf_bottom_desk", 64, 24, MODE_BOTTOM_DESKTOP, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "enlightenment/shelf_menu_bar", 64, 24, MODE_TOP_ALL, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "enlightenment/shelf_top_desk", 64, 24, MODE_TOP_DESKTOP, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "enlightenment/shelf_custom", 64, 24, MODE_CUSTOM, rg);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(ol, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Size"), 0); of = e_widget_framelist_add(evas, _("Size"), 0);
ob = e_widget_check_add(evas, _("Shrink"), &(cfdata->fit_along)); rg = e_widget_radio_group_new(&(cfdata->size));
ob = e_widget_radio_add(evas, _("Tiny"), 24, rg);
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
// ob = e_widget_check_add(evas, _("Expand width to fit contents"), &(cfdata->fit_size)); ob = e_widget_radio_add(evas, _("Small"), 32, rg);
// e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Shelf Size"));
e_widget_framelist_object_append(of, ob); 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), 100); ob = e_widget_radio_add(evas, _("Medium"), 40, rg);
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5); ob = e_widget_radio_add(evas, _("Large"), 48, rg);
e_widget_framelist_object_append(of, ob);
of = e_widget_framelist_add(evas, _("Styles"), 0); ob = e_widget_radio_add(evas, _("Huge"), 56, rg);
oi = e_widget_ilist_add(evas, 128, 20, &(cfdata->style)); e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(ol, of, 1, 1, 0.5);
sel = 0; e_widget_list_object_append(o, ol, 0, 0, 0.5);
styles = e_theme_shelf_list();
for (n = 0, l = styles; l; l = l->next, n++)
{
char buf[4096];
ob = e_livethumb_add(evas);
e_livethumb_vsize_set(ob, 256, 40);
oj = edje_object_add(e_livethumb_evas_get(ob));
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, 120);
e_widget_ilist_go(oi);
e_widget_ilist_selected_set(oi, sel);
e_widget_framelist_object_append(of, oi);
e_widget_list_object_append(o, of, 0, 0, 0.5);
ob = e_widget_button_add(evas, _("Configure Contents..."), "widget/config", _cb_configure, cfdata, NULL); ob = e_widget_button_add(evas, _("Configure Contents..."), "widget/config", _cb_configure, cfdata, NULL);
e_widget_list_object_append(o, ob, 0, 0, 0.5); e_widget_list_object_append(o, ob, 0, 0, 0.5);