forked from enlightenment/enlightenment
Everything selection event, and theme to back button
SVN revision: 50132
This commit is contained in:
parent
dddf703520
commit
6e18235fb2
|
@ -33951,6 +33951,127 @@ collections {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group {
|
||||||
|
name: "e/modules/everything/tab_item/back";
|
||||||
|
min: 50 10;
|
||||||
|
parts {
|
||||||
|
part {
|
||||||
|
name: "clip";
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1.relative: 0.05 0.0;
|
||||||
|
rel2.relative: 0.95 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "label2";
|
||||||
|
type: TEXT;
|
||||||
|
scale: 1;
|
||||||
|
clip_to: "clip";
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
align: 0.5 0.5;
|
||||||
|
fixed: 0 1;
|
||||||
|
rel1.to: "e.text.label";
|
||||||
|
rel2.to: "e.text.label";
|
||||||
|
color: 0 0 0 255;
|
||||||
|
text {
|
||||||
|
font: "Sans:style";
|
||||||
|
text_source: "e.text.label";
|
||||||
|
size: 10;
|
||||||
|
min: 0 1;
|
||||||
|
align: 0.5 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "selected" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
color: 10 10 10 0;
|
||||||
|
visible: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "bg";
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
color: 255 255 255 40;
|
||||||
|
image {
|
||||||
|
normal: "toolbar_sel.png";
|
||||||
|
border: 2 2 0 0;
|
||||||
|
}
|
||||||
|
fill.smooth: 1;
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "selected" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
color: 245 245 245 250;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "e.text.label";
|
||||||
|
type: TEXT;
|
||||||
|
mouse_events: 0;
|
||||||
|
clip_to: "clip";
|
||||||
|
scale: 1;
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
align: 0.5 0.5;
|
||||||
|
fixed: 0 1;
|
||||||
|
rel1.to: "clip";
|
||||||
|
rel2.to: "clip";
|
||||||
|
rel1.offset: 5 3;
|
||||||
|
rel2.offset: -6 -1;
|
||||||
|
visible: 0;
|
||||||
|
color: 245 245 245 255;
|
||||||
|
text {
|
||||||
|
font: "Sans:style=Bold";
|
||||||
|
size: 9;
|
||||||
|
min: 0 1;
|
||||||
|
align: 0.5 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "selected" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
visible: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "event";
|
||||||
|
type: RECT;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
programs {
|
||||||
|
program {
|
||||||
|
name: "go_active";
|
||||||
|
signal: "e,state,selected";
|
||||||
|
source: "e";
|
||||||
|
action: STATE_SET "selected" 0.0;
|
||||||
|
target: "bg";
|
||||||
|
target: "e.text.label";
|
||||||
|
target: "label2";
|
||||||
|
transition: LINEAR 0.1;
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "go_passive";
|
||||||
|
signal: "e,state,unselected";
|
||||||
|
source: "e";
|
||||||
|
action: STATE_SET "default" 0.0;
|
||||||
|
target: "bg";
|
||||||
|
target: "e.text.label";
|
||||||
|
target: "label2";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/*** EVERYTHING THUMB VIEW ***/
|
/*** EVERYTHING THUMB VIEW ***/
|
||||||
|
|
||||||
|
|
|
@ -272,6 +272,52 @@ _item_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_item_select(Item *it)
|
||||||
|
{
|
||||||
|
it->selected = EINA_TRUE;
|
||||||
|
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
||||||
|
|
||||||
|
if (it->thumb)
|
||||||
|
{
|
||||||
|
if (strcmp(evas_object_type_get(it->thumb), "e_icon"))
|
||||||
|
edje_object_signal_emit(it->thumb, "e,state,selected", "e");
|
||||||
|
else
|
||||||
|
e_icon_selected_set(it->thumb, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (it->image)
|
||||||
|
{
|
||||||
|
if (strcmp(evas_object_type_get(it->image), "e_icon"))
|
||||||
|
edje_object_signal_emit(it->image, "e,state,selected", "e");
|
||||||
|
else
|
||||||
|
e_icon_selected_set(it->image, EINA_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_item_unselect(Item *it)
|
||||||
|
{
|
||||||
|
it->selected = EINA_FALSE;
|
||||||
|
edje_object_signal_emit(it->frame, "e,state,unselected", "e");
|
||||||
|
|
||||||
|
if (it->thumb)
|
||||||
|
{
|
||||||
|
if (strcmp(evas_object_type_get(it->thumb), "e_icon"))
|
||||||
|
edje_object_signal_emit(it->thumb, "e,state,unselected", "e");
|
||||||
|
else
|
||||||
|
e_icon_selected_set(it->thumb, EINA_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (it->image)
|
||||||
|
{
|
||||||
|
if (strcmp(evas_object_type_get(it->image), "e_icon"))
|
||||||
|
edje_object_signal_emit(it->image, "e,state,unselected", "e");
|
||||||
|
else
|
||||||
|
e_icon_selected_set(it->image, EINA_FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_item_show(View *v, Item *it, Evas_Object *list)
|
_item_show(View *v, Item *it, Evas_Object *list)
|
||||||
{
|
{
|
||||||
|
@ -300,8 +346,8 @@ _item_show(View *v, Item *it, Evas_Object *list)
|
||||||
|
|
||||||
evas_object_clip_set(it->frame, evas_object_clip_get(list));
|
evas_object_clip_set(it->frame, evas_object_clip_get(list));
|
||||||
|
|
||||||
if (it->selected)
|
if (it->item->selected)
|
||||||
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
_item_select(it);
|
||||||
|
|
||||||
if (it->item->marked)
|
if (it->item->marked)
|
||||||
edje_object_signal_emit(it->frame, "e,state,marked", "e");
|
edje_object_signal_emit(it->frame, "e,state,marked", "e");
|
||||||
|
@ -782,19 +828,14 @@ _pan_item_select(Evas_Object *obj, Item *it, int scroll)
|
||||||
if (sd->cur_item)
|
if (sd->cur_item)
|
||||||
{
|
{
|
||||||
prev = sd->cur_item->y / (1 + sd->cur_item->h);
|
prev = sd->cur_item->y / (1 + sd->cur_item->h);
|
||||||
sd->cur_item->selected = EINA_FALSE;
|
_item_unselect(sd->cur_item);
|
||||||
edje_object_signal_emit(sd->cur_item->frame,
|
|
||||||
"e,state,unselected", "e");
|
|
||||||
sd->cur_item = NULL;
|
sd->cur_item = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!it) return;
|
if (!it) return;
|
||||||
|
|
||||||
|
_item_select(it);
|
||||||
sd->cur_item = it;
|
sd->cur_item = it;
|
||||||
it->selected = EINA_TRUE;
|
|
||||||
|
|
||||||
edje_object_signal_emit(sd->cur_item->frame,
|
|
||||||
"e,state,selected", "e");
|
|
||||||
|
|
||||||
if (evry_conf->scroll_animate)
|
if (evry_conf->scroll_animate)
|
||||||
{
|
{
|
||||||
|
@ -1414,7 +1455,7 @@ _view_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
if (ev->z)
|
if (ev->z)
|
||||||
{
|
{
|
||||||
if (sd->cur_item)
|
if (sd->cur_item)
|
||||||
edje_object_signal_emit(sd->cur_item->frame, "e,state,selected", "e");
|
_item_select(sd->cur_item);
|
||||||
sd->mouse_act = 1;
|
sd->mouse_act = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,12 +79,18 @@ _add_tab(Tab_View *v, Evry_Plugin *p)
|
||||||
tab->plugin = p;
|
tab->plugin = p;
|
||||||
tab->tab_view = v;
|
tab->tab_view = v;
|
||||||
o = edje_object_add(v->evas);
|
o = edje_object_add(v->evas);
|
||||||
e_theme_edje_object_set(o, "base/theme/modules/everything",
|
|
||||||
"e/modules/everything/tab_item");
|
|
||||||
if (p)
|
if (p)
|
||||||
edje_object_part_text_set(o, "e.text.label", EVRY_ITEM(p)->label);
|
{
|
||||||
|
e_theme_edje_object_set(o, "base/theme/modules/everything",
|
||||||
|
"e/modules/everything/tab_item");
|
||||||
|
edje_object_part_text_set(o, "e.text.label", EVRY_ITEM(p)->label);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
edje_object_part_text_set(o, "e.text.label", _("<<"));
|
{
|
||||||
|
e_theme_edje_object_set(o, "base/theme/modules/everything",
|
||||||
|
"e/modules/everything/tab_item/back");
|
||||||
|
edje_object_part_text_set(o, "e.text.label", _("Back"));
|
||||||
|
}
|
||||||
|
|
||||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_tab_cb_down, tab);
|
_tab_cb_down, tab);
|
||||||
|
|
Loading…
Reference in New Issue