diff --git a/data/themes/default/default.edc b/data/themes/default/default.edc index 46d3848..683ef0b 100644 --- a/data/themes/default/default.edc +++ b/data/themes/default/default.edc @@ -105,14 +105,11 @@ collections parts { /* background */ part { - type: IMAGE; + name: "elfe.swallow.background"; + type: SWALLOW; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - image { - normal: "bg.png"; - } } } part { @@ -827,8 +824,10 @@ collections group { name: "elfe/dock/layout"; + images { + image: "engage_im0.png" COMP; + } parts { - part { name: "menu.background.bottom"; mouse_events: 1; @@ -837,6 +836,7 @@ collections state: "default" 0.0; image.normal: "mainmenu_bg_bottom.png"; image.border: 0 0 2 0; + color: 255 255 255 200; } } diff --git a/data/themes/default/images/desk_selected.png b/data/themes/default/images/desk_selected.png index e89caaa..bcfaa6c 100644 Binary files a/data/themes/default/images/desk_selected.png and b/data/themes/default/images/desk_selected.png differ diff --git a/data/themes/default/images/mainmenu_bg_bottom.png b/data/themes/default/images/mainmenu_bg_bottom.png index 4c97606..abb117f 100644 Binary files a/data/themes/default/images/mainmenu_bg_bottom.png and b/data/themes/default/images/mainmenu_bg_bottom.png differ diff --git a/launch.sh b/launch.sh index c09f707..aa7c887 100755 --- a/launch.sh +++ b/launch.sh @@ -1,2 +1,2 @@ #!/bin/sh -x-ui.sh --profile=illume-home --screen=320x480 \ No newline at end of file +x-ui.sh --profile=illume --screen=480x800 \ No newline at end of file diff --git a/src/desktop.c b/src/desktop.c index abfdc33..e833f54 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -62,6 +62,17 @@ _scroller_scroll_anim_stop_cb(void *data , Evas_Object *obj __UNUSED__, void *ev } } +static void +_scroller_scroll_cb(void *data , Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Elfe_Desktop *desk = data; + Evas_Coord x, y, w, h; + + + elm_scroller_region_get(desk->sc, &x, &y, &w, &h); + evas_object_smart_callback_call(desk->layout, "scroll", &x); +} + static Eina_Bool _longpress_timer_cb(void *data) { @@ -470,6 +481,7 @@ elfe_desktop_add(Evas_Object *parent, E_Zone *zone) /* evas_object_size_hint_max_set(desk->dock, 9999, 80); */ evas_object_smart_callback_add(desk->sc, "scroll,anim,stop", _scroller_scroll_anim_stop_cb, desk); + evas_object_smart_callback_add(desk->sc, "scroll", _scroller_scroll_cb, desk); evas_object_event_callback_add(desk->sc, EVAS_CALLBACK_MOUSE_MOVE, _scroller_mouse_move_cb, desk); evas_object_event_callback_add(desk->sc, EVAS_CALLBACK_MOUSE_UP, _scroller_mouse_up_cb, desk); diff --git a/src/main.c b/src/main.c index e284e5c..bb860a7 100644 --- a/src/main.c +++ b/src/main.c @@ -104,6 +104,31 @@ elfe_home_win_cfg_update(void) } +static void +_scroll_anim_cb(void *data , Evas_Object *obj, void *event_info) +{ + Elfe_Home_Win *hwin = data; + + int *x = (int*)event_info; + Evas_Coord w; + double pos; + + evas_object_geometry_get(hwin->o_bg, NULL, NULL, &w, NULL); + pos = (double)((double)(*x) * (double)((double)(w - hwin->zone->w) / + (double)(hwin->zone->w * 4))); + elm_scroller_region_show(hwin->bg_scroller, pos, 0, hwin->zone->w, hwin->zone->h); +} +static void +_cb_bg_resize(void *data , Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +{ + /* Elfe_Home_Win *hwin = data; */ + /* Evas_Coord x, y, w, h; */ + + /* edje_object_parts_extends_calc(hwin->o_bg, &x, &y, &w, &h); */ + /* evas_object_size_hint_min_set(hwin->o_bg, w, h); */ + /* evas_object_size_hint_min_set(obj, w, h); */ +} + static void _elfe_home_win_new(E_Zone *zone) { @@ -112,9 +137,9 @@ _elfe_home_win_new(E_Zone *zone) E_Desk *desk; char buf[PATH_MAX]; const char *bgfile; - - Evas_Object *o_edje; const char *file; + Evas_Object *rect; + Evas_Coord w, h; hwin = E_OBJECT_ALLOC(Elfe_Home_Win, ELFE_HOME_WIN_TYPE, _elfe_home_win_cb_free); if (!hwin) return; @@ -137,6 +162,36 @@ _elfe_home_win_new(E_Zone *zone) elfe_home_cfg->mod_dir); evas = e_win_evas_get(hwin->win); + rect = evas_object_rectangle_add(evas); + evas_object_color_set(rect, 0, 0, 0, 255); + evas_object_move(rect, 0, 0); + evas_object_resize(rect, zone->w, zone->h); + evas_object_show(rect); + + + /* Specific ELM initialisation */ + elm_init(0, NULL); + elm_need_efreet(); + + hwin->layout = elm_layout_add(rect); + /* Try default theme first */ + file = e_theme_edje_file_get("base/theme/modules/elfe", "module/elfe/main"); + if (file && file[0]) + elm_layout_file_set(hwin->layout, file, "module/elfe/main"); + else /* specific module theme otherwise */ + { + if (!elm_layout_file_set(hwin->layout, buf, "module/elfe/main")) + { + printf("Error loading group %s in %s theme file\n", "module/elfe/main", buf); + } + } + + elfe_theme = elm_theme_new(); + /* Use specific module theme as elm theme overlay */ + elm_theme_overlay_add(elfe_theme, buf); + elm_object_theme_set(hwin->layout, elfe_theme); + + hwin->bg_scroller = elm_scroller_add(hwin->layout); desk = e_desk_current_get(zone); if (desk) @@ -146,40 +201,18 @@ _elfe_home_win_new(E_Zone *zone) hwin->o_bg = edje_object_add(evas); edje_object_file_set(hwin->o_bg, bgfile, "e/desktop/background"); - evas_object_move(hwin->o_bg, 0, 0); evas_object_show(hwin->o_bg); + evas_object_event_callback_add(hwin->o_bg, EVAS_CALLBACK_RESIZE, + _cb_bg_resize, hwin); - printf("Create layout\n"); - - - /* Specific ELM initialisation */ - elm_init(0, NULL); - elm_need_efreet(); - - - hwin->layout = elm_layout_add(hwin->o_bg); - /* Try default theme first */ - file = e_theme_edje_file_get("base/theme/modules/elfe", "module/elfe/main"); - printf("file : %s\n", file); - if (file && file[0]) - elm_layout_file_set(hwin->layout, file, "module/elfe/main"); - else /* specific module theme otherwise */ - { - printf("specific file : %s\n", buf); - if (!elm_layout_file_set(hwin->layout, buf, "module/elfe/main")) - { - printf("Error loading group %s in %s theme file\n", "module/elfe/main", buf); - } - } - o_edje = elm_layout_edje_get(hwin->layout); - - elfe_theme = elm_theme_new(); - /* Use specific module theme as elm theme overlay */ - elm_theme_overlay_add(elfe_theme, buf); - elm_object_theme_set(hwin->layout, elfe_theme); + elm_scroller_content_set(hwin->bg_scroller, hwin->o_bg); + evas_object_show(hwin->bg_scroller); + elm_layout_content_set(hwin->layout, "elfe.swallow.background", hwin->bg_scroller); hwin->desktop = elfe_desktop_add(hwin->layout, hwin->zone); elm_layout_content_set(hwin->layout, "elfe.swallow.desktop", hwin->desktop); + evas_object_smart_callback_add(hwin->desktop, "scroll", _scroll_anim_cb, hwin); + evas_object_move(hwin->layout, 0, 0); evas_object_show(hwin->layout); @@ -198,6 +231,7 @@ _elfe_home_win_new(E_Zone *zone) static void _elfe_home_win_cb_free(Elfe_Home_Win *hwin) { + printf("CB FREE\n"); if (hwin->win->evas_win) e_drop_xdnd_register_set(hwin->win->evas_win, 0); if (hwin->o_bg) evas_object_del(hwin->o_bg); if (hwin->layout) evas_object_del(hwin->layout); @@ -209,9 +243,14 @@ static void _elfe_home_win_cb_resize(E_Win *win) { Elfe_Home_Win *hwin; - + Evas_Coord w, h; if (!(hwin = win->data)) return; - if (hwin->o_bg) evas_object_resize(hwin->o_bg, win->w, win->h); + if (hwin->o_bg) + { + evas_object_size_hint_min_set(hwin->o_bg, win->w, win->h); + edje_object_parts_extends_calc(hwin->o_bg, NULL, NULL, &w, &h); + evas_object_size_hint_min_set(hwin->o_bg, w, h); + } if (hwin->layout) evas_object_resize(hwin->layout, win->w, win->h); } @@ -228,6 +267,7 @@ _elfe_home_cb_bg_change(void *data __UNUSED__, int type, void *event __UNUSED__) E_Zone *zone; E_Desk *desk; const char *bgfile; + Evas_Coord w, h; zone = hwin->zone; desk = e_desk_current_get(zone); @@ -235,7 +275,9 @@ _elfe_home_cb_bg_change(void *data __UNUSED__, int type, void *event __UNUSED__) bgfile = e_bg_file_get(zone->container->num, zone->num, desk->x, desk->y); else bgfile = e_bg_file_get(zone->container->num, zone->num, -1, -1); - edje_object_file_set(hwin->o_bg, bgfile, "e/desktop/background"); + edje_object_file_set(hwin->o_bg, bgfile, "e/desktop/background"); + edje_object_parts_extends_calc(hwin->o_bg, NULL, NULL, &w, &h); + evas_object_size_hint_min_set(hwin->o_bg, w, h); } return ECORE_CALLBACK_PASS_ON; diff --git a/src/main.h b/src/main.h index 43e1d98..e82fd70 100644 --- a/src/main.h +++ b/src/main.h @@ -13,6 +13,7 @@ struct _Elfe_Home_Win E_Win *win; Evas_Object *o_bg; + Evas_Object *bg_scroller; Evas_Object *layout; Evas_Object *desktop;