track term titles properly and put them in tab sel views. done for the

moment.
This commit is contained in:
Carsten Haitzler 2013-03-20 13:47:56 +09:00
parent c2afdf1380
commit edd37bbae7
5 changed files with 77 additions and 2 deletions

View File

@ -2411,6 +2411,7 @@ target: "4.bottom"
action: STATE_SET "selected" 0.0;
transition: DECELERATE 0.2 CURRENT;
target: "terminology.content";
target: "terminology.label";
target: "shadow";
target: "clip";
target: "glow";
@ -2419,6 +2420,7 @@ target: "4.bottom"
signal: "selected,start"; source: "terminology";
action: STATE_SET "selected" 0.0;
target: "terminology.content";
target: "terminology.label";
target: "shadow";
target: "clip";
target: "glow";
@ -2428,6 +2430,7 @@ target: "4.bottom"
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.4 CURRENT;
target: "terminology.content";
target: "terminology.label";
target: "shadow";
target: "clip";
target: "glow";
@ -2455,6 +2458,28 @@ target: "4.bottom"
fill.smooth: 0;
}
}
part { name: "terminology.label"; type: TEXT; mouse_events: 0;
effect: GLOW;
scale: 1;
description { state: "default" 0.0;
rel1.to: "terminology.content";
rel2.to: "terminology.content";
color: 51 153 255 255;
color2: 51 153 255 24;
color3: 51 153 255 18;
align: 0.5 1.0;
text { font: "Sans"; size: 10;
align: 0.5 1.0;
min: 0 1;
}
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
color2: 51 153 255 128;
color3: 51 153 255 20;
}
}
part { name: "clip2"; type: RECT;
description { state: "default" 0.0;
rel1.to: "terminology.content";

View File

@ -471,6 +471,7 @@ _term_focus(Term *term)
edje_object_signal_emit(term->bg, "focus,in", "terminology");
if (term->wn->cmdbox) elm_object_focus_set(term->wn->cmdbox, EINA_FALSE);
elm_object_focus_set(term->term, EINA_TRUE);
elm_win_title_set(term->wn->win, termio_title_get(term->term));
}
void
@ -1263,6 +1264,22 @@ _cb_split_v(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
main_split_v(term->wn->win, term->term);
}
static void
_cb_title(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
Term *term = data;
if (term->focused)
elm_win_title_set(term->wn->win, termio_title_get(term->term));
}
static void
_cb_icon(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
Term *term = data;
if (term->focused)
elm_win_icon_name_set(term->wn->win, termio_icon_name_get(term->term));
}
static Eina_Bool
_cb_cmd_focus(void *data)
{
@ -1841,6 +1858,8 @@ main_term_new(Win *wn, Config *config, const char *cmd,
evas_object_smart_callback_add(o, "select", _cb_select, term);
evas_object_smart_callback_add(o, "split,h", _cb_split_h, term);
evas_object_smart_callback_add(o, "split,v", _cb_split_v, term);
evas_object_smart_callback_add(o, "title,change", _cb_title, term);
evas_object_smart_callback_add(o, "icon,change", _cb_icon, term);
evas_object_show(o);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,

View File

@ -441,6 +441,7 @@ void
sel_entry_add(Evas_Object *obj, Evas_Object *entry, Eina_Bool selected, Config *config)
{
Sel *sd = evas_object_smart_data_get(obj);
Evas_Object *o;
Entry *en = calloc(1, sizeof(Entry));
if (!en) return;
sd->items = eina_list_append(sd->items, en);
@ -458,6 +459,16 @@ sel_entry_add(Evas_Object *obj, Evas_Object *entry, Eina_Bool selected, Config *
if (en->selected)
edje_object_signal_emit(en->bg, "selected,start", "terminology");
sd->interp = 1.0;
o = evas_object_data_get(en->obj, "termio");
if (o)
{
const char *s;
s = termio_title_get(o);
if (!s) s = termio_icon_name_get(o);
if (s) edje_object_part_text_set(en->bg, "terminology.label", s);
}
}
void

View File

@ -2885,7 +2885,8 @@ _smart_pty_title(void *data)
sd = evas_object_smart_data_get(obj);
if (!sd) return;
if (!sd->win) return;
elm_win_title_set(sd->win, sd->pty->prop.title);
evas_object_smart_callback_call(obj, "title,change", NULL);
// elm_win_title_set(sd->win, sd->pty->prop.title);
}
static void
@ -2896,7 +2897,8 @@ _smart_pty_icon(void *data)
sd = evas_object_smart_data_get(obj);
if (!sd) return;
if (!sd->win) return;
elm_win_icon_name_set(sd->win, sd->pty->prop.icon);
evas_object_smart_callback_call(obj, "icon,change", NULL);
// elm_win_icon_name_set(sd->win, sd->pty->prop.icon);
}
static void
@ -3520,3 +3522,19 @@ termio_mirror_add(Evas_Object *obj)
_smart_mirror_del, obj);
return img;
}
const char *
termio_title_get(Evas_Object *obj)
{
Termio *sd = evas_object_smart_data_get(obj);
if (!sd) return NULL;
return sd->pty->prop.title;
}
const char *
termio_icon_name_get(Evas_Object *obj)
{
Termio *sd = evas_object_smart_data_get(obj);
if (!sd) return NULL;
return sd->pty->prop.icon;
}

View File

@ -23,5 +23,7 @@ pid_t termio_pid_get(const Evas_Object *obj);
Eina_Bool termio_cwd_get(const Evas_Object *obj, char *buf, size_t size);
Evas_Object *termio_textgrid_get(Evas_Object *obj);
Evas_Object *termio_mirror_add(Evas_Object *obj);
const char *termio_title_get(Evas_Object *obj);
const char *termio_icon_name_get(Evas_Object *obj);
#endif