different shelf look - imho much nicer now.

work on some mroe shelf stuff - like autofit. i need to add a lot more hooks
for things and info.


SVN revision: 21802
This commit is contained in:
Carsten Haitzler 2006-04-04 09:54:50 +00:00
parent eaddc2c929
commit 7f422515a1
8 changed files with 162 additions and 210 deletions

View File

@ -1,14 +1,6 @@
images { images {
image: "e17_shelf1.png" COMP; image: "e17_shelf_bg_h.png" COMP;
image: "e17_shelf2.png" COMP; image: "e17_shelf_sh_h.png" COMP;
image: "e17_shelf3.png" COMP;
image: "e17_shelf4.png" COMP;
image: "e17_shelf5.png" COMP;
image: "e17_shelf6.png" COMP;
image: "e17_shelf_bg1.png" COMP;
image: "e17_shelf_bg2.png" COMP;
image: "e17_shelf_sh1.png" COMP;
image: "e17_shelf_sh2.png" COMP;
} }
group { group {
@ -19,71 +11,71 @@ group {
} }
parts { parts {
part { part {
name: "base"; name: "shadow";
mouse_events: 0; mouse_events: 0;
type: RECT;
description { description {
state: "default" 0.0; state: "default" 0.0;
visible: 0;
rel1 { rel1 {
relative: 0.0 1.0; to: "base";
offset: 0 0; relative: 0.0 0.0;
to: "base2"; offset: -5 -5;
} }
rel2 { rel2 {
to_x: "base2"; to: "base";
relative: 1.0 1.0; relative: 1.0 1.0;
offset: -1 -2; offset: 12 12;
}
image {
normal: "e17_shelf_sh_h.png";
border: 19 19 19 19;
}
fill {
smooth: 0;
} }
color: 221 221 221 255;
} }
} }
part { part {
name: "base2"; name: "base";
mouse_events: 0; clip_to: "base_clip";
description { description {
state: "default" 0.0; state: "default" 0.0;
rel1 { rel1 {
relative: 0.0 0.0; relative: 0.0 0.0;
offset: 32 0; offset: 0 -6;
} }
rel2 { rel2 {
relative: 1.0 0.0; relative: 1.0 1.0;
offset: -33 19; offset: -1 0;
} }
image { image {
normal: "e17_shelf_bg1.png"; normal: "e17_shelf_bg_h.png";
border: 19 19 9 9;
} }
fill { }
smooth: 0; description {
size { state: "bottom" 0.0;
relative: 1.0 0; rel1 {
offset: 0 20; relative: 0.0 0.0;
} offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 7;
}
image {
normal: "e17_shelf_bg_h.png";
border: 19 19 9 9;
} }
} }
} }
part { part {
name: "base3"; name: "base_clip";
type: RECT;
mouse_events: 0; mouse_events: 0;
description { description {
state: "default" 0.0; state: "default" 0.0;
max: 99999 20; color: 255 255 255 255;
rel1 {
to_x: "base2";
relative: 0.0 1.0;
offset: 0 -1;
}
rel2 {
to_x: "base2";
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "e17_shelf_bg2.png";
}
fill {
smooth: 0;
}
} }
} }
part { part {
@ -94,157 +86,29 @@ group {
state: "default" 0.0; state: "default" 0.0;
rel1 { rel1 {
relative: 0.0 0.0; relative: 0.0 0.0;
offset: 32 2; offset: 18 2;
} }
rel2 { rel2 {
relative: 1.0 1.0; relative: 1.0 1.0;
offset: -33 -3; offset: -19 -3;
}
}
}
part {
name: "sh1";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to_x: "base2";
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
to_x: "base2";
relative: 0.0 1.0;
offset: 9 -1;
}
image {
normal: "e17_shelf_sh1.png";
}
}
}
part {
name: "sh2";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to_x: "base2";
relative: 1.0 0.0;
offset: -10 0;
}
rel2 {
to_x: "base2";
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "e17_shelf_sh2.png";
}
}
}
part {
name: "resize_l";
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 0.0 0.0;
offset: 31 9;
}
image {
normal: "e17_shelf1.png";
}
}
}
part {
name: "drag1";
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 0 10;
}
rel2 {
relative: 0.0 1.0;
offset: 31 -11;
}
image {
normal: "e17_shelf2.png";
border: 4 4 4 4;
}
}
}
part {
name: "resize_b1";
description {
state: "default" 0.0;
rel1 {
relative: 0.0 1.0;
offset: 0 -10;
}
rel2 {
relative: 0.0 1.0;
offset: 31 -1;
}
image {
normal: "e17_shelf3.png";
}
}
}
part {
name: "resize_r";
description {
state: "default" 0.0;
rel1 {
relative: 1.0 0.0;
offset: -32 0;
}
rel2 {
relative: 1.0 0.0;
offset: -1 9;
}
image {
normal: "e17_shelf4.png";
}
}
}
part {
name: "drag2";
description {
state: "default" 0.0;
rel1 {
relative: 1.0 0.0;
offset: -32 10;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -11;
}
image {
normal: "e17_shelf5.png";
border: 4 4 4 4;
}
}
}
part {
name: "resize_b2";
description {
state: "default" 0.0;
rel1 {
relative: 1.0 1.0;
offset: -32 -10;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "e17_shelf6.png";
} }
} }
} }
} }
programs {
program {
name: "orient1";
signal: "set_orientation";
source: "top";
action: STATE_SET "default" 0.0;
target: "base";
}
program {
name: "orient2";
signal: "set_orientation";
source: "bottom";
action: STATE_SET "bottom" 0.0;
target: "base";
}
}
} }

