#modify
author-signature.xml
signature1.xml
-bin/homescreen-efl
-res/edje/app_icon.edj
-res/edje/cluster_page.edj
-res/edje/widget.edj
+res/edje/add_widget_viewer.edj
extern double __conf_get_resolution_scale_area();
extern int __conf_get_window_h();
extern int __conf_get_window_w();
+extern int __conf_get_mirroring_x(int x, int width);
+
+#define MIRRORING_X(x, w) (__conf_get_mirroring_x((x), (w)))
#define INDICATOR_H ((45) * (__conf_get_resolution_scale_h()))
#define PAGE_INDICATOR_MAX_PAGE_COUNT 7
#define PAGE_INDICATOR_CENTER_PAGE_INDEX 3
-
typedef struct {
Evas_Object *scroller;
Evas_Object *box;
Evas_Object *unit[PAGE_INDICATOR_MAX_PAGE_COUNT];
+ double unit_angle[PAGE_INDICATOR_MAX_PAGE_COUNT];
int page_count;
int x;
styles {
style {
name: "leaf,font";
- base: "font=Tizen text_class=T024 font_size=38 align=left color=#808080FF color_class=T024 ellipsis=1.0";
+ base: "font=Tizen text_class=T024 font_size=38 color=#808080FF color_class=T024 ellipsis=1.0";
}
}
evas_object_size_hint_align_set(cluster_view_s.allpage, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(cluster_view_s.allpage, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_resize(cluster_view_s.allpage, WINDOW_W, WINDOW_H);
evas_object_move(cluster_view_s.allpage, 0, 0);
evas_object_show(cluster_view_s.allpage);
cluster_page_t *page_item = NULL;
elm_box_unpack_all(cluster_view_s.box);
EINA_LIST_FOREACH(cluster_view_s.page_list, find_list, page_item) {
- evas_object_move(page_item->page_layout, -720, 0);
+ evas_object_move(page_item->page_layout, -WINDOW_W, -WINDOW_H);
if (page_item->page_layout) {
page_item->thumbnail_ly = elm_layout_add(page_item->page_layout);
elm_layout_file_set(page_item->thumbnail_ly, util_get_res_file_path(EDJE_DIR"/cluster_allpage_thumbnail.edj"), GROUP_CLUSTER_ALLPAGE_THUMBNAIL_LY);
for (idx = 0; idx < cluster_view_s.page_count; idx++) {
int row = idx / 2;
int col = idx % 2;
- int ny = sy + (row * h);
- int nx = sx + (col * w);
+ int ny = sy + (row * h) + (CLUSTER_ALL_PAGE_H / 2);
+ int nx = sx + (col * w) + (CLUSTER_ALL_PAGE_W / 2);
int d = (ny - y) * (ny - y) + (nx - x) * (nx - x);
if (d < CLUSTER_VIEW_ALLPAGE_MOVE_GAP) {
int move_y = cluster_mouse_info.move_y - cluster_mouse_info.offset_y;
int new_index = INIT_VALUE;
evas_object_move(cluster_view_s.picked_page->thumbnail_ly, move_x, move_y);
- new_index = __cluster_view_allpage_get_page_index(move_x, move_y);
+ new_index = __cluster_view_allpage_get_page_index(MIRRORING_X(move_x + CLUSTER_ALL_PAGE_W / 2, WINDOW_W), move_y + CLUSTER_ALL_PAGE_H / 2);
int move = 0;
int start, end;
elm_object_signal_emit(cluster_view_s.picked_page->thumbnail_ly, SIGNAL_ALLPAGE_DELETE_BUTTON_HIDE, SIGNAL_SOURCE);
elm_object_signal_emit(cluster_view_s.picked_page->thumbnail_ly, SIGNAL_ALLPAGE_DRAG_BG_SHOW, SIGNAL_SOURCE);
- int x, y;
- __cluster_view_allpage_get_page_pos(cluster_view_s.picked_page->page_index, &x, &y);
- cluster_mouse_info.offset_x = cluster_mouse_info.down_x - x;
- cluster_mouse_info.offset_y = cluster_mouse_info.down_y - y;
+ int cx = -1, cy = -1;
+ int gx = -1, gy = -1, gw = 0, gh = 0;
+ Evas *e = NULL;
+
+ Evas_Object *page = cluster_view_s.picked_page->thumbnail_ly;
+ e = evas_object_evas_get(page);
+ evas_pointer_canvas_xy_get(e, &cx, &cy);
+ evas_object_geometry_get(page, &gx, &gy, &gw, &gh);
+
+ cluster_mouse_info.offset_x = cx - gx;
+ cluster_mouse_info.offset_y = cy - gy;
}
static void __cluster_view_allpage_drop_page(void *data)
* limitations under the License.
*/
+#include <Elementary.h>
+
#include "conf.h"
#include "util.h"
return resolution_scale_area;
}
+int __conf_get_mirroring_x(int x, int width)
+{
+ if (elm_config_mirrored_get())
+ return width - x;
+
+ return x;
+}
+
void conf_set_resolution_scale(int win_width, int win_height)
{
window_h = win_height;
static void __homescreen_efl_lang_changed_cb(app_event_info_h event_info, void *user_data)
{
- LOGD("called");
menu_hide();
cluster_view_lang_changed(main_info.view_type);
apps_view_lang_changed(main_info.view_type);
static void __page_indicator_unit_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static int __page_indicator_get_indicator_unit(int page_count, int cur_page);
-page_indicator_t * page_indictor_create(Evas_Object *scroller)
+page_indicator_t *page_indictor_create(Evas_Object *scroller)
{
int i;
char edj_path[PATH_MAX] = {0, };
evas_object_resize(rect, PAGE_INDICATOR_UNIT, PAGE_INDICATOR_UNIT);
evas_object_show(rect);
elm_object_part_content_set(page_indicator->unit[i], SIZE_SETTER, rect);
+ page_indicator->unit_angle[i] = 0.0;
}
return page_indicator;
static void __page_indicator_scroll_cb(void *data, Evas_Object *obj, void *event_info)
{
- int i = 0;
- int x = 0;
- int max_unit_count = 0;
- double cur_unit_angle = 0.0;
- double next_unit_angle = 0.0;
- int cur_indicator_unit = -1;
- int next_indicator_unit = -1;
- int cur_page = 0, next_page = 0;
- int cur_x = 0, next_x = 0;
-
page_indicator_t *page_indicator = (page_indicator_t*) data;
if (!page_indicator) {
LOGE("Invalid page_indicator");
return;
}
- elm_scroller_region_get(obj, &x, NULL, NULL, NULL);
+ int cur_x = 0;
+ int page_size = 0;
+ elm_scroller_region_get(obj, &cur_x, NULL, &page_size, NULL);
+
+ int scroller_width = page_size * page_indicator->page_count;
+ int cur_page_x = page_indicator->current_page * page_size;
- cur_page = x / page_indicator->w;
- next_page = (cur_page + 1) % page_indicator->page_count;
+ cur_x = MIRRORING_X(cur_x + page_size / 2, scroller_width) - page_size / 2;
- cur_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, cur_page);
- next_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, next_page);
+ int delta_x = cur_x - cur_page_x;
+ if (delta_x < -page_size)
+ delta_x = delta_x + scroller_width;
+ else if (delta_x > page_size)
+ delta_x = delta_x - scroller_width;
+
+ int cur_page = page_indicator->current_page;
+ int next_page = (cur_page + 1) % page_indicator->page_count;
+ if (delta_x < 0) {
+ delta_x = (delta_x - scroller_width) % scroller_width;
+ next_page = ((cur_page - 1) + page_indicator->page_count) % page_indicator->page_count;
+ }
- cur_x = x;
- next_x = (cur_x + page_indicator->w) % (page_indicator->w * page_indicator->page_count);
+ int cur_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, cur_page);
+ int next_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, next_page);
- next_unit_angle = (double)(next_x - next_page * page_indicator->w) / page_indicator->w * 90.0;
- cur_unit_angle = (next_unit_angle + 90) - 180;
+ double angle_delta = (double)delta_x / page_size * 90.0;
- max_unit_count = page_indicator->page_count < PAGE_INDICATOR_MAX_PAGE_COUNT ? page_indicator->page_count : PAGE_INDICATOR_MAX_PAGE_COUNT;
+ int i = 0;
+ int max_unit_count = page_indicator->page_count < PAGE_INDICATOR_MAX_PAGE_COUNT ? page_indicator->page_count : PAGE_INDICATOR_MAX_PAGE_COUNT;
for (i = 0; i < max_unit_count; i++)
{
double angle = 0.0;
- double color = 0.0;
-
- if (i == cur_indicator_unit) {
- angle = cur_unit_angle;
- } else if (i == next_indicator_unit) {
- angle = next_unit_angle;
- } else {
- angle = 0.0;
+ if (i == cur_indicator_unit || i == next_indicator_unit) {
+ angle = page_indicator->unit_angle[i] + angle_delta;
+ if (angle > 90.0)
+ angle -= 180.0;
}
- color = fabs(angle) * 2 + 75.0;
+ double color = fabs(angle) * 2 + 75.0;
__page_indicator_unit_rotate(page_indicator->unit[i], angle, color);
}
}
if (i == cur_indicator_unit) {
edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_CURRENT, SIGNAL_SOURCE);
+ page_indicator->unit_angle[i] = 90.0;
}
else {
edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_DEFAULT, SIGNAL_SOURCE);
+ page_indicator->unit_angle[i] = 0.0;
}
if (page_indicator->page_count > PAGE_INDICATOR_MAX_PAGE_COUNT && i == PAGE_INDICATOR_CENTER_PAGE_INDEX) {