forked from enlightenment/terminology
improve tab sel look to have its own.
This commit is contained in:
parent
1880987f63
commit
29dd7608c2
|
@ -2085,32 +2085,12 @@ target: "4.bottom"
|
|||
//// the cursor to show where text is typed
|
||||
group { name: "terminology/cursor";
|
||||
images {
|
||||
// image: "cr_fill.png" COMP;
|
||||
image: "cr_key.png" COMP;
|
||||
image: "cr_out.png" COMP;
|
||||
image: "cr_pulse.png" COMP;
|
||||
image: "cr_glow.png" COMP;
|
||||
}
|
||||
parts {
|
||||
/*
|
||||
part { name: "fill";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "cr_fill.png";
|
||||
fill {
|
||||
size {
|
||||
relative: 0.0 0.0;
|
||||
offset: 32 32;
|
||||
}
|
||||
}
|
||||
color: 51 153 255 80;
|
||||
}
|
||||
description { state: "focused" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
*/
|
||||
part { name: "key";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -2276,7 +2256,249 @@ target: "4.bottom"
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// an object to contain the selection tool used for selecting tabs (with
|
||||
//// a glow grid of terms
|
||||
group { name: "terminology/sel/base";
|
||||
images {
|
||||
image: "pm_overlay.png" COMP;
|
||||
image: "pm_fill.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "fill";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "pm_fill.png";
|
||||
fill {
|
||||
size.relative: 0.0 0.0;
|
||||
size.offset: 64 64;
|
||||
}
|
||||
}
|
||||
description { state: "translucent" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
program {
|
||||
signal: "translucent,on"; source: "terminology";
|
||||
action: STATE_SET "translucent" 0.0;
|
||||
target: "fill";
|
||||
}
|
||||
program {
|
||||
signal: "translucent,off"; source: "terminology";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "fill";
|
||||
}
|
||||
|
||||
part { name: "clip"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "terminology.content"; type: SWALLOW;
|
||||
clip_to: "clip";
|
||||
description { state: "default" 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "overlay";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "pm_overlay.png";
|
||||
color: 255 255 255 0;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
program {
|
||||
signal: "begin"; source: "terminology";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: DECELERATE 0.3;
|
||||
target: "overlay";
|
||||
}
|
||||
program {
|
||||
signal: "end"; source: "terminology";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.3 CURRENT;
|
||||
target: "overlay";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "terminology/sel/item";
|
||||
images {
|
||||
image: "bg_bevel.png" COMP;
|
||||
image: "bg_shine.png" COMP;
|
||||
image: "bg_glint.png" COMP;
|
||||
image: "pm_shadow.png" COMP;
|
||||
image: "cr_glow.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "clip"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
color: 128 128 128 255;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part { name: "shadow";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
rel1.offset: -5 -5;
|
||||
rel2.offset: 4 4;
|
||||
image.normal: "pm_shadow.png";
|
||||
image.border: 64 64 64 64;
|
||||
image.border_scale_by: 0.1;
|
||||
color: 255 255 255 128;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
rel1.offset: -40 -40;
|
||||
rel2.offset: 39 39;
|
||||
image.border_scale_by: 1.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part { name: "glow";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
rel1.offset: -4 -4;
|
||||
rel2.offset: 3 3;
|
||||
image {
|
||||
normal: "cr_glow.png";
|
||||
border: 9 9 9 9;
|
||||
}
|
||||
color: 51 153 255 0;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 51 153 255 255;
|
||||
}
|
||||
}
|
||||
part { name: "base"; type: RECT;
|
||||
clip_to: "clip";
|
||||
description { state: "default" 0.0;
|
||||
color: 32 32 32 255;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "terminology.content"; type: SWALLOW;
|
||||
clip_to: "clip";
|
||||
description { state: "default" 0.0;
|
||||
rel1.relative: 0.1 0.1;
|
||||
rel2.relative: 0.9 0.9;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
rel1.relative: 0.0 0.0;
|
||||
rel2.relative: 1.0 1.0;
|
||||
}
|
||||
}
|
||||
program {
|
||||
signal: "selected"; source: "terminology";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
transition: DECELERATE 0.2 CURRENT;
|
||||
target: "terminology.content";
|
||||
target: "shadow";
|
||||
target: "clip";
|
||||
target: "glow";
|
||||
}
|
||||
program {
|
||||
signal: "selected,start"; source: "terminology";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
target: "terminology.content";
|
||||
target: "shadow";
|
||||
target: "clip";
|
||||
target: "glow";
|
||||
}
|
||||
program {
|
||||
signal: "unselected"; source: "terminology";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: DECELERATE 0.4 CURRENT;
|
||||
target: "terminology.content";
|
||||
target: "shadow";
|
||||
target: "clip";
|
||||
target: "glow";
|
||||
}
|
||||
|
||||
part { name: "overlay";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
image.normal: "pm_overlay.png";
|
||||
fill.smooth: 0;
|
||||
}
|
||||
}
|
||||
part { name: "bevel";
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
image.normal: "bg_bevel.png";
|
||||
image.border: 3 3 5 3;
|
||||
image.middle: 0;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
}
|
||||
part { name: "clip2"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
}
|
||||
}
|
||||
part { name: "glint";
|
||||
mouse_events: 0;
|
||||
clip_to: "clip2";
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
min: 79 5;
|
||||
max: 79 5;
|
||||
rel1 {
|
||||
to: "terminology.content";
|
||||
relative: 0.0 0.0;
|
||||
offset: 0 0;
|
||||
}
|
||||
rel2 {
|
||||
to: "terminology.content";
|
||||
relative: 1.0 0.0;
|
||||
offset: -1 0;
|
||||
}
|
||||
image.normal: "bg_glint.png";
|
||||
}
|
||||
}
|
||||
part { name: "shine";
|
||||
mouse_events: 0;
|
||||
clip_to: "clip2";
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
rel1.to: "terminology.content";
|
||||
rel2.to: "terminology.content";
|
||||
image.normal: "bg_shine.png";
|
||||
fill.smooth: 0;
|
||||
align: 0.5 0.0;
|
||||
aspect: (255/120) (255/120);
|
||||
aspect_preference: HORIZONTAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// an object overlayd on text that is a link
|
||||
group { name: "terminology/link";
|
||||
|
|
|
@ -72,6 +72,7 @@ struct _Split
|
|||
Eina_List *terms; // list of terms in the "tabs"
|
||||
Evas_Object *panes; // null if a leaf node
|
||||
Evas_Object *sel; // multi "tab" selector is active
|
||||
Evas_Object *sel_bg; // multi "tab" selector wrapper edje obj for styling
|
||||
Eina_Bool horizontal : 1;
|
||||
};
|
||||
|
||||
|
@ -1069,7 +1070,9 @@ _sel_restore(Split *sp)
|
|||
}
|
||||
}
|
||||
evas_object_del(sp->sel);
|
||||
evas_object_del(sp->sel_bg);
|
||||
sp->sel = NULL;
|
||||
sp->sel_bg = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1103,6 +1106,13 @@ _sel_cb_exit(void *data, Evas_Object *obj __UNUSED__, void *info __UNUSED__)
|
|||
_term_focus_show(sp, sp->term);
|
||||
}
|
||||
|
||||
static void
|
||||
_sel_cb_ending(void *data, Evas_Object *obj __UNUSED__, void *info __UNUSED__)
|
||||
{
|
||||
Split *sp = data;
|
||||
edje_object_signal_emit(sp->sel_bg, "end", "terminology");
|
||||
}
|
||||
|
||||
static void
|
||||
_sel_go(Split *sp, Term *term)
|
||||
{
|
||||
|
@ -1111,6 +1121,13 @@ _sel_go(Split *sp, Term *term)
|
|||
double z;
|
||||
|
||||
evas_object_hide(sp->term->bg);
|
||||
sp->sel_bg = edje_object_add(evas_object_evas_get(sp->wn->win));
|
||||
theme_apply(sp->sel_bg, term->config, "terminology/sel/base");
|
||||
if (term->config->translucent)
|
||||
edje_object_signal_emit(sp->sel_bg, "translucent,on", "terminology");
|
||||
else
|
||||
edje_object_signal_emit(sp->sel_bg, "translucent,off", "terminology");
|
||||
edje_object_signal_emit(sp->sel_bg, "begin", "terminology");
|
||||
sp->sel = sel_add(sp->wn->win);
|
||||
EINA_LIST_FOREACH(sp->terms, l, tm)
|
||||
{
|
||||
|
@ -1127,22 +1144,29 @@ _sel_go(Split *sp, Term *term)
|
|||
tm->sel = termio_mirror_add(tm->term);
|
||||
sel_entry_add(sp->sel, tm->sel, (tm == sp->term), tm->config);
|
||||
}
|
||||
edje_object_part_swallow(sp->sel_bg, "terminology.content", sp->sel);
|
||||
evas_object_show(sp->sel);
|
||||
if (!sp->parent)
|
||||
edje_object_part_swallow(sp->wn->base, "terminology.content", sp->sel);
|
||||
edje_object_part_swallow(sp->wn->base, "terminology.content", sp->sel_bg);
|
||||
else
|
||||
{
|
||||
if (sp == sp->parent->s1)
|
||||
{
|
||||
elm_object_part_content_unset(sp->parent->panes, PANES_TOP);
|
||||
elm_object_part_content_set(sp->parent->panes, PANES_TOP, sp->sel);
|
||||
elm_object_part_content_set(sp->parent->panes, PANES_TOP,
|
||||
sp->sel_bg);
|
||||
}
|
||||
else
|
||||
{
|
||||
elm_object_part_content_unset(sp->parent->panes, PANES_BOTTOM);
|
||||
elm_object_part_content_set(sp->parent->panes, PANES_BOTTOM, sp->sel);
|
||||
elm_object_part_content_set(sp->parent->panes, PANES_BOTTOM,
|
||||
sp->sel_bg);
|
||||
}
|
||||
}
|
||||
evas_object_show(sp->sel);
|
||||
evas_object_show(sp->sel_bg);
|
||||
evas_object_smart_callback_add(sp->sel, "selected", _sel_cb_selected, sp);
|
||||
evas_object_smart_callback_add(sp->sel, "exit", _sel_cb_exit, sp);
|
||||
evas_object_smart_callback_add(sp->sel, "ending", _sel_cb_ending, sp);
|
||||
z = 1.0;
|
||||
sel_go(sp->sel);
|
||||
if (eina_list_count(sp->terms) >= 1)
|
||||
|
@ -1156,8 +1180,6 @@ _sel_go(Split *sp, Term *term)
|
|||
sel_exit(sp->sel);
|
||||
}
|
||||
elm_object_focus_set(sp->sel, EINA_TRUE);
|
||||
evas_object_smart_callback_add(sp->sel, "selected", _sel_cb_selected, sp);
|
||||
evas_object_smart_callback_add(sp->sel, "exit", _sel_cb_exit, sp);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -160,6 +160,7 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
|
|||
ecore_timer_del(sd->autozoom_timeout);
|
||||
sd->autozoom_timeout = NULL;
|
||||
}
|
||||
evas_object_smart_callback_call(data, "ending", NULL);
|
||||
sel_zoom(data, 1.0);
|
||||
}
|
||||
else if (!strcmp(ev->keyname, "Escape"))
|
||||
|
@ -178,6 +179,7 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
|
|||
ecore_timer_del(sd->autozoom_timeout);
|
||||
sd->autozoom_timeout = NULL;
|
||||
}
|
||||
evas_object_smart_callback_call(data, "ending", NULL);
|
||||
sel_zoom(data, 1.0);
|
||||
}
|
||||
}
|
||||
|
@ -277,6 +279,7 @@ _anim_cb(void *data)
|
|||
sd->autozoom_timeout = NULL;
|
||||
}
|
||||
sd->exit_now = EINA_TRUE;
|
||||
evas_object_smart_callback_call(obj, "ending", NULL);
|
||||
sel_zoom(obj, 1.0);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
@ -446,14 +449,14 @@ sel_entry_add(Evas_Object *obj, Evas_Object *entry, Eina_Bool selected, Config *
|
|||
en->selected_before = selected;
|
||||
en->selected_orig = selected;
|
||||
en->bg = edje_object_add(evas_object_evas_get(obj));
|
||||
theme_apply(en->bg, config, "terminology/background");
|
||||
theme_apply(en->bg, config, "terminology/sel/item");
|
||||
evas_object_smart_member_add(en->bg, obj);
|
||||
evas_object_clip_set(en->bg, sd->clip);
|
||||
edje_object_part_swallow(en->bg, "terminology.content", en->obj);
|
||||
evas_object_show(en->obj);
|
||||
evas_object_stack_below(en->bg, sd->o_event);
|
||||
if (en->selected)
|
||||
edje_object_signal_emit(en->bg, "focus,in", "terminology");
|
||||
edje_object_signal_emit(en->bg, "selected,start", "terminology");
|
||||
sd->interp = 1.0;
|
||||
}
|
||||
|
||||
|
@ -461,9 +464,19 @@ void
|
|||
sel_go(Evas_Object *obj)
|
||||
{
|
||||
Sel *sd = evas_object_smart_data_get(obj);
|
||||
Eina_List *l;
|
||||
Entry *en;
|
||||
if (!sd) return;
|
||||
_layout(obj);
|
||||
evas_object_show(sd->clip);
|
||||
EINA_LIST_FOREACH(sd->items, l, en)
|
||||
{
|
||||
if (en->selected)
|
||||
{
|
||||
evas_object_stack_below(en->bg, sd->o_event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -477,14 +490,15 @@ sel_entry_selected_set(Evas_Object *obj, Evas_Object *entry, Eina_Bool keep_befo
|
|||
{
|
||||
if (en->obj == entry)
|
||||
{
|
||||
edje_object_signal_emit(en->bg, "focus,in", "terminology");
|
||||
edje_object_signal_emit(en->bg, "selected", "terminology");
|
||||
evas_object_stack_below(en->bg, sd->o_event);
|
||||
en->selected = EINA_TRUE;
|
||||
}
|
||||
else if (en->obj != entry)
|
||||
{
|
||||
if (en->selected)
|
||||
{
|
||||
edje_object_signal_emit(en->bg, "focus,out", "terminology");
|
||||
edje_object_signal_emit(en->bg, "unselected", "terminology");
|
||||
en->selected = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue