attempt to make composite effects suck less.

Introducing the styles:

 * fast: does not have focus-in/out effect, similar to "slow", but runs in
   0.1 second, so quite fast.

 * focus-out-colored: the focus-out has a color applied to it, the
   color is gray by now, but can be changed with conf_colors (last
   item), one can go crazy and make the focused out yellow or make
   them semi-transparent;

The "comp" configure dialog now the focus in/out effects as well, to
make user know what is happening a boring label is overlaid in the
preview.



SVN revision: 48491
This commit is contained in:
Gustavo Sverzut Barbieri 2010-04-30 20:23:28 +00:00
parent 48336a9976
commit 5d8b697156
3 changed files with 421 additions and 21 deletions

View File

@ -257,6 +257,10 @@ color_classes {
name: "label_text_disabled";
color: 0 0 0 128;
}
color_class {
name: "comp_focus-out_color";
color: 180 180 180 255;
}
}
/*
@ -35132,6 +35136,34 @@ collections {
/////////////////////////////////////////////////////////////////////////////
/*** MOD: COMP ***/
group { name: "e/modules/comp/preview";
parts {
part { name: "e.swallow.preview";
type: SWALLOW;
mouse_events: 0;
description { state: "default" 0.0; }
}
part { name: "e.text.label";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
fixed: 0 1;
color: 224 224 224 255;
color3: 0 0 0 32;
text {
font: "Sans:style=Bold";
size: 10;
min: 1 1;
align: 0.5 0.5;
text_class: "fileman_icon";
}
}
}
}
}
group { name: "e/comp/default";
images {
image: "comp-sh1.png" COMP;
@ -35480,5 +35512,330 @@ collections {
}
}
}
//----
group { name: "e/comp/fast";
images {
image: "comp-sh1.png" COMP;
}
parts {
part { name: "clipper";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
rel1 {
relative: -1.0 -1.0;
offset: -9999 -9999;
}
rel2 {
relative: 2.0 2.0;
offset: 9999 9999;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}
part { name: "shadow";
mouse_events: 0;
clip_to: "clipper";
description { state: "default" 0.0;
image {
normal: "comp-sh1.png";
border: 18 18 18 18;
middle: 0;
}
fill {
smooth: 0;
}
rel1 {
to: "e.swallow.content";
relative: 0.0 0.0;
offset: -16 -14;
}
rel2 {
to: "e.swallow.content";
relative: 1.0 1.0;
offset: 15 17;
}
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "e.swallow.content";
type: SWALLOW;
clip_to: "clipper";
mouse_events: 0;
description { state: "default" 0.0;
rel1 {
relative: 0.05 0.05;
offset: 0 0;
}
rel2 {
relative: 0.95 0.95;
offset: -1 -1;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1 {
relative: 0.0 0.0;
}
rel2 {
relative: 1.0 1.0;
}
}
}
}
programs {
program { name: "shadow-on";
signal: "e,state,shadow,on";
source: "e";
action: STATE_SET "default" 0.0;
target: "shadow";
}
program { name: "shadow-off";
signal: "e,state,shadow,off";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "shadow";
}
program { name: "show1";
signal: "e,state,visible,on";
source: "e";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.1;
target: "clipper";
target: "e.swallow.content";
after: "show2";
}
program { name: "show2";
action: SIGNAL_EMIT "e,action,show,done" "e";
}
program { name: "hide1";
signal: "e,state,visible,off";
source: "e";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.1;
target: "clipper";
target: "e.swallow.content";
after: "hide2";
}
program { name: "hide2";
action: SIGNAL_EMIT "e,action,hide,done" "e";
}
}
}
//----
group { name: "e/comp/focus-out-colored";
images {
image: "comp-sh1.png" COMP;
image: "bt_glow.png" COMP;
}
parts {
part { name: "clipper";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
rel1 {
relative: -1.0 -1.0;
offset: -9999 -9999;
}
rel2 {
relative: 2.0 2.0;
offset: 9999 9999;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}
part { name: "shadow";
mouse_events: 0;
clip_to: "clipper";
description { state: "default" 0.0;
image {
normal: "comp-sh1.png";
border: 18 18 18 18;
middle: 0;
}
fill.smooth: 0;
rel1 {
to: "e.swallow.content";
relative: 0.0 0.0;
offset: -16 -14;
}
rel2 {
to: "e.swallow.content";
relative: 1.0 1.0;
offset: 15 17;
}
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "shower";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
rel1 {
relative: 0.05 0.05;
offset: 0 0;
}
rel2 {
relative: 0.95 0.95;
offset: -1 -1;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1 {
relative: 0.0 0.0;
}
rel2 {
relative: 1.0 1.0;
}
}
}
part { name: "clipper-content";
type: RECT;
clip_to: "clipper";
mouse_events: 0;
description { state: "default" 0.0;
color: 255 255 255 255;
}
description { state: "unfocus" 0.0;
inherit: "default" 0.0;
color: 180 180 180 255;
color_class: "comp_focus-out_color";
}
}
part { name: "e.swallow.content";
type: SWALLOW;
clip_to: "clipper-content";
mouse_events: 0;
description { state: "default" 0.0;
rel1 {
to: "shower";
}
rel2 {
to: "shower";
}
}
}
part { name: "glow";
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
rel1.to: "e.swallow.content";
rel1.offset: -3 -3;
rel2.to: "e.swallow.content";
rel2.offset: 2 2;
color: 255 255 255 0;
image {
normal: "bt_glow.png";
border: 8 8 8 8;
middle: 0;
}
fill.smooth: 0;
}
description { state: "active" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
description { state: "faded" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 0;
rel1.offset: -23 -22;
rel2.offset: 22 22;
}
}
}
programs {
program { name: "shadow-on";
signal: "e,state,shadow,on";
source: "e";
action: STATE_SET "default" 0.0;
target: "shadow";
}
program { name: "shadow-off";
signal: "e,state,shadow,off";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "shadow";
}
program { name: "show1";
signal: "e,state,visible,on";
source: "e";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.15;
target: "clipper";
target: "shower";
after: "show2";
}
program { name: "show2";
action: SIGNAL_EMIT "e,action,show,done" "e";
}
program { name: "hide1";
signal: "e,state,visible,off";
source: "e";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.30;
target: "clipper";
target: "shower";
after: "hide2";
}
program { name: "hide2";
action: SIGNAL_EMIT "e,action,hide,done" "e";
}
program { name: "unfocus";
signal: "e,state,focus,off";
source: "e";
action: STATE_SET "unfocus" 0.0;
transition: ACCELERATE 0.2;
target: "clipper-content";
}
program { name: "focus";
signal: "e,state,focus,on";
source: "e";
action: STATE_SET "default" 0.0;
transition: ACCELERATE 0.2;
target: "clipper-content";
}
program { name: "urgent-on";
signal: "e,state,urgent,on";
source: "e";
action: STATE_SET "active" 0.0;
target: "glow";
after: "urgent2";
}
program { name: "urgent2";
action: STATE_SET "faded" 0.0;
transition: DECELERATE 0.5;
target: "glow";
after: "urgent-on";
}
program { name: "urgent-off";
signal: "e,state,urgent,off";
source: "e";
action: STATE_SET "default" 0.0;
target: "glow";
}
}
}
}

View File

@ -4,6 +4,12 @@
#include "e_mod_comp.h"
#include "config.h"
typedef struct _E_Demo_Style_Item
{
Evas_Object *preview;
Evas_Object *frame;
} E_Demo_Style_Item;
struct _E_Config_Dialog_Data
{
int use_shadow;
@ -100,10 +106,19 @@ _create_data(E_Config_Dialog *cfd)
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
E_Demo_Style_Item *ds_it;
_comp_mod->config_dialog = NULL;
if (cfdata->shadow_style) eina_stringshare_del(cfdata->shadow_style);
if (cfdata->style_demo_timer) ecore_timer_del(cfdata->style_demo_timer);
if (cfdata->style_shadows) eina_list_free(cfdata->style_shadows);
EINA_LIST_FREE(cfdata->style_shadows, ds_it)
{
evas_object_del(ds_it->preview);
evas_object_del(ds_it->frame);
free(ds_it);
}
free(cfdata);
}
@ -111,18 +126,36 @@ static int
_demo_styles(void *data)
{
E_Config_Dialog_Data *cfdata = data;
Eina_List *l;
Evas_Object *ob;
const E_Demo_Style_Item *it;
const Eina_List *l;
if (cfdata->style_demo_state) cfdata->style_demo_state = 0;
else cfdata->style_demo_state = 1;
EINA_LIST_FOREACH(cfdata->style_shadows, l, ob)
cfdata->style_demo_state = (cfdata->style_demo_state + 1) % 4;
EINA_LIST_FOREACH(cfdata->style_shadows, l, it)
{
if (cfdata->style_demo_state)
edje_object_signal_emit(ob, "e,state,visible,on", "e");
else
edje_object_signal_emit(ob, "e,state,visible,off", "e");
Evas_Object *ob = it->preview;
Evas_Object *of = it->frame;
switch (cfdata->style_demo_state)
{
case 0:
edje_object_signal_emit(ob, "e,state,visible,on", "e");
edje_object_signal_emit(ob, "e,state,focus,on", "e");
edje_object_part_text_set(of, "e.text.label", _("Visible"));
break;
case 1:
edje_object_signal_emit(ob, "e,state,focus,off", "e");
edje_object_part_text_set(of, "e.text.label", _("Focus-Out"));
break;
case 2:
edje_object_signal_emit(ob, "e,state,focus,on", "e");
edje_object_part_text_set(of, "e.text.label", _("Focus-In"));
break;
case 3:
edje_object_signal_emit(ob, "e,state,visible,off", "e");
edje_object_part_text_set(of, "e.text.label", _("Hidden"));
break;
default:
break;
}
}
return 1;
}
@ -131,15 +164,15 @@ static void
_shadow_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Config_Dialog_Data *cfdata = data;
Eina_List *l;
Evas_Object *ob;
const E_Demo_Style_Item *it;
const Eina_List *l;
EINA_LIST_FOREACH(cfdata->style_shadows, l, ob)
EINA_LIST_FOREACH(cfdata->style_shadows, l, it)
{
if (cfdata->use_shadow)
edje_object_signal_emit(ob, "e,state,shadow,on", "e");
else
edje_object_signal_emit(ob, "e,state,shadow,off", "e");
if (cfdata->use_shadow)
edje_object_signal_emit(it->preview, "e,state,shadow,on", "e");
else
edje_object_signal_emit(it->preview, "e,state,shadow,off", "e");
}
}
@ -173,8 +206,9 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
n = 0;
EINA_LIST_FOREACH(styles, l, style)
{
E_Demo_Style_Item *ds_it;
char buf[PATH_MAX];
ob = e_livethumb_add(evas);
e_livethumb_vsize_set(ob, 240, 240);
@ -192,8 +226,16 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
if (cfdata->use_shadow)
edje_object_signal_emit(oo, "e,state,shadow,on", "e");
edje_object_signal_emit(oo, "e,state,visible,on", "e");
cfdata->style_shadows = eina_list_append(cfdata->style_shadows, oo);
evas_object_show(oo);
ds_it = malloc(sizeof(E_Demo_Style_Item));
ds_it->preview = oo;
ds_it->frame = edje_object_add(evas);
e_theme_edje_object_set
(ds_it->frame, "base/theme/modules/comp", "e/modules/comp/preview");
edje_object_part_swallow(ds_it->frame, "e.swallow.preview", ob);
evas_object_show(ds_it->frame);
cfdata->style_shadows = eina_list_append(cfdata->style_shadows, ds_it);
obd = edje_object_add(e_livethumb_evas_get(ob));
e_theme_edje_object_set(obd, "base/theme/borders",
@ -208,7 +250,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
edje_object_part_swallow(obd, "e.swallow.client", orec);
evas_object_show(orec);
e_widget_ilist_append(oi, ob, style, NULL, NULL, style);
e_widget_ilist_append(oi, ds_it->frame, style, NULL, NULL, style);
evas_object_show(ob);
if (cfdata->shadow_style)
{

View File

@ -125,6 +125,7 @@ static const CFColor_Class_Description _color_classes_widgets[] =
static const CFColor_Class_Description _color_classes_modules[] =
{
CCDESC_T("module_label", N_("Module Label")),
CCDESC_S("comp_focus-out_color", N_("Composite Focus-out Color")),
{NULL, 0, NULL, COLOR_CLASS_UNKNOWN}
};
#undef CCDESC_S