Add a mouseover effect for the filelist
This commit is contained in:
parent
deeb4a33bc
commit
e24f37e95d
@ -26,23 +26,73 @@ group {
|
||||
}
|
||||
|
||||
part {
|
||||
name: "filelist";
|
||||
type: SWALLOW;
|
||||
name: "filelist_container";
|
||||
type: IMAGE;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
min: 245 245;
|
||||
max: 99999 350;
|
||||
align: 0.0 0.0;
|
||||
color: 255 255 255 0;
|
||||
|
||||
rel1 {
|
||||
to: "background";
|
||||
offset: 5 5;
|
||||
}
|
||||
|
||||
rel2 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
ecdb/trunk/data/themes/default/images/focus.png
Normal file
BIN
ecdb/trunk/data/themes/default/images/focus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 243 B |
@ -1,3 +1,4 @@
|
||||
images {
|
||||
image: "background.png" COMP;
|
||||
image: "focus.png" COMP;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "ecdb.h"
|
||||
|
||||
void
|
||||
static void
|
||||
ecdb_cb_enter(Ecore_Evas *ee)
|
||||
{
|
||||
Evas_Object *gui;
|
||||
@ -8,15 +8,15 @@ ecdb_cb_enter(Ecore_Evas *ee)
|
||||
edje_object_signal_emit(gui, "ecdb,window,enter", "ecdb");
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
ecdb_cb_leave(Ecore_Evas *ee)
|
||||
{
|
||||
Evas_Object *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)
|
||||
{
|
||||
int w, h;
|
||||
@ -27,6 +27,22 @@ ecdb_cb_resize(Ecore_Evas *ee)
|
||||
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
|
||||
ecdb_create_main_gui(void)
|
||||
{
|
||||
@ -77,6 +93,10 @@ ecdb_create_main_gui(void)
|
||||
filelist = ewl_filelist_new();
|
||||
ewl_container_child_append(EWL_CONTAINER(embed), filelist);
|
||||
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);
|
||||
|
||||
edje_object_part_geometry_get(gui, "filelist", &x, &y, &w, &h);
|
||||
|
Loading…
Reference in New Issue
Block a user