View File

@ -427,4 +427,6 @@ e17_shelf6.png \
e17_shelf_bg1.png \ e17_shelf_bg1.png \
e17_shelf_bg2.png \ e17_shelf_bg2.png \
e17_shelf_sh1.png \ e17_shelf_sh1.png \
e17_shelf_sh2.png e17_shelf_sh2.png \
e17_shelf_bg_h.png \
e17_shelf_sh_h.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -75,7 +75,13 @@ __test2(E_Gadcon_Client *gcc)
static void static void
__test3(E_Gadcon_Client *gcc) __test3(E_Gadcon_Client *gcc)
{ {
e_gadcon_client_min_size_set(gcc, 80, 20); e_gadcon_client_min_size_set(gcc, 200, 20);
}
static void
__test4(E_Gadcon_Client *gcc)
{
e_gadcon_client_min_size_set(gcc, 32, 20);
} }
/* externally accessible functions */ /* externally accessible functions */
@ -101,7 +107,7 @@ e_gadcon_init(void)
GADCON_CLIENT_CLASS_VERSION, GADCON_CLIENT_CLASS_VERSION,
"clock", "clock",
{ {
__test, __test2, NULL __test, __test2, __test4
} }
}; };
e_gadcon_provider_register(&cc); e_gadcon_provider_register(&cc);
@ -154,6 +160,17 @@ e_gadcon_swallowed_new(const char *name, char *id, Evas_Object *obj, char *swall
return gc; return gc;
} }
EAPI void
e_gadcon_swallowed_min_size_set(E_Gadcon *gc, Evas_Coord w, Evas_Coord h)
{
if (gc->edje.o_parent)
{
edje_extern_object_min_size_set(gc->o_container, w, h);
edje_object_part_swallow(gc->edje.o_parent, gc->edje.swallow_name,
gc->o_container);
}
}
EAPI void EAPI void
e_gadcon_size_request_callback_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h), void *data) e_gadcon_size_request_callback_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h), void *data)
{ {
@ -591,14 +608,6 @@ _e_gadcon_cb_size_request(void *data, Evas *e, Evas_Object *obj, void *event_inf
Evas_Coord w, h; Evas_Coord w, h;
e_gadcon_layout_min_size_get(gc->o_container, &w, &h); e_gadcon_layout_min_size_get(gc->o_container, &w, &h);
/* FIXME: this needs to be controlled */
if (gc->edje.o_parent)
{
edje_extern_object_min_size_set(gc->o_container, w, h);
edje_object_part_swallow(gc->edje.o_parent, gc->edje.swallow_name,
gc->o_container);
}
printf("new minh/h\n");
gc->resize_request.func(gc->resize_request.data, gc, w, h); gc->resize_request.func(gc->resize_request.data, gc, w, h);
} }
} }

