default.edc: move tab selector on the tab line

This commit is contained in:
Boris Faure 2019-10-26 18:18:03 +02:00
parent c130c6f683
commit 1195c022f3
4 changed files with 323 additions and 65 deletions

View File

@ -9,6 +9,11 @@ Changes since 1.5.0:
* In group "terminology/background", add signals "tab,bell,on" and
"tab,bell,off" from "terminology" to set bell status on tab if there is a
tab.
* In group "terminology/background", change signals "tabcount,go",
"tabcount,prev", "tabcount,next" to "tab,go", "tab,prev" and "tab,next"
respectively.
* In group "terminology/background", add signal "tab,new" from "terminology"
to create a new tab.
Changes since 1.2.0:
--------------------

View File

@ -629,15 +629,19 @@ collections {
}
program {
signal: "mouse,clicked,1"; source: "tabcount_ev";
action: SIGNAL_EMIT "tabcount,go" "terminology";
action: SIGNAL_EMIT "tab,go" "terminology";
}
program {
signal: "mouse,clicked,3"; source: "tabcount_ev";
action: SIGNAL_EMIT "tab,new" "terminology";
}
program {
signal: "mouse,wheel,0,1"; source: "tabcount_ev";
action: SIGNAL_EMIT "tabcount,prev" "terminology";
action: SIGNAL_EMIT "tab,prev" "terminology";
}
program {
signal: "mouse,wheel,0,-1"; source: "tabcount_ev";
action: SIGNAL_EMIT "tabcount,next" "terminology";
action: SIGNAL_EMIT "tab,next" "terminology";
}
program {
signal: "tabcount,off"; source: "terminology";
@ -1332,6 +1336,233 @@ collections {
target: "tabtitle";
target: "tabclose";
}
program {
signal: "tab_btn,on"; source: "terminology";
action: STATE_SET "on" 0.0;
target: "tab_btn_clip";
target: "terminology.tab_btn";
}
program {
signal: "tab_btn,off"; source: "terminology";
action: STATE_SET "default" 0.0;
target: "tab_btn_clip";
target: "terminology.tab_btn";
}
part { name: "tab_btn_clip"; type: RECT;
description { state: "default" 0.0;
color: 255 255 255 0;
visible: 0;
}
description { state: "on" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}
part { name: "tab_btn_glow_r0";
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "tab_btn_r0";
rel2.to: "tab_btn_r0";
rel1.offset: -4 -4;
rel2.offset: 3 3;
image {
normal: "cr_glow.png";
border: 9 9 9 9;
}
color: 51 153 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 51 153 255 255;
}
}
part { name: "tab_btn_glow_r1";
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "tab_btn_r1";
rel2.to: "tab_btn_r1";
rel1.offset: -4 -4;
rel2.offset: 3 3;
image {
normal: "cr_glow.png";
border: 9 9 9 9;
}
color: 51 153 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 51 153 255 255;
}
}
part { name: "tab_btn_glow_r2";
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "tab_btn_r2";
rel2.to: "tab_btn_r2";
rel1.offset: -4 -4;
rel2.offset: 3 3;
image {
normal: "cr_glow.png";
border: 9 9 9 9;
}
color: 51 153 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 51 153 255 255;
}
}
part { name: "tab_btn_glow_r3";
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "tab_btn_r3";
rel2.to: "tab_btn_r3";
rel1.offset: -4 -4;
rel2.offset: 3 3;
image {
normal: "cr_glow.png";
border: 9 9 9 9;
}
color: 51 153 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 51 153 255 255;
}
}
part { name: "tab_btn_r0"; type: RECT;
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "terminology.tab_btn";
rel2.to: "terminology.tab_btn";
rel1.relative: 0.05 0.05;
rel2.relative: 0.45 0.45;
color: 255 255 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
part { name: "tab_btn_r1"; type: RECT;
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "terminology.tab_btn";
rel2.to: "terminology.tab_btn";
rel1.relative: 0.55 0.05;
rel2.relative: 0.95 0.45;
color: 255 255 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
part { name: "tab_btn_r2"; type: RECT;
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "terminology.tab_btn";
rel2.to: "terminology.tab_btn";
rel1.relative: 0.05 0.55;
rel2.relative: 0.45 0.95;
color: 255 255 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
part { name: "tab_btn_r3"; type: RECT;
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "terminology.tab_btn";
rel2.to: "terminology.tab_btn";
rel1.relative: 0.55 0.55;
rel2.relative: 0.95 0.95;
color: 255 255 255 32;
}
description { state: "over" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
part { name: "terminology.tab_btn"; type: SWALLOW;
clip_to: "tab_btn_clip";
mouse_events: 0;
description { state: "default" 0.0;
rel1.relative: 1.0 0.0;
rel2.to_y: "tabmiddle";
color: 250 0 250 255;
visible: 0;
align: 1.0 0.0;
fixed: 1 1;
}
description { state: "on" 0.0;
inherit: "default" 0.0;
min: 16 16;
visible: 1;
}
}
part { name: "tab_btn_ev"; type: RECT; repeat_events: 1;
clip_to: "tab_btn_clip";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "terminology.tab_btn";
rel2.to: "terminology.tab_btn";
color: 0 0 0 0;
}
}
program {
signal: "mouse,in"; source: "tab_btn_ev";
action: STATE_SET "over" 0.0;
transition: DECELERATE 0.5;
target: "tab_btn_r0";
target: "tab_btn_r1";
target: "tab_btn_r2";
target: "tab_btn_r3";
target: "tab_btn_glow_r0";
target: "tab_btn_glow_r1";
target: "tab_btn_glow_r2";
target: "tab_btn_glow_r3";
}
program {
signal: "mouse,out"; source: "tab_btn_ev";
action: STATE_SET "default" 0.0;
transition: DECELERATE 2.0;
target: "tab_btn_r0";
target: "tab_btn_r1";
target: "tab_btn_r2";
target: "tab_btn_r3";
target: "tab_btn_glow_r0";
target: "tab_btn_glow_r1";
target: "tab_btn_glow_r2";
target: "tab_btn_glow_r3";
}
program {
signal: "mouse,clicked,1"; source: "tab_btn_ev";
action: SIGNAL_EMIT "tab,go" "terminology";
}
program {
signal: "mouse,clicked,3"; source: "tab_btn_ev";
action: SIGNAL_EMIT "tab,new" "terminology";
}
program {
signal: "mouse,wheel,0,1"; source: "tab_btn_ev";
action: SIGNAL_EMIT "tab,prev" "terminology";
}
program {
signal: "mouse,wheel,0,-1"; source: "tab_btn_ev";
action: SIGNAL_EMIT "tab,next" "terminology";
}
part { name: "terminology.tab"; type: SWALLOW;
mouse_events: 0;
@ -1348,11 +1579,12 @@ collections {
// some slot for dragable parts to stay in along top edge of bg
part { name: "tabdrag"; type: SPACER;
description { state: "default" 0.0;
rel2.relative: 1.0 0.0;
rel2.relative: 0.0 0.0;
rel2.to_x: "terminology.tab_btn";
fixed: 1 1;
}
}
// left boundary of the active tab (ragable 0.0 -> 1.0)
// left boundary of the active tab (dragable 0.0 -> 1.0)
part { name: "terminology.tabl"; type: SPACER;
dragable.x: 1 1 0;
dragable.confine: "tabdrag";
@ -1362,12 +1594,13 @@ collections {
fixed: 1 1;
}
}
// right boundary of the active tab (ragable 0.0 -> 1.0)
// right boundary of the active tab (dragable 0.0 -> 1.0)
part { name: "terminology.tabr"; type: SPACER;
dragable.x: 1 1 0;
dragable.confine: "tabdrag";
description { state: "default" 0.0;
rel2.relative: 1.0 0.0;
rel2.relative: 0.0 0.0;
rel2.to_x: "terminology.tab_btn";
max: 1 1;
fixed: 1 1;
}
@ -1461,12 +1694,15 @@ collections {
visible: 1;
}
}
/*TODO boris */
part { name: "tabright"; type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "terminology.tab";
rel1.relative: 1.0 0.0;
rel2.to_x: "terminology.tab_btn";
rel2.to_y: "tabmiddle";
rel2.relative: 0.0 1.0;
color: 0 0 0 0;
visible: 0;
fixed: 1 1;

View File

@ -442,7 +442,19 @@ collections {
}
program {
signal: "mouse,clicked,1"; source: "tabcount_ev";
action: SIGNAL_EMIT "tabcount,go" "terminology";
action: SIGNAL_EMIT "tab,go" "terminology";
}
program {
signal: "mouse,clicked,3"; source: "tabcount_ev";
action: SIGNAL_EMIT "tab,new" "terminology";
}
program {
signal: "mouse,wheel,0,1"; source: "tabcount_ev";
action: SIGNAL_EMIT "tab,prev" "terminology";
}
program {
signal: "mouse,wheel,0,-1"; source: "tabcount_ev";
action: SIGNAL_EMIT "tab,next" "terminology";
}
program {
signal: "tabcount,off"; source: "terminology";

View File

@ -91,7 +91,6 @@ struct _Term
Evas_Object *sendfile_request;
Evas_Object *sendfile_progress;
Evas_Object *sendfile_progress_bar;
Evas_Object *tabcount_spacer;
Evas_Object *tab_spacer;
Evas_Object *tab_region_base;
Evas_Object *tab_region_bg;
@ -3353,11 +3352,13 @@ _tabs_close(Term_Container *tc, Term_Container *child)
next_term = next_solo->term;
config = next_term->config;
edje_object_signal_emit(next_term->bg, "tabcount,off", "terminology");
if (next_term->tabcount_spacer && !config->show_tabs)
edje_object_signal_emit(term->bg, "tab_btn,off", "terminology");
evas_object_del(term->tab_spacer);
term->tab_spacer = NULL;
if (next_term->tab_spacer && !config->show_tabs)
{
evas_object_del(next_term->tabcount_spacer);
next_term->tabcount_spacer = NULL;
evas_object_del(next_term->tab_spacer);
next_term->tab_spacer = NULL;
}
if (config->show_tabs)
_solo_title_show(next_child);
@ -3563,10 +3564,10 @@ _tabs_swallow(Term_Container *tc, Term_Container *orig,
solo = (Solo*)orig;
term = solo->term;
edje_object_signal_emit(term->bg, "tabcount,off", "terminology");
if (term->tabcount_spacer)
if (term->tab_spacer)
{
evas_object_del(term->tabcount_spacer);
term->tabcount_spacer = NULL;
evas_object_del(term->tab_spacer);
term->tab_spacer = NULL;
}
o = orig->get_evas_object(orig);
@ -3872,56 +3873,48 @@ _tabs_refresh(Tabs *tabs)
_tabbar_clear(term);
if (!term->tabcount_spacer)
if (!term->tab_spacer)
{
term->tabcount_spacer = evas_object_rectangle_add(evas_object_evas_get(term->bg));
evas_object_color_set(term->tabcount_spacer, 0, 0, 0, 0);
term->tab_spacer = evas_object_rectangle_add(evas_object_evas_get(term->bg));
evas_object_color_set(term->tab_spacer, 0, 0, 0, 0);
}
elm_coords_finger_size_adjust(1, &w, 1, &h);
evas_object_size_hint_min_set(term->tabcount_spacer, w, h);
edje_object_part_swallow(term->bg, "terminology.tabcount.control",
term->tabcount_spacer);
edje_object_part_text_set(term->bg, "terminology.tabcount.label", buf);
edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed);
edje_object_signal_emit(term->bg, "tabcount,on", "terminology");
evas_object_size_hint_min_set(term->tab_spacer, w, h);
// this is all below just for tab bar at the top
if (term->config->show_tabs)
{
double v1, v2;
edje_object_part_swallow(term->bg, "terminology.tab_btn",
term->tab_spacer);
v1 = (double)(i-1) / (double)n;
v2 = (double)i / (double)n;
if (!term->tab_spacer)
{
term->tab_spacer = evas_object_rectangle_add(
evas_object_evas_get(term->bg));
evas_object_color_set(term->tab_spacer, 0, 0, 0, 0);
elm_coords_finger_size_adjust(1, &w, 1, &h);
evas_object_size_hint_min_set(term->tab_spacer, w, h);
edje_object_part_swallow(term->bg, "terminology.tab", term->tab_spacer);
edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
edje_object_part_text_set(term->bg, "terminology.tab.title",
solo->tc.title);
edje_object_signal_emit(term->bg, "tabbar,on", "terminology");
edje_object_message_signal_process(term->bg);
}
else
{
edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
edje_object_message_signal_process(term->bg);
}
edje_object_signal_emit(term->bg, "tabcount,off", "terminology");
edje_object_part_swallow(term->bg, "terminology.tab", term->tab_spacer);
edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
edje_object_part_text_set(term->bg, "terminology.tab.title",
solo->tc.title);
edje_object_signal_emit(term->bg, "tabbar,on", "terminology");
edje_object_signal_emit(term->bg, "tab_btn,on", "terminology");
_tabbar_fill(tabs);
}
else
{
edje_object_part_swallow(term->bg, "terminology.tabcount.control",
term->tab_spacer);
edje_object_part_text_set(term->bg, "terminology.tabcount.label", buf);
edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed);
edje_object_signal_emit(term->bg, "tabcount,on", "terminology");
_tabbar_clear(term);
if (missed > 0)
edje_object_signal_emit(term->bg, "tabmissed,on", "terminology");
else
edje_object_signal_emit(term->bg, "tabmissed,off", "terminology");
}
if (missed > 0)
edje_object_signal_emit(term->bg, "tabmissed,on", "terminology");
else
edje_object_signal_emit(term->bg, "tabmissed,off", "terminology");
edje_object_message_signal_process(term->bg);
}
static Tab_Item*
@ -5184,14 +5177,24 @@ _cb_command(void *data,
}
static void
_cb_tabcount_go(void *data,
Evas_Object *_obj EINA_UNUSED,
const char *_sig EINA_UNUSED,
const char *_src EINA_UNUSED)
_cb_tab_go(void *data,
Evas_Object *_obj EINA_UNUSED,
const char *_sig EINA_UNUSED,
const char *_src EINA_UNUSED)
{
_cb_select(data, NULL, NULL);
}
static void
_cb_tab_new(void *data,
Evas_Object *_obj EINA_UNUSED,
const char *_sig EINA_UNUSED,
const char *_src EINA_UNUSED)
{
Term *term = data;
main_new(term->termio);
}
static void
_cb_prev(void *data,
Evas_Object *_obj EINA_UNUSED,
@ -5659,16 +5662,16 @@ _term_free(Term *term)
_term_tabregion_free(term);
if (term->tabcount_spacer)
if (term->tab_spacer)
{
evas_object_del(term->tabcount_spacer);
term->tabcount_spacer = NULL;
evas_object_del(term->tab_spacer);
term->tab_spacer = NULL;
}
free(term);
}
static void
_cb_tabcount_prev(void *data,
_cb_tab_prev(void *data,
Evas_Object *_obj EINA_UNUSED,
const char *_sig EINA_UNUSED,
const char *_src EINA_UNUSED)
@ -5677,7 +5680,7 @@ _cb_tabcount_prev(void *data,
}
static void
_cb_tabcount_next(void *data,
_cb_tab_next(void *data,
Evas_Object *_obj EINA_UNUSED,
const char *_sig EINA_UNUSED,
const char *_src EINA_UNUSED)
@ -5695,12 +5698,14 @@ _term_bg_config(Term *term)
termio_theme_set(term->termio, term->bg);
edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
_cb_popmedia_done, term);
edje_object_signal_callback_add(term->bg, "tabcount,go", "terminology",
_cb_tabcount_go, term);
edje_object_signal_callback_add(term->bg, "tabcount,prev", "terminology",
_cb_tabcount_prev, term);
edje_object_signal_callback_add(term->bg, "tabcount,next", "terminology",
_cb_tabcount_next, term);
edje_object_signal_callback_add(term->bg, "tab,go", "terminology",
_cb_tab_go, term);
edje_object_signal_callback_add(term->bg, "tab,new", "terminology",
_cb_tab_new, term);
edje_object_signal_callback_add(term->bg, "tab,prev", "terminology",
_cb_tab_prev, term);
edje_object_signal_callback_add(term->bg, "tab,next", "terminology",
_cb_tab_next, term);
edje_object_signal_callback_add(term->bg, "tab,close", "terminology",
_cb_tab_close, term);
edje_object_signal_callback_add(term->bg, "tab,title", "terminology",