forked from enlightenment/enlightenment
... improve that popup box from ibar to not scale all over the place... but.. comp mirrors are full of garbage for me.
This commit is contained in:
parent
2babd46029
commit
5548e4afa7
|
@ -3,6 +3,7 @@ group { name: "e/modules/ibox/icon";
|
||||||
// 1 or 0 if u want an icon holder to raise when the mouse (or keyboard) hilights it
|
// 1 or 0 if u want an icon holder to raise when the mouse (or keyboard) hilights it
|
||||||
data.item: "raise_on_hilight" "0";
|
data.item: "raise_on_hilight" "0";
|
||||||
// data.item: "item_list" "item item2 item3";
|
// data.item: "item_list" "item item2 item3";
|
||||||
|
images.image: "led_tiny_green.png" COMP;
|
||||||
parts {
|
parts {
|
||||||
part { name: "item_clip"; type: RECT;
|
part { name: "item_clip"; type: RECT;
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
|
@ -34,15 +35,20 @@ group { name: "e/modules/ibox/icon";
|
||||||
}
|
}
|
||||||
part { name: "indicator";
|
part { name: "indicator";
|
||||||
description { state: "default";
|
description { state: "default";
|
||||||
rel1.offset: 5 2;
|
min: 10 10;
|
||||||
image.normal: "led_light.png";
|
max: 10 10;
|
||||||
aspect: 1.0 1.0; aspect_preference: BOTH;
|
rel1.relative: 1.0 1.0;
|
||||||
max: 32 32;
|
rel1.offset: -4 -4;
|
||||||
color: 0 0 0 0;
|
rel2.relative: 1.0 1.0;
|
||||||
|
rel2.offset: -3 -3;
|
||||||
|
image.normal: "led_tiny_green.png";
|
||||||
|
color: 255 255 255 0;
|
||||||
|
visible: 0;
|
||||||
}
|
}
|
||||||
description { state: "visible" 0.0;
|
description { state: "visible" 0.0;
|
||||||
inherit: "default" 0.0;
|
inherit: "default" 0.0;
|
||||||
color: 255 255 255 200;
|
color: 255 255 255 255;
|
||||||
|
visible: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "over"; type: RECT;
|
part { name: "over"; type: RECT;
|
||||||
|
@ -80,17 +86,17 @@ group { name: "e/modules/ibox/icon";
|
||||||
action: STATE_SET "default" 0.0;
|
action: STATE_SET "default" 0.0;
|
||||||
target: "item_clip";
|
target: "item_clip";
|
||||||
}
|
}
|
||||||
program { name: "ion";
|
program {
|
||||||
signal: "e,state,on"; source: "e";
|
signal: "e,state,on"; source: "e";
|
||||||
action: STATE_SET "visible" 0.0;
|
action: STATE_SET "visible" 0.0;
|
||||||
target: "indicator";
|
target: "indicator";
|
||||||
transition: ACCELERATE 0.1;
|
transition: ACCELERATE 0.2;
|
||||||
}
|
}
|
||||||
program { name: "ioff";
|
program {
|
||||||
signal: "e,state,off"; source: "e";
|
signal: "e,state,off"; source: "e";
|
||||||
action: STATE_SET "default" 0.0;
|
action: STATE_SET "default" 0.0;
|
||||||
target: "indicator";
|
target: "indicator";
|
||||||
transition: DECELERATE 0.1;
|
transition: DECELERATE 0.8;
|
||||||
}
|
}
|
||||||
program {
|
program {
|
||||||
signal: "e,state,urgent"; source: "e";
|
signal: "e,state,urgent"; source: "e";
|
||||||
|
@ -125,7 +131,8 @@ group { name: "e/modules/ibar/menu";
|
||||||
description { state: "default";
|
description { state: "default";
|
||||||
}
|
}
|
||||||
description { state: "hidden";
|
description { state: "hidden";
|
||||||
rel1.relative: 1 1;
|
rel1.relative: 0.5 1.0;
|
||||||
|
rel2.relative: 0.5 1.0;
|
||||||
minmul: 0 0;
|
minmul: 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,7 +161,7 @@ group { name: "e/modules/ibar/menu";
|
||||||
rel1.to: "sizer";
|
rel1.to: "sizer";
|
||||||
rel1.offset: 12 12;
|
rel1.offset: 12 12;
|
||||||
rel2.to: "sizer";
|
rel2.to: "sizer";
|
||||||
rel2.offset: -12 -12;
|
rel2.offset: -13 -13;
|
||||||
box { layout: "vertical";
|
box { layout: "vertical";
|
||||||
padding: 0 0;
|
padding: 0 0;
|
||||||
align: 0.5 0.5;
|
align: 0.5 0.5;
|
||||||
|
@ -191,43 +198,44 @@ group { name: "e/modules/ibar/menu";
|
||||||
|
|
||||||
group { name: "e/modules/ibar/menu/item";
|
group { name: "e/modules/ibar/menu/item";
|
||||||
parts {
|
parts {
|
||||||
part { name: "sizer"; type: SPACER;
|
part { name: "icon"; type: SPACER;
|
||||||
scale: 1;
|
|
||||||
description { state: "default";
|
description { state: "default";
|
||||||
}
|
rel1.offset: 2 2;
|
||||||
description { state: "focus";
|
rel2.offset: 2 -3;
|
||||||
rel1.relative: -2 -2;
|
align: 0.0 0.5;
|
||||||
rel2.relative: 2 2;
|
aspect: 1.0 1.0; aspect_preference: BOTH;
|
||||||
|
min: 48 48;
|
||||||
|
max: 48 48;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "e.swallow.icon"; type: SWALLOW; mouse_events: 0;
|
part { name: "e.swallow.icon"; type: SWALLOW; mouse_events: 0;
|
||||||
clip_to: "icon_clip";
|
clip_to: "icon_clip";
|
||||||
description { state: "default";
|
description { state: "default";
|
||||||
align: 0.0 0.5;
|
rel1.to: "icon";
|
||||||
aspect: 1.0 1.0;
|
rel2.to: "icon";
|
||||||
aspect_preference: BOTH;
|
}
|
||||||
rel1.to: "sizer";
|
description { state: "focus";
|
||||||
rel2.to: "sizer";
|
inherit: "default";
|
||||||
min: 32 32;
|
rel1.offset: -2 -2;
|
||||||
|
rel2.offset: 1 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "e.text.title"; type: TEXT; mouse_events: 0;
|
part { name: "e.text.title"; type: TEXT; mouse_events: 0;
|
||||||
effect: SHADOW BOTTOM;
|
effect: SHADOW BOTTOM;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
rel1.to_x: "e.swallow.icon";
|
rel1.to_x: "icon";
|
||||||
rel1.relative: 1.0 0.0;
|
rel1.relative: 1.0 0.0;
|
||||||
rel1.offset: 4 0;
|
rel1.offset: 3 0;
|
||||||
rel1.to_y: "sizer";
|
rel2.offset: -3 -3;
|
||||||
rel2.to: "sizer";
|
|
||||||
rel2.offset: -1 -2;
|
|
||||||
color: 255 255 255 255;
|
color: 255 255 255 255;
|
||||||
color3: 0 0 0 128;
|
color3: 0 0 0 128;
|
||||||
align: 0.0 0.0;
|
align: 0.0 0.0;
|
||||||
color_class: "menu_item";
|
color_class: "menu_item";
|
||||||
|
min: 128 0;
|
||||||
text { font: "Sans:style=Bold"; size: 10;
|
text { font: "Sans:style=Bold"; size: 10;
|
||||||
text: "window name thingy";
|
text: "window name thingy";
|
||||||
min: 1 1;
|
min: 0 1;
|
||||||
align: 0.0 0.5;
|
align: 0.0 0.5;
|
||||||
text_class: "menu_item";
|
text_class: "menu_item";
|
||||||
}
|
}
|
||||||
|
@ -249,9 +257,10 @@ group { name: "e/modules/ibar/menu/item";
|
||||||
color2: 51 153 255 24;
|
color2: 51 153 255 24;
|
||||||
color3: 51 153 255 18;
|
color3: 51 153 255 18;
|
||||||
color_class: "menu_item_active";
|
color_class: "menu_item_active";
|
||||||
|
min: 128 0;
|
||||||
text { font: "Sans:style=Bold"; size: 10;
|
text { font: "Sans:style=Bold"; size: 10;
|
||||||
text_source: "e.text.title";
|
text_source: "e.text.title";
|
||||||
min: 1 1;
|
min: 0 1;
|
||||||
align: 0.0 0.5;
|
align: 0.0 0.5;
|
||||||
text_class: "menu_item";
|
text_class: "menu_item";
|
||||||
}
|
}
|
||||||
|
@ -270,7 +279,7 @@ group { name: "e/modules/ibar/menu/item";
|
||||||
}
|
}
|
||||||
description { state: "focus";
|
description { state: "focus";
|
||||||
inherit: "default";
|
inherit: "default";
|
||||||
color: 255 255 255 222;
|
color: 255 255 255 200;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "event"; type: RECT;
|
part { name: "event"; type: RECT;
|
||||||
|
@ -283,7 +292,7 @@ group { name: "e/modules/ibar/menu/item";
|
||||||
program {
|
program {
|
||||||
signal: "mouse,in"; source: "event";
|
signal: "mouse,in"; source: "event";
|
||||||
action: STATE_SET "focus" 0.0;
|
action: STATE_SET "focus" 0.0;
|
||||||
target: "sizer";
|
target: "e.swallow.icon";
|
||||||
target: "e.text.title";
|
target: "e.text.title";
|
||||||
target: "title2";
|
target: "title2";
|
||||||
target: "icon_clip";
|
target: "icon_clip";
|
||||||
|
@ -292,7 +301,7 @@ group { name: "e/modules/ibar/menu/item";
|
||||||
program {
|
program {
|
||||||
signal: "mouse,out"; source: "event";
|
signal: "mouse,out"; source: "event";
|
||||||
action: STATE_SET "default" 0.0;
|
action: STATE_SET "default" 0.0;
|
||||||
target: "sizer";
|
target: "e.swallow.icon";
|
||||||
target: "e.text.title";
|
target: "e.text.title";
|
||||||
target: "title2";
|
target: "title2";
|
||||||
target: "icon_clip";
|
target: "icon_clip";
|
||||||
|
|
|
@ -901,7 +901,8 @@ _ibar_icon_menu(IBar_Icon *ic)
|
||||||
E_OBJECT_DEL_SET(ic->menu, _ibar_cb_icon_menu_del);
|
E_OBJECT_DEL_SET(ic->menu, _ibar_cb_icon_menu_del);
|
||||||
e = e_comp_get(ic->menu)->evas;
|
e = e_comp_get(ic->menu)->evas;
|
||||||
o = edje_object_add(e);
|
o = edje_object_add(e);
|
||||||
e_theme_edje_object_set(o, "base/theme/modules/ibar", "e/modules/ibar/menu");
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
||||||
|
"e/modules/ibar/menu");
|
||||||
EINA_LIST_FOREACH(ic->exes, l, exe)
|
EINA_LIST_FOREACH(ic->exes, l, exe)
|
||||||
{
|
{
|
||||||
Evas_Object *img;
|
Evas_Object *img;
|
||||||
|
@ -910,12 +911,15 @@ _ibar_icon_menu(IBar_Icon *ic)
|
||||||
if (!exe->bd) continue; //WTF
|
if (!exe->bd) continue; //WTF
|
||||||
it = edje_object_add(e);
|
it = edje_object_add(e);
|
||||||
e_popup_object_add(ic->menu->win, it);
|
e_popup_object_add(ic->menu->win, it);
|
||||||
e_theme_edje_object_set(it, "base/theme/modules/ibar", "e/modules/ibar/menu/item");
|
e_theme_edje_object_set(it, "base/theme/modules/ibar",
|
||||||
|
"e/modules/ibar/menu/item");
|
||||||
img = e_comp_win_image_mirror_add(exe->bd->cw);
|
img = e_comp_win_image_mirror_add(exe->bd->cw);
|
||||||
evas_object_event_callback_add(img, EVAS_CALLBACK_DEL, _ibar_cb_icon_menu_img_del, it);
|
evas_object_event_callback_add(img, EVAS_CALLBACK_DEL,
|
||||||
|
_ibar_cb_icon_menu_img_del, it);
|
||||||
txt = exe->bd->client.netwm.name ?:
|
txt = exe->bd->client.netwm.name ?:
|
||||||
(exe->bd->client.icccm.title ?: exe->bd->client.icccm.name);
|
(exe->bd->client.icccm.title ?: exe->bd->client.icccm.name);
|
||||||
w = exe->bd->cw->pw, h = exe->bd->cw->ph;
|
w = exe->bd->cw->pw;
|
||||||
|
h = exe->bd->cw->ph;
|
||||||
e_popup_object_add(ic->menu->win, img);
|
e_popup_object_add(ic->menu->win, img);
|
||||||
evas_object_show(img);
|
evas_object_show(img);
|
||||||
edje_extern_object_aspect_set(img, EDJE_ASPECT_CONTROL_BOTH, w, h);
|
edje_extern_object_aspect_set(img, EDJE_ASPECT_CONTROL_BOTH, w, h);
|
||||||
|
@ -924,6 +928,7 @@ _ibar_icon_menu(IBar_Icon *ic)
|
||||||
edje_object_calc_force(it);
|
edje_object_calc_force(it);
|
||||||
edje_object_size_min_calc(it, &w, &h);
|
edje_object_size_min_calc(it, &w, &h);
|
||||||
edje_extern_object_min_size_set(it, w, h);
|
edje_extern_object_min_size_set(it, w, h);
|
||||||
|
evas_object_size_hint_min_set(it, w, h);
|
||||||
evas_object_show(it);
|
evas_object_show(it);
|
||||||
evas_object_event_callback_add(it, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(it, EVAS_CALLBACK_MOUSE_UP,
|
||||||
_ibar_cb_icon_menu_mouse_up, exe->bd);
|
_ibar_cb_icon_menu_mouse_up, exe->bd);
|
||||||
|
@ -939,7 +944,8 @@ _ibar_icon_menu(IBar_Icon *ic)
|
||||||
evas_object_del(ic->menu->o_bg);
|
evas_object_del(ic->menu->o_bg);
|
||||||
ic->menu->o_bg = o;
|
ic->menu->o_bg = o;
|
||||||
ic->menu->w = w, ic->menu->h = h;
|
ic->menu->w = w, ic->menu->h = h;
|
||||||
edje_object_signal_callback_add(o, "e,action,hide,done", "*", _ibar_cb_icon_menu_hidden, ic);
|
edje_object_signal_callback_add(o, "e,action,hide,done", "*",
|
||||||
|
_ibar_cb_icon_menu_hidden, ic);
|
||||||
e_popup_resize(ic->menu->win, w, h);
|
e_popup_resize(ic->menu->win, w, h);
|
||||||
edje_object_signal_emit(o, "e,state,hidden", "e");
|
edje_object_signal_emit(o, "e,state,hidden", "e");
|
||||||
edje_object_message_signal_process(o);
|
edje_object_message_signal_process(o);
|
||||||
|
@ -1109,8 +1115,10 @@ _ibar_instance_watch(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type)
|
||||||
{
|
{
|
||||||
case E_EXEC_WATCH_STOPPED:
|
case E_EXEC_WATCH_STOPPED:
|
||||||
case E_EXEC_WATCH_TIMEOUT:
|
case E_EXEC_WATCH_TIMEOUT:
|
||||||
|
_ibar_icon_signal_emit(ic, "e,state,started", "e");
|
||||||
ic->exes = eina_list_remove(ic->exes, inst);
|
ic->exes = eina_list_remove(ic->exes, inst);
|
||||||
if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,off", "e");
|
if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,off", "e");
|
||||||
|
ic->exe_inst = NULL;
|
||||||
break;
|
break;
|
||||||
case E_EXEC_WATCH_STARTED:
|
case E_EXEC_WATCH_STARTED:
|
||||||
_ibar_icon_signal_emit(ic, "e,state,started", "e");
|
_ibar_icon_signal_emit(ic, "e,state,started", "e");
|
||||||
|
|
Loading…
Reference in New Issue