From 7f6ae2a441d7c635bdac42ee18abbd89e066891d Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sun, 27 Jan 2013 05:24:07 +0000 Subject: [PATCH] little theme adjustments for terminology - cursor loses striped fill - clear empty, but gets blue glow. use subtle blue glow to show focuwed term - useful for multi-term grid. SVN revision: 83362 --- data/themes/default.edc | 70 +++++++++++++++++++---- data/themes/images/Makefile.am | 3 +- data/themes/images/bg_glow_in.png | Bin 0 -> 580 bytes data/themes/images/cr_fill.png | Bin 222 -> 0 bytes data/themes/images/cr_glow.png | Bin 0 -> 449 bytes data/themes/images/cr_out.png | Bin 316 -> 189 bytes src/bin/config.c | 37 +++++++++++- src/bin/config.h | 1 + src/bin/main.c | 92 +++++++++++++++++++++++++----- src/bin/main.h | 1 + 10 files changed, 175 insertions(+), 29 deletions(-) create mode 100644 data/themes/images/bg_glow_in.png delete mode 100644 data/themes/images/cr_fill.png create mode 100644 data/themes/images/cr_glow.png diff --git a/data/themes/default.edc b/data/themes/default.edc index 8632e6e4..18a86176 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -7,6 +7,7 @@ collections { image: "bg_bevel.png" COMP; image: "bg_shine.png" COMP; image: "bg_glint.png" COMP; + image: "bg_glow_in.png" COMP; image: "bg_shadow.png" COMP; image: "bg_led_glow.png" COMP; image: "bg_led_base.png" COMP; @@ -124,6 +125,24 @@ collections { //////////////////////////////////////////////////////////////////// // overlayed prettiness + part { name: "glow"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "bg_glow_in.png"; + image.border: 7 7 7 7; + image.middle: 0; + fill.smooth: 0; + color: 51 153 255 0; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color: 51 153 255 255; + } + description { state: "focused2" 0.0; + inherit: "default" 0.0; + color: 51 153 255 64; + } + } part { name: "bevel"; mouse_events: 0; description { state: "default" 0.0; @@ -133,7 +152,6 @@ collections { image.border: 3 3 5 3; image.middle: 0; fill.smooth: 0; - visible: 1; } } part { name: "glintclip"; type: RECT; @@ -174,7 +192,7 @@ collections { align: 0.5 0.0; aspect: (255/120) (255/120); aspect_preference: HORIZONTAL; - color: 255 255 255 128; + color: 255 255 255 64; } description { state: "focused" 0.0; inherit: "default" 0.0; @@ -186,15 +204,23 @@ collections { source: "terminology"; action: STATE_SET "focused" 0.0; target: "glint"; + target: "glow"; target: "shine"; + after: "focus_in2"; } program { name: "focus_out"; signal: "focus,out"; source: "terminology"; action: STATE_SET "default" 0.0; target: "glint"; + target: "glow"; target: "shine"; } + program { name: "focus_in2"; + action: STATE_SET "focused2" 0.0; + transition: DECELERATE 0.5; + target: "glow"; + } //////////////////////////////////////////////////////////////////// // visual bell - spinning red siren light @@ -2059,12 +2085,14 @@ target: "4.bottom" //// the cursor to show where text is typed group { name: "terminology/cursor"; images { - image: "cr_fill.png" COMP; +// 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; @@ -2082,6 +2110,7 @@ target: "4.bottom" color: 255 255 255 255; } } + */ part { name: "key"; mouse_events: 0; description { state: "default" 0.0; @@ -2097,11 +2126,11 @@ target: "4.bottom" normal: "cr_key.png"; border: 4 4 4 4; } - color: 255 255 255 0; + color: 51 153 255 0; } description { state: "on" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + color: 51 153 255 255; } description { state: "out" 0.0; inherit: "default" 0.0; @@ -2125,11 +2154,11 @@ target: "4.bottom" normal: "cr_pulse.png"; border: 4 4 4 4; } - color: 255 255 255 0; + color: 51 153 255 0; } description { state: "on" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + color: 51 153 255 255; } description { state: "out" 0.0; inherit: "default" 0.0; @@ -2138,6 +2167,22 @@ target: "4.bottom" rel2.offset: 7 7; } } + part { name: "glow"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.offset: -4 -4; + rel2.offset: 3 3; + image { + normal: "cr_glow.png"; + border: 9 9 9 9; + } + color: 51 153 255 40; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color: 51 153 255 255; + } + } part { name: "outline"; mouse_events: 0; description { state: "default" 0.0; @@ -2157,14 +2202,14 @@ target: "4.bottom" signal: "focus,in,noblink"; source: "terminology"; action: STATE_SET "focused" 0.0; - target: "fill"; + target: "glow"; target: "outline"; } program { name: "focus_in"; signal: "focus,in"; source: "terminology"; action: STATE_SET "focused" 0.0; - target: "fill"; + target: "glow"; target: "outline"; after: "focus2"; after: "pulse"; @@ -2172,14 +2217,15 @@ target: "4.bottom" program { name: "focus2"; in: 0.5 0.0; action: STATE_SET "default" 0.0; - target: "fill"; + transition: DECELERATE 0.2; + target: "glow"; target: "outline"; after: "focus3"; } program { name: "focus3"; in: 0.5 0.0; action: STATE_SET "focused" 0.0; - target: "fill"; + target: "glow"; target: "outline"; after: "focus2"; after: "pulse"; @@ -2207,7 +2253,7 @@ target: "4.bottom" } program { name: "focus_out2"; action: STATE_SET "default" 0.0; - target: "fill"; + target: "glow"; target: "outline"; } program { name: "key"; diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am index bf41bf1b..f4b9910f 100644 --- a/data/themes/images/Makefile.am +++ b/data/themes/images/Makefile.am @@ -5,12 +5,13 @@ ab_shell.png \ bg_bevel.png \ bg_shine.png \ bg_glint.png \ +bg_glow_in.png \ bg_led.png \ bg_led_base.png \ bg_led_glow.png \ bg_led_strobe.png \ bg_shadow.png \ -cr_fill.png \ +cr_glow.png \ cr_key.png \ cr_out.png \ cr_pulse.png \ diff --git a/data/themes/images/bg_glow_in.png b/data/themes/images/bg_glow_in.png new file mode 100644 index 0000000000000000000000000000000000000000..d4a83d1ed2dff0ccc75ff293b53c8bba8a311992 GIT binary patch literal 580 zcmV-K0=xZ*P);4DelL5b!^_9SA`rGHzu$&J1WW`f-Rr9l zPE3Fk;7*x8sQDs+CaC~hY(wk?a|xKRCcxAL8XImde|F`sll|Xj3t|NtM`$jr889huUup1mgOG>d?d_~0f!ow zZY30>bZ%oX833PwFTy-DF*$SN(teAh*+{@&g*i4&spoE7I{uHt>9Bb3@%#^_#@sxC ST8ygz0000Kn(zQ>;>8dj-UIQdk06PVaKI3QWEWY+OAQ$j6b()?$?j}V zrMjxS*NB$)zN|;bc54n`W<@x#2rL28XuB=Ivaro8Ujhp32sj7MfCiBK0GI8R0(o6+*19X5Eun!d4@hWT2fC112?t#pEKM!f8V%7m}fvSLVrM6I9Nm3*NZR>m> zmJ_FdRB5&ZwgZX$0L}7F(CRj4R!b(U?Br$V*07Zy!YrVSIlCS zVTm0tx2DEQk+c4k(1 r?=#>jYV^O1uguJf{~55m`~`dfI5CvdTQ-F@00000NkvXXu0mjf!e_S- literal 0 HcmV?d00001 diff --git a/data/themes/images/cr_out.png b/data/themes/images/cr_out.png index 6c0f3360ff2886197e1eba48adebb672c72c26c7..e2644e0b286f14876189314cd030f8f69a783914 100644 GIT binary patch delta 98 zcmdnPw3l&$3O`$tx4R3&e-K=-clqRr4su*~8Kqe)S+2d=%P=uR!%EfD#W6(VeDa_F z|Nqys2{CX_NmB{>Td&3@bZ|x6!G(-smtEBP8G=8tiN8KQLze*vJYD@<);T3K0RU4y BB?$lk delta 252 zcmdnXxQA(iiVI_Lkh>GZx^prw85kJYlDyqrfHV;NblzPLq&N#aB8wRqxP?KOkzv*x z37{Z*iKnkC`yDo6HgQe$3hCU5(HiyBJzX3_G|o?*be8Lofk4atEl!>b+h1LD|591w zV*4#9 zb?Nfo)qLjKao{4`AGPfFEsj?G_Hun2zGvGoTF=xd6|-cw1-hHT)78&qol`;+0E*mU Ab^rhX diff --git a/src/bin/config.c b/src/bin/config.c index 9de84e11..0fabead2 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -103,7 +103,11 @@ config_save(Config *config, const char *key) EINA_SAFETY_ON_NULL_RETURN(config); - if (config->temporary) return; + if (config->temporary) + { + main_config_sync(config); + return; + } if (!key) key = config->config_key; config->font.orig_size = config->font.size; eina_stringshare_del(config->font.orig_name); @@ -123,6 +127,37 @@ config_save(Config *config, const char *key) eet_close(ef); if (ok) ecore_file_mv(buf, buf2); } + main_config_sync(config); +} + +void +config_sync(const Config *config_src, Config *config) +{ + // SOME fields have to be consistent between configs + config->font.size = config_src->font.size; + eina_stringshare_replace(&(config->font.name), config_src->font.name); + config->font.bitmap = config_src->font.bitmap; + config->helper.inline_please = config_src->helper.inline_please; + eina_stringshare_replace(&(config->helper.email), config_src->helper.email); + eina_stringshare_replace(&(config->helper.url.general), config_src->helper.url.general); + eina_stringshare_replace(&(config->helper.url.video), config_src->helper.url.video); + eina_stringshare_replace(&(config->helper.url.image), config_src->helper.url.image); + eina_stringshare_replace(&(config->helper.local.general), config_src->helper.local.general); + eina_stringshare_replace(&(config->helper.local.video), config_src->helper.local.video); + eina_stringshare_replace(&(config->helper.local.image), config_src->helper.local.image); + eina_stringshare_replace(&(config->theme), config_src->theme); + eina_stringshare_replace(&(config->wordsep), config_src->wordsep); + config->scrollback = config_src->scrollback; + config->vidmod = config_src->vidmod; + config->jump_on_keypress = config_src->jump_on_keypress; + config->jump_on_change = config_src->jump_on_change; + config->flicker_on_key = config_src->flicker_on_key; + config->disable_cursor_blink = config_src->disable_cursor_blink; + config->disable_visual_bell = config_src->disable_visual_bell; + config->mute = config_src->mute; + config->urg_bell = config_src->urg_bell; + config->multi_instance = config_src->multi_instance; + config->temporary = config_src->temporary; } Config * diff --git a/src/bin/config.h b/src/bin/config.h index 7993946b..14cef1bc 100644 --- a/src/bin/config.h +++ b/src/bin/config.h @@ -46,6 +46,7 @@ struct _Config void config_init(void); void config_shutdown(void); +void config_sync(const Config *config_src, Config *config); void config_save(Config *config, const char *key); Config *config_load(const char *key); void config_del(Config *config); diff --git a/src/bin/main.c b/src/bin/main.c index 15994a06..7b33a9bc 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -984,32 +984,56 @@ _cb_cmd_hints_changed(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_ edje_object_part_swallow(wn->base, "terminology.cmdbox", wn->cmdbox); } +static void +_win_trans(Win *wn, Term *term, Eina_Bool trans) +{ + if (term->config->translucent) + edje_object_signal_emit(term->bg, "translucent,on", "terminology"); + else + edje_object_signal_emit(term->bg, "translucent,off", "terminology"); + if (trans) + { + elm_win_alpha_set(wn->win, EINA_TRUE); + evas_object_hide(wn->backbg); + } + else + { + elm_win_alpha_set(wn->win, EINA_FALSE); + evas_object_show(wn->backbg); + } +} + void main_trans_update(const Config *config) { Win *wn; - Term *term; + Term *term, *term2; Eina_List *l, *ll; EINA_LIST_FOREACH(wins, l, wn) { - if (config->translucent) + EINA_LIST_FOREACH(wn->terms, ll, term) { - EINA_LIST_FOREACH(wn->terms, ll, term) + if (term->config == config) { - edje_object_signal_emit(term->bg, "translucent,on", "terminology"); + if (config->translucent) + _win_trans(wn, term, EINA_TRUE); + else + { + Eina_Bool trans_exists = EINA_FALSE; + + EINA_LIST_FOREACH(wn->terms, ll, term2) + { + if (term2->config->translucent) + { + trans_exists = EINA_TRUE; + break; + } + } + _win_trans(wn, term, trans_exists); + } + return; } - elm_win_alpha_set(wn->win, EINA_TRUE); - evas_object_hide(wn->backbg); - } - else - { - EINA_LIST_FOREACH(wn->terms, ll, term) - { - edje_object_signal_emit(term->bg, "translucent,off", "terminology"); - } - elm_win_alpha_set(wn->win, EINA_FALSE); - evas_object_show(wn->backbg); } } } @@ -1098,6 +1122,44 @@ main_media_mute_update(const Config *config) } } +void +main_config_sync(const Config *config) +{ + Win *wn; + Term *term; + Eina_List *l, *ll; + + EINA_LIST_FOREACH(wins, l, wn) + { + if (wn->config != config) + { + config_sync(config, wn->config); + } + EINA_LIST_FOREACH(wn->terms, ll, term) + { + if (term->config != config) + { + Evas_Coord mw = 1, mh = 1, w, h, tsize_w = 0, tsize_h = 0; + + config_sync(config, term->config); + + evas_object_geometry_get(term->term, NULL, NULL, + &tsize_w, &tsize_h); + evas_object_data_del(term->term, "sizedone"); + termio_config_update(term->term); + evas_object_size_hint_min_get(term->term, &mw, &mh); + if (mw < 1) mw = 1; + if (mh < 1) mh = 1; + w = tsize_w / mw; + h = tsize_h / mh; + evas_object_data_del(term->term, "sizedone"); + evas_object_size_hint_request_set(term->term, + w * mw, h * mh); + } + } + } +} + static void main_win_free(Win *wn) { diff --git a/src/bin/main.h b/src/bin/main.h index 370f1c37..a5a8d75a 100644 --- a/src/bin/main.h +++ b/src/bin/main.h @@ -10,5 +10,6 @@ void main_close(Evas_Object *win, Evas_Object *term); void main_trans_update(const Config *config); void main_media_update(const Config *config); void main_media_mute_update(const Config *config); +void main_config_sync(const Config *config); #endif