now config comes off a menu as does editing of items
SVN revision: 22318
This commit is contained in:
parent
362c31162f
commit
afe18a2157
|
@ -1,6 +1,6 @@
|
||||||
images {
|
images {
|
||||||
image: "e17_shelf_bg_h.png" COMP;
|
image: "e17_shelf_bg_h.png" COMP;
|
||||||
image: "e17_shelf_sh_h.png" COMP;
|
image: "e17_shelf_bg_v.png" COMP;
|
||||||
image: "e17_ibar_bg_h.png" COMP;
|
image: "e17_ibar_bg_h.png" COMP;
|
||||||
image: "e17_ibar_over_h.png" COMP;
|
image: "e17_ibar_over_h.png" COMP;
|
||||||
}
|
}
|
||||||
|
@ -12,31 +12,6 @@ group {
|
||||||
item: "shaped" "1";
|
item: "shaped" "1";
|
||||||
}
|
}
|
||||||
parts {
|
parts {
|
||||||
part {
|
|
||||||
name: "shadow";
|
|
||||||
mouse_events: 0;
|
|
||||||
description {
|
|
||||||
state: "default" 0.0;
|
|
||||||
visible: 0;
|
|
||||||
rel1 {
|
|
||||||
to: "base";
|
|
||||||
relative: 0.0 0.0;
|
|
||||||
offset: -5 -5;
|
|
||||||
}
|
|
||||||
rel2 {
|
|
||||||
to: "base";
|
|
||||||
relative: 1.0 1.0;
|
|
||||||
offset: 12 12;
|
|
||||||
}
|
|
||||||
image {
|
|
||||||
normal: "e17_shelf_sh_h.png";
|
|
||||||
border: 19 19 19 19;
|
|
||||||
}
|
|
||||||
fill {
|
|
||||||
smooth: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
part {
|
part {
|
||||||
name: "base";
|
name: "base";
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
|
@ -115,6 +90,96 @@ group {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
description {
|
||||||
|
state: "left" 0.0;
|
||||||
|
image {
|
||||||
|
normal: "e17_shelf_bg_v.png";
|
||||||
|
border: 9 9 19 19;
|
||||||
|
}
|
||||||
|
fill {
|
||||||
|
origin {
|
||||||
|
offset: -6 0;
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
offset: 6 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "left_top" 0.0;
|
||||||
|
image {
|
||||||
|
normal: "e17_shelf_bg_v.png";
|
||||||
|
border: 9 9 19 19;
|
||||||
|
}
|
||||||
|
fill {
|
||||||
|
origin {
|
||||||
|
offset: -6 -16;
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
offset: 6 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "left_bottom" 0.0;
|
||||||
|
image {
|
||||||
|
normal: "e17_shelf_bg_v.png";
|
||||||
|
border: 9 9 19 19;
|
||||||
|
}
|
||||||
|
fill {
|
||||||
|
origin {
|
||||||
|
offset: -6 0;
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
offset: 6 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "right" 0.0;
|
||||||
|
image {
|
||||||
|
normal: "e17_shelf_bg_v.png";
|
||||||
|
border: 9 9 19 19;
|
||||||
|
}
|
||||||
|
fill {
|
||||||
|
origin {
|
||||||
|
offset: 0 0;
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
offset: 6 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "right_top" 0.0;
|
||||||
|
image {
|
||||||
|
normal: "e17_shelf_bg_v.png";
|
||||||
|
border: 9 9 19 19;
|
||||||
|
}
|
||||||
|
fill {
|
||||||
|
origin {
|
||||||
|
offset: 0 -16;
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
offset: 6 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "right_bottom" 0.0;
|
||||||
|
image {
|
||||||
|
normal: "e17_shelf_bg_v.png";
|
||||||
|
border: 9 9 19 19;
|
||||||
|
}
|
||||||
|
fill {
|
||||||
|
origin {
|
||||||
|
offset: 0 0;
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
offset: 6 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
part {
|
part {
|
||||||
name: "items";
|
name: "items";
|
||||||
|
@ -186,6 +251,72 @@ group {
|
||||||
offset: -3 -3;
|
offset: -3 -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
description {
|
||||||
|
state: "left" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 2 18;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -3 -19;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "left_top" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 2 2;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -3 -19;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "left_bottom" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 2 18;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -3 -3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "right" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 2 18;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -3 -19;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "right_top" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 2 2;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -3 -19;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "right_bottom" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 2 18;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -3 -3;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
programs {
|
programs {
|
||||||
|
@ -237,6 +368,54 @@ group {
|
||||||
target: "base";
|
target: "base";
|
||||||
target: "items";
|
target: "items";
|
||||||
}
|
}
|
||||||
|
program {
|
||||||
|
name: "orient7";
|
||||||
|
signal: "set_orientation";
|
||||||
|
source: "left";
|
||||||
|
action: STATE_SET "left" 0.0;
|
||||||
|
target: "base";
|
||||||
|
target: "items";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "orient8";
|
||||||
|
signal: "set_orientation";
|
||||||
|
source: "left_top";
|
||||||
|
action: STATE_SET "left_top" 0.0;
|
||||||
|
target: "base";
|
||||||
|
target: "items";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "orient9";
|
||||||
|
signal: "set_orientation";
|
||||||
|
source: "left_bottom";
|
||||||
|
action: STATE_SET "left_bottom" 0.0;
|
||||||
|
target: "base";
|
||||||
|
target: "items";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "orient10";
|
||||||
|
signal: "set_orientation";
|
||||||
|
source: "right";
|
||||||
|
action: STATE_SET "right" 0.0;
|
||||||
|
target: "base";
|
||||||
|
target: "items";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "orient11";
|
||||||
|
signal: "set_orientation";
|
||||||
|
source: "right_top";
|
||||||
|
action: STATE_SET "right_top" 0.0;
|
||||||
|
target: "base";
|
||||||
|
target: "items";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "orient12";
|
||||||
|
signal: "set_orientation";
|
||||||
|
source: "right_bottom";
|
||||||
|
action: STATE_SET "right_bottom" 0.0;
|
||||||
|
target: "base";
|
||||||
|
target: "items";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
group {
|
group {
|
||||||
|
|
|
@ -196,11 +196,9 @@ e_gadcon_populate(E_Gadcon *gc)
|
||||||
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
|
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
|
||||||
ok = 0;
|
ok = 0;
|
||||||
e_gadcon_layout_freeze(gc->o_container);
|
e_gadcon_layout_freeze(gc->o_container);
|
||||||
printf("e_config->gadcons = %p\n", e_config->gadcons);
|
|
||||||
for (l = e_config->gadcons; l; l = l->next)
|
for (l = e_config->gadcons; l; l = l->next)
|
||||||
{
|
{
|
||||||
cf_gc = l->data;
|
cf_gc = l->data;
|
||||||
printf("%s == %s, %s == %s\n", cf_gc->name, gc->name, cf_gc->id, gc->id);
|
|
||||||
if ((!strcmp(cf_gc->name, gc->name)) &&
|
if ((!strcmp(cf_gc->name, gc->name)) &&
|
||||||
(!strcmp(cf_gc->id, gc->id)))
|
(!strcmp(cf_gc->id, gc->id)))
|
||||||
{
|
{
|
||||||
|
@ -371,6 +369,7 @@ e_gadcon_edit_begin(E_Gadcon *gc)
|
||||||
E_OBJECT_CHECK(gc);
|
E_OBJECT_CHECK(gc);
|
||||||
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
|
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
|
||||||
e_gadcon_layout_freeze(gc->o_container);
|
e_gadcon_layout_freeze(gc->o_container);
|
||||||
|
gc->editing = 1;
|
||||||
for (l = gc->clients; l; l = l->next)
|
for (l = gc->clients; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Gadcon_Client *gcc;
|
E_Gadcon_Client *gcc;
|
||||||
|
@ -389,6 +388,7 @@ e_gadcon_edit_end(E_Gadcon *gc)
|
||||||
E_OBJECT_CHECK(gc);
|
E_OBJECT_CHECK(gc);
|
||||||
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
|
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
|
||||||
e_gadcon_layout_freeze(gc->o_container);
|
e_gadcon_layout_freeze(gc->o_container);
|
||||||
|
gc->editing = 0;
|
||||||
for (l = gc->clients; l; l = l->next)
|
for (l = gc->clients; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Gadcon_Client *gcc;
|
E_Gadcon_Client *gcc;
|
||||||
|
@ -723,7 +723,6 @@ e_gadcon_client_aspect_set(E_Gadcon_Client *gcc, int w, int h)
|
||||||
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
|
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
|
||||||
gcc->aspect.w = w;
|
gcc->aspect.w = w;
|
||||||
gcc->aspect.h = h;
|
gcc->aspect.h = h;
|
||||||
printf("ASPECt: %i %i\n", w, h);
|
|
||||||
if ((!gcc->autoscroll) && (!gcc->resizable))
|
if ((!gcc->autoscroll) && (!gcc->resizable))
|
||||||
{
|
{
|
||||||
if (gcc->o_frame)
|
if (gcc->o_frame)
|
||||||
|
@ -856,6 +855,18 @@ _e_gadcon_client_cb_menu_resizable(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
e_gadcon_populate(gc);
|
e_gadcon_populate(gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_gadcon_client_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Gadcon_Client *gcc;
|
||||||
|
|
||||||
|
gcc = data;
|
||||||
|
if (gcc->o_control)
|
||||||
|
e_gadcon_client_edit_end(gcc);
|
||||||
|
else
|
||||||
|
e_gadcon_client_edit_begin(gcc);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int flags)
|
e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int flags)
|
||||||
{
|
{
|
||||||
|
@ -884,6 +895,14 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int f
|
||||||
e_menu_item_check_set(mi, 1);
|
e_menu_item_check_set(mi, 1);
|
||||||
if (gcc->resizable) e_menu_item_toggle_set(mi, 1);
|
if (gcc->resizable) e_menu_item_toggle_set(mi, 1);
|
||||||
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_resizable, gcc);
|
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_resizable, gcc);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(menu);
|
||||||
|
if (gcc->o_control)
|
||||||
|
e_menu_item_label_set(mi, _("Stop editing"));
|
||||||
|
else
|
||||||
|
e_menu_item_label_set(mi, _("Begin editing"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/edit");
|
||||||
|
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_edit, gcc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1196,7 +1215,27 @@ _e_gadcon_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_in
|
||||||
ev = event_info;
|
ev = event_info;
|
||||||
if (ev->button == 3)
|
if (ev->button == 3)
|
||||||
{
|
{
|
||||||
printf("THREE! %p\n", gcc);
|
E_Menu *mn;
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
int cx, cy, cw, ch;
|
||||||
|
|
||||||
|
mn = e_menu_new();
|
||||||
|
e_menu_post_deactivate_callback_set(mn, _e_gadcon_client_cb_menu_post,
|
||||||
|
gcc);
|
||||||
|
gcc->menu = mn;
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, _("Stop editing"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/edit");
|
||||||
|
e_menu_item_callback_set(mi, _e_gadcon_client_cb_menu_edit, gcc);
|
||||||
|
|
||||||
|
e_gadcon_canvas_zone_geometry_get(gcc->gadcon, &cx, &cy, &cw, &ch);
|
||||||
|
e_menu_activate_mouse(mn,
|
||||||
|
e_util_zone_current_get(e_manager_current_get()),
|
||||||
|
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||||
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||||
|
evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button,
|
||||||
|
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1878,7 +1917,6 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
x = sd->x; y = sd->y; w = sd->w; h = sd->h;
|
x = sd->x; y = sd->y; w = sd->w; h = sd->h;
|
||||||
min = mino = cur = 0;
|
min = mino = cur = 0;
|
||||||
|
|
||||||
printf("HORIZ: %i\n", sd->horizontal);
|
|
||||||
for (l = sd->items; l; l = l->next)
|
for (l = sd->items; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Gadcon_Layout_Item *bi;
|
E_Gadcon_Layout_Item *bi;
|
||||||
|
@ -1943,8 +1981,6 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("CUR = %i | %i %i\n", cur, min, mino);
|
|
||||||
|
|
||||||
if (sd->horizontal)
|
if (sd->horizontal)
|
||||||
{
|
{
|
||||||
if (cur <= w)
|
if (cur <= w)
|
||||||
|
@ -1958,7 +1994,6 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
sub = cur - w; /* we need to find "sub" extra pixels */
|
sub = cur - w; /* we need to find "sub" extra pixels */
|
||||||
if (min <= w)
|
if (min <= w)
|
||||||
{
|
{
|
||||||
printf("blum\n");
|
|
||||||
for (l = sd->items; l; l = l->next)
|
for (l = sd->items; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Gadcon_Layout_Item *bi;
|
E_Gadcon_Layout_Item *bi;
|
||||||
|
@ -1970,13 +2005,11 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
if (give < sub) give = sub;
|
if (give < sub) give = sub;
|
||||||
bi->ask.size2 = bi->ask.size - give;
|
bi->ask.size2 = bi->ask.size - give;
|
||||||
sub -= give;
|
sub -= give;
|
||||||
printf("GIVE: %i\n", give);
|
|
||||||
if (sub <= 0) break;
|
if (sub <= 0) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* EEK - all items just cant fit at their minimum! what do we do? */
|
{ /* EEK - all items just cant fit at their minimum! what do we do? */
|
||||||
printf("EEK - nofit!\n");
|
|
||||||
num = 0;
|
num = 0;
|
||||||
num = evas_list_count(sd->items);
|
num = evas_list_count(sd->items);
|
||||||
give = min - w; // how much give total below minw we need
|
give = min - w; // how much give total below minw we need
|
||||||
|
@ -2016,7 +2049,6 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
sub = cur - h; /* we need to find "sub" extra pixels */
|
sub = cur - h; /* we need to find "sub" extra pixels */
|
||||||
if (min <= h)
|
if (min <= h)
|
||||||
{
|
{
|
||||||
printf("blum\n");
|
|
||||||
for (l = sd->items; l; l = l->next)
|
for (l = sd->items; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Gadcon_Layout_Item *bi;
|
E_Gadcon_Layout_Item *bi;
|
||||||
|
@ -2028,13 +2060,11 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
if (give < sub) give = sub;
|
if (give < sub) give = sub;
|
||||||
bi->ask.size2 = bi->ask.size - give;
|
bi->ask.size2 = bi->ask.size - give;
|
||||||
sub -= give;
|
sub -= give;
|
||||||
printf("GIVE: %i\n", give);
|
|
||||||
if (sub <= 0) break;
|
if (sub <= 0) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* EEK - all items just cant fit at their minimum! what do we do? */
|
{ /* EEK - all items just cant fit at their minimum! what do we do? */
|
||||||
printf("EEK - nofit!\n");
|
|
||||||
num = 0;
|
num = 0;
|
||||||
num = evas_list_count(sd->items);
|
num = evas_list_count(sd->items);
|
||||||
give = min - h; // how much give total below minw we need
|
give = min - h; // how much give total below minw we need
|
||||||
|
@ -2429,7 +2459,6 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
evas_list_free(list_e);
|
evas_list_free(list_e);
|
||||||
evas_list_free(list);
|
evas_list_free(list);
|
||||||
|
|
||||||
printf("-------------------v\n");
|
|
||||||
for (l = sd->items; l; l = l->next)
|
for (l = sd->items; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Gadcon_Layout_Item *bi;
|
E_Gadcon_Layout_Item *bi;
|
||||||
|
@ -2449,13 +2478,9 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
|
||||||
xx = x + ((w - bi->w) / 2);
|
xx = x + ((w - bi->w) / 2);
|
||||||
yy = y + bi->y;
|
yy = y + bi->y;
|
||||||
}
|
}
|
||||||
printf("%p -> %i,%i [%i,%i], %ix%i\n",
|
|
||||||
obj,
|
|
||||||
xx, yy, bi->x, bi->y, bi->w, bi->h);
|
|
||||||
evas_object_move(obj, xx, yy);
|
evas_object_move(obj, xx, yy);
|
||||||
evas_object_resize(obj, bi->w, bi->h);
|
evas_object_resize(obj, bi->w, bi->h);
|
||||||
}
|
}
|
||||||
printf("-------------------^\n");
|
|
||||||
sd->doing_config = 0;
|
sd->doing_config = 0;
|
||||||
if (sd->redo_config)
|
if (sd->redo_config)
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,6 +70,8 @@ struct _E_Gadcon
|
||||||
Evas_Object *(*func) (void *data, E_Gadcon_Client *gcc, const char *style);
|
Evas_Object *(*func) (void *data, E_Gadcon_Client *gcc, const char *style);
|
||||||
void *data;
|
void *data;
|
||||||
} frame_request;
|
} frame_request;
|
||||||
|
|
||||||
|
unsigned char editing : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GADCON_CLIENT_CLASS_VERSION 1
|
#define GADCON_CLIENT_CLASS_VERSION 1
|
||||||
|
|
|
@ -822,12 +822,12 @@ _e_int_menus_gadgets_edit_mode_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
gm = data;
|
gm = data;
|
||||||
if (e_menu_item_toggle_get(mi))
|
if (e_menu_item_toggle_get(mi))
|
||||||
{
|
{
|
||||||
e_gadcon_all_edit_begin();
|
// e_gadcon_all_edit_begin();
|
||||||
e_gadman_mode_set(gm, E_GADMAN_MODE_EDIT);
|
e_gadman_mode_set(gm, E_GADMAN_MODE_EDIT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
e_gadcon_all_edit_end();
|
// e_gadcon_all_edit_end();
|
||||||
e_gadman_mode_set(gm, E_GADMAN_MODE_NORMAL);
|
e_gadman_mode_set(gm, E_GADMAN_MODE_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -422,6 +422,12 @@ e_shelf_position_calc(E_Shelf *es)
|
||||||
static void
|
static void
|
||||||
_e_shelf_free(E_Shelf *es)
|
_e_shelf_free(E_Shelf *es)
|
||||||
{
|
{
|
||||||
|
if (es->menu)
|
||||||
|
{
|
||||||
|
e_menu_post_deactivate_callback_set(es->menu, NULL, NULL);
|
||||||
|
e_object_del(E_OBJECT(es->menu));
|
||||||
|
es->menu = NULL;
|
||||||
|
}
|
||||||
if (es->config_dialog) e_object_del(E_OBJECT(es->config_dialog));
|
if (es->config_dialog) e_object_del(E_OBJECT(es->config_dialog));
|
||||||
shelves = evas_list_remove(shelves, es);
|
shelves = evas_list_remove(shelves, es);
|
||||||
e_object_del(E_OBJECT(es->gadcon));
|
e_object_del(E_OBJECT(es->gadcon));
|
||||||
|
@ -509,7 +515,6 @@ _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord
|
||||||
nw = es->w;
|
nw = es->w;
|
||||||
nh = es->h;
|
nh = es->h;
|
||||||
ww = hh = 0;
|
ww = hh = 0;
|
||||||
printf("req = %i %i\n", w, h);
|
|
||||||
evas_object_geometry_get(gc->o_container, NULL, NULL, &ww, &hh);
|
evas_object_geometry_get(gc->o_container, NULL, NULL, &ww, &hh);
|
||||||
switch (gc->orient)
|
switch (gc->orient)
|
||||||
{
|
{
|
||||||
|
@ -537,10 +542,8 @@ _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf("adj min = %i %i\n", w, h);
|
|
||||||
e_gadcon_swallowed_min_size_set(gc, 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);
|
|
||||||
switch (gc->orient)
|
switch (gc->orient)
|
||||||
{
|
{
|
||||||
case E_GADCON_ORIENT_FLOAT:
|
case E_GADCON_ORIENT_FLOAT:
|
||||||
|
@ -687,6 +690,38 @@ _e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *styl
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_shelf_cb_menu_config(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Shelf *es;
|
||||||
|
|
||||||
|
es = data;
|
||||||
|
if (!es->config_dialog) e_int_shelf_config(es);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_shelf_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Shelf *es;
|
||||||
|
|
||||||
|
es = data;
|
||||||
|
if (es->gadcon->editing)
|
||||||
|
e_gadcon_edit_end(es->gadcon);
|
||||||
|
else
|
||||||
|
e_gadcon_edit_begin(es->gadcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_shelf_cb_menu_post(void *data, E_Menu *m)
|
||||||
|
{
|
||||||
|
E_Shelf *es;
|
||||||
|
|
||||||
|
es = data;
|
||||||
|
if (!es->menu) return;
|
||||||
|
e_object_del(E_OBJECT(es->menu));
|
||||||
|
es->menu = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
_e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -697,7 +732,34 @@ _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_inf
|
||||||
ev = event_info;
|
ev = event_info;
|
||||||
if (ev->button == 3)
|
if (ev->button == 3)
|
||||||
{
|
{
|
||||||
if (!es->config_dialog) e_int_shelf_config(es);
|
E_Menu *mn;
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
int cx, cy, cw, ch;
|
||||||
|
|
||||||
|
mn = e_menu_new();
|
||||||
|
e_menu_post_deactivate_callback_set(mn, _e_shelf_cb_menu_post, es);
|
||||||
|
es->menu = mn;
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, _("Configuration"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/config");
|
||||||
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_config, es);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
if (es->gadcon->editing)
|
||||||
|
e_menu_item_label_set(mi, _("Stop editing items"));
|
||||||
|
else
|
||||||
|
e_menu_item_label_set(mi, _("Begin editing items"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/edit");
|
||||||
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_edit, es);
|
||||||
|
|
||||||
|
e_gadcon_canvas_zone_geometry_get(es->gadcon, &cx, &cy, &cw, &ch);
|
||||||
|
e_menu_activate_mouse(mn,
|
||||||
|
e_util_zone_current_get(e_manager_current_get()),
|
||||||
|
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||||
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||||
|
evas_event_feed_mouse_up(es->gadcon->evas, ev->button,
|
||||||
|
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ struct _E_Shelf
|
||||||
unsigned char fit_size : 1;
|
unsigned char fit_size : 1;
|
||||||
int size;
|
int size;
|
||||||
E_Config_Dialog *config_dialog;
|
E_Config_Dialog *config_dialog;
|
||||||
|
E_Menu *menu;
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI int e_shelf_init(void);
|
EAPI int e_shelf_init(void);
|
||||||
|
|
Loading…
Reference in New Issue