View File

@ -100,6 +100,7 @@ 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 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_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_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_layout_policy_set(E_Gadcon *gc, E_Gadcon_Layout_Policy layout_policy); EAPI void e_gadcon_layout_policy_set(E_Gadcon *gc, E_Gadcon_Layout_Policy layout_policy);
EAPI void e_gadcon_populate(E_Gadcon *gc); EAPI void e_gadcon_populate(E_Gadcon *gc);

View File

@ -130,7 +130,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
es->ee = zone->container->bg_ecore_evas; es->ee = zone->container->bg_ecore_evas;
es->evas = zone->container->bg_evas; es->evas = zone->container->bg_evas;
} }
// es->fit_along = 1; es->fit_along = 1;
es->layer = layer; es->layer = layer;
es->zone = zone; es->zone = zone;
es->style = evas_stringshare_add(style); es->style = evas_stringshare_add(style);
@ -159,6 +159,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
e_gadcon_size_request_callback_set(es->gadcon, _e_shelf_gadcon_size_request, e_gadcon_size_request_callback_set(es->gadcon, _e_shelf_gadcon_size_request,
es); es);
e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_TOP); e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_TOP);
edje_object_signal_emit(es->o_base, "set_orientation", "top");
e_gadcon_zone_set(es->gadcon, zone); e_gadcon_zone_set(es->gadcon, zone);
e_gadcon_ecore_evas_set(es->gadcon, es->ee); e_gadcon_ecore_evas_set(es->gadcon, es->ee);
@ -353,6 +354,44 @@ e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient)
E_OBJECT_CHECK(es); E_OBJECT_CHECK(es);
E_OBJECT_TYPE_CHECK(es, E_GADMAN_SHELF_TYPE); E_OBJECT_TYPE_CHECK(es, E_GADMAN_SHELF_TYPE);
e_gadcon_orient(es->gadcon, orient); e_gadcon_orient(es->gadcon, orient);
switch (es->gadcon->orient)
{
case E_GADCON_ORIENT_FLOAT:
edje_object_signal_emit(es->o_base, "set_orientation", "float");
break;
case E_GADCON_ORIENT_HORIZ:
edje_object_signal_emit(es->o_base, "set_orientation", "horizontal");
break;
case E_GADCON_ORIENT_VERT:
edje_object_signal_emit(es->o_base, "set_orientation", "vertical");
break;
case E_GADCON_ORIENT_LEFT:
edje_object_signal_emit(es->o_base, "set_orientation", "left");
break;
case E_GADCON_ORIENT_RIGHT:
edje_object_signal_emit(es->o_base, "set_orientation", "right");
break;
case E_GADCON_ORIENT_TOP:
edje_object_signal_emit(es->o_base, "set_orientation", "top");
break;
case E_GADCON_ORIENT_BOTTOM:
edje_object_signal_emit(es->o_base, "set_orientation", "bottom");
break;
case E_GADCON_ORIENT_CORNER_TL:
edje_object_signal_emit(es->o_base, "set_orientation", "top_left");
break;
case E_GADCON_ORIENT_CORNER_TR:
edje_object_signal_emit(es->o_base, "set_orientation", "top_right");
break;
case E_GADCON_ORIENT_CORNER_BL:
edje_object_signal_emit(es->o_base, "set_orientation", "bottom_left");
break;
case E_GADCON_ORIENT_CORNER_BR:
edje_object_signal_emit(es->o_base, "set_orientation", "bottom_right");
break;
default:
break;
}
} }
/* local subsystem functions */ /* local subsystem functions */
@ -412,15 +451,51 @@ static void
_e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h) _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h)
{ {
E_Shelf *es; E_Shelf *es;
Evas_Coord nx, ny, nw, nh; Evas_Coord nx, ny, nw, nh, ww, hh;
es = data; es = data;
nx = es->x; nx = es->x;
ny = es->y; ny = es->y;
nw = es->w; nw = es->w;
nh = es->h; nh = es->h;
ww = hh = 0;
printf("req min = %i %i\n", w, h);
evas_object_geometry_get(gc->o_container, NULL, NULL, &ww, &hh);
switch (gc->orient)
{
case E_GADCON_ORIENT_FLOAT:
break;
case E_GADCON_ORIENT_HORIZ:
break;
case E_GADCON_ORIENT_VERT:
break;
case E_GADCON_ORIENT_LEFT:
break;
case E_GADCON_ORIENT_RIGHT:
break;
case E_GADCON_ORIENT_TOP:
if (!es->fit_along) w = ww;
if (!es->fit_size) h = hh;
break;
case E_GADCON_ORIENT_BOTTOM:
if (!es->fit_along) w = ww;
if (!es->fit_size) h = hh;
break;
case E_GADCON_ORIENT_CORNER_TL:
break;
case E_GADCON_ORIENT_CORNER_TR:
break;
case E_GADCON_ORIENT_CORNER_BL:
break;
case E_GADCON_ORIENT_CORNER_BR:
break;
default:
break;
}
printf("adj min = %i %i\n", w, h);
e_gadcon_swallowed_min_size_set(gc, w, h);
edje_object_size_min_calc(es->o_base, &nw, &nh); edje_object_size_min_calc(es->o_base, &nw, &nh);
printf("new w, h = %i %i\n", nw, nh); printf("new w, h = %i %i\n", nw, nh);
switch (gc->orient) switch (gc->orient)
{ {
case E_GADCON_ORIENT_FLOAT: case E_GADCON_ORIENT_FLOAT:
@ -438,7 +513,7 @@ _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord
if (!es->fit_size) nh = es->h; if (!es->fit_size) nh = es->h;
if (nw > es->zone->w) nw = es->zone->w; if (nw > es->zone->w) nw = es->zone->w;
if (nh > es->zone->h) nh = es->zone->h; if (nh > es->zone->h) nh = es->zone->h;
if (nw != es->w) nx = es->x + ((es->w - es->w) / 2); if (nw != es->w) nx = es->x + ((es->w - nw) / 2);
ny = 0; ny = 0;
break; break;
case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_BOTTOM:
@ -446,7 +521,7 @@ _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord
if (!es->fit_size) nh = es->h; if (!es->fit_size) nh = es->h;
if (nw > es->zone->w) nw = es->zone->w; if (nw > es->zone->w) nw = es->zone->w;
if (nh > es->zone->h) nh = es->zone->h; if (nh > es->zone->h) nh = es->zone->h;
if (nw != es->w) nx = es->x + ((es->w - es->w) / 2); if (nw != es->w) nx = es->x + ((es->w - nw) / 2);
ny = es->zone->h - nh; ny = es->zone->h - nh;
break; break;
case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TL:

View File

@ -85,6 +85,7 @@ _gc_orient(E_Gadcon_Client *gcc)
inst = gcc->data; inst = gcc->data;
printf("OREINT to %i\n", gcc->gadcon->orient); printf("OREINT to %i\n", gcc->gadcon->orient);
e_gadcon_client_min_size_set(gcc, 20, 20);
} }
/**/ /**/
/***************************************************************************/ /***************************************************************************/