More work on the interface.

This commit is contained in:
Jaime Thomas 2008-09-24 18:52:11 +00:00
parent 30ed274ea9
commit b59ace9aa9
4 changed files with 162 additions and 31 deletions

View File

@ -5,6 +5,7 @@ group {
parts {
part {
name: "bg";
type: RECT;
description {
state: "default" 0.0;
@ -36,7 +37,7 @@ group {
source: "ecdb";
action: STATE_SET "visible" 0.0;
target: "bg";
transition: LINEAR 0.5;
transition: DECELERATE 0.5;
}
program {

View File

@ -3,6 +3,41 @@ group {
min: 640 170;
parts {
part {
name: "bg";
type: RECT;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: 0 0;
}
}
description {
state: "hidden" 0.0;
color: 0 0 0 0;
rel1 {
relative: 1.0 1.0;
offset: -1 -1;
}
rel2 {
relative: 1.0 1.0;
offset: 33 33;
}
}
}
part {
name: "ecdb/burn_data";
type: SWALLOW;
@ -10,14 +45,15 @@ group {
description {
state: "default" 0.0;
min: 28 24;
rel1 {
to: "bg";
relative: 0.0 0.0;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 0.5 0.5;
offset: -11 -11;
}
@ -31,14 +67,15 @@ group {
description {
state: "default" 0.0;
min: 88 24;
rel1 {
to: "bg";
relative: 0.5 0.0;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 1.0 0.5;
offset: -11 -11;
}
@ -52,14 +89,15 @@ group {
description {
state: "default" 0.0;
min: 88 24;
rel1 {
to: "bg";
relative: 0.0 0.5;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 0.5 1.0;
offset: -11 -11;
}
@ -73,18 +111,46 @@ group {
description {
state: "default" 0.0;
min: 88 24;
rel1 {
to: "bg";
relative: 0.5 0.5;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 1.0 1.0;
offset: -11 -11;
}
}
}
}
programs {
program {
name: "welcome_page,hide";
signal: "ecdb,welcome_page,hide";
source: "ecdb";
action: STATE_SET "hidden" 0.0;
transition: DECELERATE 0.5;
target: "bg";
after: "hide,finished";
}
program {
name: "hide,finished";
action: SIGNAL_EMIT "hide,finished" "welcome_page";
}
program {
name: "welcome_page,show";
signal: "ecdb,welcome_page,show";
source: "ecdb";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.5;
target: "bg";
}
}
}

View File

@ -332,19 +332,20 @@ group {
program {
name: "filelist,focus,in";
signal: "ecdb,filelist,in";
source: "ecdb";
signal: "mouse,in";
source: "filelist_overlay";
action: STATE_SET "focused" 0.0;
target: "filelist_container";
transition: LINEAR 0.5;
transition: LINEAR 0.2;
}
program {
signal: "ecdb,filelist,out";
source: "ecdb";
name: "filelist,focus,out";
signal: "mouse,out";
source: "filelist_overlay";
action: STATE_SET "default" 0.0;
target: "filelist_container";
transition: LINEAR 0.5;
transition: LINEAR 0.2;
}
program {

View File

@ -5,8 +5,12 @@ static void ecdb_cb_welcome_page_buttons_focused(void *data, Evas_Object *o,
const char *emission, const char *source);
static void ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
const char *emission, const char *source);
static void ecdb_cb_page_hide_finished(void *data, Evas_Object *o,
const char *emission, const char *source);
static void ecdb_filelist_show(void);
static void ecdb_welcome_page_show(void);
static void ecdb_erase_page_show(void);
static void ecdb_page_hide(const char *pname);
static void
ecdb_cb_enter(Ecore_Evas *ee)
@ -35,22 +39,6 @@ ecdb_cb_resize(Ecore_Evas *ee)
evas_object_resize(gui, w, h);
}
static void
_cb_filelist_mouse_in(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
void *data)
{
Evas_Object *gui = data;
edje_object_signal_emit(gui, "ecdb,filelist,in", "ecdb");
}
static void
_cb_filelist_mouse_out(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
void *data)
{
Evas_Object *gui = data;
edje_object_signal_emit(gui, "ecdb,filelist,out", "ecdb");
}
static void
_cb_filelist_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *eo,
void *ev_data __UNUSED__)
@ -198,6 +186,7 @@ ecdb_create_main_gui(void)
return TRUE;
}
/* This needs some work. Where should user themes go? */
void
ecdb_set_main_theme(const char *theme_name)
{
@ -335,6 +324,14 @@ ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
*/
if (!strcmp(source, "ecdb/burn_data"))
ecdb_filelist_show();
else if (!strcmp(source, "ecdb/erase"))
{
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"welcome_page");
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide",
"ecdb");
ecdb_erase_page_show();
}
else if (swallow)
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
@ -369,6 +366,9 @@ ecdb_welcome_page_show(void)
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
"ecdb/*", ecdb_cb_welcome_page_buttons_clicked,
NULL);
edje_object_signal_callback_add(swallow, "hide,finished",
"welcome_page", ecdb_cb_page_hide_finished,
NULL);
evas_object_show(swallow);
Evas_Object *b;
@ -404,6 +404,7 @@ ecdb_welcome_page_show(void)
}
edje_object_signal_emit(gui, "ecdb,welcome_page,show", "ecdb");
edje_object_signal_emit(swallow, "ecdb,welcome_page,show", "ecdb");
}
static void
@ -435,10 +436,6 @@ ecdb_filelist_show(void)
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);
@ -465,4 +462,70 @@ ecdb_filelist_show(void)
}
edje_object_signal_emit(gui, "ecdb,filelist,visible", "ecdb");
edje_object_signal_emit(swallow, "ecdb,filelist,visible", "ecdb");
}
/* This should be triggered by the theme, once it is done with its
* nice fancy animations
*/
static void
ecdb_page_hide(const char *pname)
{
Evas_Object *swallow, *gui;
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), pname);
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
if (gui)
{
edje_object_part_unswallow(gui, swallow);
evas_object_hide(swallow);
}
}
static void
ecdb_erase_page_show(void)
{
Evas_Object *swallow, *gui;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"erase_page");
if (!swallow)
{
Evas_Coord x, y, w, h;
swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
evas_object_name_set(swallow, "erase_page");
edje_object_file_set(swallow, em->theme_path,
"ecdb/erase_page");
edje_object_signal_callback_add(swallow, "hide,finished",
"erase_page", ecdb_cb_page_hide_finished,
NULL);
edje_object_part_geometry_get(gui, "action_area",
&x, &y, &w, &h);
evas_object_move(swallow, x, y);
evas_object_resize(swallow, w, h);
edje_object_part_swallow(gui, "action_area", swallow);
evas_object_show(swallow);
}
else if (edje_object_part_swallow_get(gui, "action_area") != swallow)
{
edje_object_part_swallow(gui, "action_area", swallow);
evas_object_show(swallow);
}
edje_object_signal_emit(gui, "ecdb,erase_page,visible", "ecdb");
edje_object_signal_emit(swallow, "ecdb,erase_page,visible", "ecdb");
}
/* Hurrah! Fancyness */
static void
ecdb_cb_page_hide_finished(void *data, Evas_Object *o, const char *emission,
const char *source)
{
ecdb_page_hide(source);
}