Add a mouseover effect for the filelist

This commit is contained in:
Jaime Thomas 2008-08-06 03:25:11 +00:00
parent 9833e39485
commit 1b88e0ae57
4 changed files with 79 additions and 8 deletions

View File

@ -26,23 +26,73 @@ group {
} }
part { part {
name: "filelist"; name: "filelist_container";
type: SWALLOW; type: IMAGE;
description { description {
state: "default" 0.0; state: "default" 0.0;
min: 245 245; min: 245 245;
max: 99999 350; max: 99999 350;
align: 0.0 0.0; align: 0.0 0.0;
color: 255 255 255 0;
rel1 { rel1 {
to: "background";
offset: 5 5; offset: 5 5;
} }
rel2 { rel2 {
offset: -5 -5; offset: -5 -5;
} }
image {
normal: "focus.png";
border: 7 7 7 7;
}
} }
}
description {
state: "focused" 0.0;
inherit: "default" 0.0;
color: 255 255 255 155;
}
}
part {
name: "filelist";
type: SWALLOW;
description {
state: "default" 0.0;
rel1 {
to: "filelist_container";
offset: 3 3;
}
rel2 {
to: "filelist_container";
offset: -4 -4;
}
}
}
programs {
program {
name: "filelist,focus,in";
signal: "ecdb,filelist,in";
source: "ecdb";
action: STATE_SET "focused" 0.0;
target: "filelist_container";
transition: LINEAR 0.5;
}
program {
name: "filelist,focus,out";
signal: "ecdb,filelist,out";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "filelist_container";
transition: LINEAR 0.5;
}
}
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

View File

@ -1,3 +1,4 @@
images { images {
image: "background.png" COMP; image: "background.png" COMP;
image: "focus.png" COMP;
} }

View File

@ -1,6 +1,6 @@
#include "ecdb.h" #include "ecdb.h"
void static void
ecdb_cb_enter(Ecore_Evas *ee) ecdb_cb_enter(Ecore_Evas *ee)
{ {
Evas_Object *gui; Evas_Object *gui;
@ -8,15 +8,15 @@ ecdb_cb_enter(Ecore_Evas *ee)
edje_object_signal_emit(gui, "ecdb,window,enter", "ecdb"); edje_object_signal_emit(gui, "ecdb,window,enter", "ecdb");
} }
void static void
ecdb_cb_leave(Ecore_Evas *ee) ecdb_cb_leave(Ecore_Evas *ee)
{ {
Evas_Object *gui; Evas_Object *gui;
gui = evas_object_name_find(ecore_evas_get(ee), "gui"); gui = evas_object_name_find(ecore_evas_get(ee), "gui");
edje_object_signal_emit(gui, "ecdb_window_exit", "ecdb"); edje_object_signal_emit(gui, "ecdb,window,exit", "ecdb");
} }
void static void
ecdb_cb_resize(Ecore_Evas *ee) ecdb_cb_resize(Ecore_Evas *ee)
{ {
int w, h; int w, h;
@ -27,6 +27,22 @@ ecdb_cb_resize(Ecore_Evas *ee)
evas_object_resize(gui, w, h); evas_object_resize(gui, w, h);
} }
static void
_cb_filelist_mouse_in(Ewl_Widget *w, void *ev __UNUSED__, void *data)
{
Evas_Object *gui = data;
edje_object_signal_emit(gui, "ecdb,filelist,in", "ecdb");
printf("Emitting signal\n");
}
static void
_cb_filelist_mouse_out(Ewl_Widget *w, void *ev __UNUSED__, void *data)
{
Evas_Object *gui = data;
edje_object_signal_emit(gui, "ecdb,filelist,out", "ecdb");
printf("Emitting signal\n");
}
int int
ecdb_create_main_gui(void) ecdb_create_main_gui(void)
{ {
@ -77,6 +93,10 @@ ecdb_create_main_gui(void)
filelist = ewl_filelist_new(); filelist = ewl_filelist_new();
ewl_container_child_append(EWL_CONTAINER(embed), filelist); ewl_container_child_append(EWL_CONTAINER(embed), filelist);
ewl_filelist_directory_set(EWL_FILELIST(filelist), getenv("HOME")); ewl_filelist_directory_set(EWL_FILELIST(filelist), getenv("HOME"));
ewl_callback_append(filelist, EWL_CALLBACK_MOUSE_IN,
_cb_filelist_mouse_in, gui);
ewl_callback_append(filelist, EWL_CALLBACK_MOUSE_OUT,
_cb_filelist_mouse_out, gui);
ewl_widget_show(filelist); ewl_widget_show(filelist);
edje_object_part_geometry_get(gui, "filelist", &x, &y, &w, &h); edje_object_part_geometry_get(gui, "filelist", &x, &y, &w, &h);