Eina_Stringshare *frame_theme;
Eina_Stringshare *frame_name;
+ Eina_Stringshare *effect; //effect when toggling visibility
Evas_Object *smart_obj; // smart object
Evas_Object *clip; // clipper over effect object
if (!ok)
ok = e_theme_edje_object_set(cw->shobj, "base/theme/comp", buf);
}
+ if (ok && m->effect)
+ eina_stringshare_refplace(&cw->effect, m->effect);
if (ok) break;
}
}
if (cw->animating)
{
cw->animating--;
- e_comp->animating--;
+ if (!cw->animating)
+ e_comp->animating--;
/* remove ref from animation start, account for possibility of deletion from unref */
if (!e_object_unref(E_OBJECT(cw->ec))) return;
}
+ if (cw->animating) return;
/* hide only after animation finishes to guarantee a full run of the animation */
- if (cw->defer_hide && (!strcmp(emission, "e,action,hide,done")))
+ if (cw->defer_hide && ((!strcmp(emission, "e,action,hide,done")) || (!strcmp(emission, "e,action,done"))))
evas_object_hide(cw->smart_obj);
- else if (!cw->animating)
+ else
e_comp_shape_queue();
}
e_comp->animating++;
cw->animating++;
e_object_ref(E_OBJECT(cw->ec));
+ if (cw->effect)
+ {
+ cw->animating++;
+ e_object_ref(E_OBJECT(cw->ec));
+ e_comp_object_effect_set(obj, cw->effect);
+ e_comp_object_effect_params_set(obj, 0, (int[]){0}, 1);
+ e_comp_object_effect_start(obj, _e_comp_object_done_defer, cw);
+ }
}
cw->defer_hide = !!cw->animating;
if (!cw->animating)
e_comp->animating++;
cw->animating++;
e_object_ref(E_OBJECT(cw->ec));
+ if (cw->effect)
+ {
+ cw->animating++;
+ e_object_ref(E_OBJECT(cw->ec));
+ e_comp_object_effect_set(obj, cw->effect);
+ e_comp_object_effect_params_set(obj, 0, (int[]){1}, 1);
+ e_comp_object_effect_start(obj, _e_comp_object_done_defer, cw);
+ }
}
/* ensure some random effect doesn't lock the client offscreen */
if (!cw->animating)
char *title, *name, *clas, *role;
int borderless, dialog, accepts_focus;
int argb, fullscreen, modal, primary_type;
+ int effect_type;
} Match_Config;
struct _E_Config_Dialog_Data
Eina_List *overrides; // used for client menus, tooltips etc.
Eina_List *menus; // used for e menus
Eina_List *objects; // used for e objects
+ Eina_List *comp_effects; // list of visibility effects
int changed;
Evas_Object *edit_il;
m2->primary_type = m2->match.primary_type;
m2->match.shadow_style = eina_stringshare_ref(m2->match.shadow_style);
+ m2->match.effect = eina_stringshare_ref(m2->match.effect);
}
static void
eina_stringshare_del(m->match.clas);
eina_stringshare_del(m->match.role);
eina_stringshare_del(m->match.shadow_style);
+ eina_stringshare_del(m->match.effect);
free(m->title);
free(m->name);
free(m->clas);
m->clas = eina_stringshare_add(m->clas);
m->role = eina_stringshare_add(m->role);
m->shadow_style = eina_stringshare_add(m->shadow_style);
+ m->effect = eina_stringshare_add(m->effect);
}
static const char *
eina_strbuf_append(buf, _("Style:"));
eina_strbuf_append(buf, m->match.shadow_style);
}
+ if (m->match.effect)
+ {
+ eina_strbuf_append(buf, _(" / "));
+ eina_strbuf_append(buf, _("Effect:"));
+ eina_strbuf_append(buf, m->match.effect);
+ }
if (!eina_strbuf_length_get(buf))
return _("Unknown");
Evas_Object *dia, *bg, *of = d2;
Evas_Object *il;
- if (m->title || m->name || m->clas || m->role || (m->primary_type != m->match.primary_type))
+ if (m->title || m->name || m->clas || m->role || (m->primary_type != m->match.primary_type) ||
+ (eina_list_nth(m->cfd->cfdata->comp_effects, m->effect_type) != m->match.effect))
{
m->cfd->cfdata->changed = 1;
e_config_dialog_changed_set(m->cfd, 1);
m->match.fullscreen = m->fullscreen;
m->match.modal = m->modal;
m->match.primary_type = m->primary_type;
+ eina_stringshare_refplace(&m->match.effect, eina_list_nth(m->cfd->cfdata->comp_effects, m->effect_type));
+ if (eina_streq(m->match.effect, "none"))
+ eina_stringshare_replace(&m->match.effect, NULL);
il = m->cfd->cfdata->edit_il;
{
const Eina_List *l;
{
Evas_Object *of, *oi, *lb, *en, *bt, *tb, *tab2, *o, *sf, *li;
E_Radio_Group *rg;
- int row;
+ Eina_List *l;
+ Eina_Stringshare *s;
+ int row, mode = 0;
int x, y, w, h, mw, mh;
o = edje_object_add(evas);
e_widget_toolbook_page_append(tb, NULL, _("Style"), oi,
1, 1, 1, 1, 0.5, 0.0);
+ oi = e_widget_list_add(evas, 1, 0);
+ EINA_LIST_FOREACH(cfdata->comp_effects->next, l, s)
+ {
+ m->effect_type++;
+ if (s == m->match.effect)
+ break;
+ }
+ if (!s) m->effect_type = 0;
+ rg = e_widget_radio_group_new(&(m->effect_type));
+ EINA_LIST_FOREACH(cfdata->comp_effects, l, s)
+ {
+ char *p;
+ const char *pp;
+ char buf[PATH_MAX];
+
+ pp = strchr(s, '/');
+ pp = pp ? pp + 1 : s;
+ p = memcpy(buf, pp, strlen(pp) + 1);
+ p[0] = toupper(p[0]);
+ o = e_widget_radio_add(evas, _(p), mode, rg);
+ e_widget_list_object_append(oi, o, 1, 0, 0.5);
+ mode++;
+ }
+ e_widget_toolbook_page_append(tb, NULL, _("Effect"), oi,
+ 1, 1, 1, 1, 0.5, 0.0);
+
e_widget_frametable_object_append(of, tb, 0, 0, 1, 1, 1, 1, 1, 1);
e_widget_toolbook_page_show(tb, 0);
{
E_Config_Dialog_Data *cfdata;
Eina_List *l;
+ Eina_Stringshare *grp;
E_Comp_Match *m;
Match_Config *m2;
E_Comp_Config *conf = e_comp_config_get();
m2->cfd = cfd;
cfdata->objects = eina_list_append(cfdata->objects, m2);
}
+ cfdata->comp_effects = e_theme_collection_items_find("base/theme/borders", "e/comp/effects/visibility");
+ /* comp effects must be prefixed with "visibility" or they won't work and things will break! */
+ EINA_LIST_FOREACH(cfdata->comp_effects, l, grp)
+ {
+ Eina_Stringshare *g;
+ char buf[1024];
+ snprintf(buf, sizeof(buf), "visibility/%s", grp);
+ g = eina_stringshare_add(buf);
+ eina_stringshare_del(grp);
+ eina_list_data_set(l, g);
+ }
+ cfdata->comp_effects = eina_list_prepend(cfdata->comp_effects, eina_stringshare_add("none"));
return cfdata;
}