}
}
}
+ group { name: "elm/button/base/transparent";
+ data {
+ item: "focus_highlight" "on";
+ }
+ images {
+ image: image_normal COMP;
+ }
+ script {
+ public mouse_down = 0;
+ public multi_down = 0;
+ }
+ parts {
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "over2";
+ type: RECT;
+ repeat_events: 1;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "over3";
+ type: RECT;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { name: "button_press";
+ signal: "mouse,down,1*";
+ source: "over2";
+ script {
+ if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0))
+ {
+ set_int(mouse_down, 1);
+ emit("elm,action,press", "");
+ }
+ }
+ }
+ program { name: "button_unpress";
+ signal: "mouse,up,1*";
+ source: "over3";
+ script {
+ if (get_int(mouse_down) == 1)
+ {
+ set_int(mouse_down, 0);
+ emit("elm,action,unpress", "");
+ }
+ }
+ }
+ program { name: "button_click";
+ signal: "mouse,clicked,1";
+ source: "over2";
+ script {
+ if (get_int(multi_down) == 0) {
+ emit("elm,action,click", "");
+ }
+ }
+ }
+ program { name: "multi_down";
+ signal: "elm,action,multi,down";
+ source: "elm";
+ script {
+ set_int(multi_down, 1);
+ }
+ }
+ program {
+ name: "multi_up";
+ signal: "elm,action,multi,up";
+ source: "elm";
+ script {
+ set_int(multi_down, 0);
+ }
+ }
+ }
+}
}
focus = elm_button_add(button);
retv_if(NULL == focus, NULL);
- elm_object_style_set(focus, "focus");
+ elm_object_theme_set(focus, menu_screen_get_theme());
+ elm_object_style_set(focus, "transparent");
elm_object_part_content_set(button, "focus", focus);
elm_access_info_cb_set(focus, ELM_ACCESS_INFO, _access_info_cb, scroller);
evas_object_smart_callback_add(focus, "clicked", _focus_clicked_cb, scroller);
for(i = (MAX_PAGE_NO * PAGE_MAX_APP); i<count; i++) {
app_list_item *item = list_nth(list, (MAX_PAGE_NO * PAGE_MAX_APP));
- if(!item)
- _E("Cannot remove an item(%s)", item->package);
- _D("%d: %s is removed", i, item->package);
+ if (!item) {
+ _E("There's something wrong, can't remove the item");
+ continue;
+ } else if (item->package) {
+ _D("%d: %s is removed", i, item->package);
+ }
retv_if(MENU_SCREEN_ERROR_FAIL == list_remove_item(list, item), NULL);
}
retv_if(NULL == number, NULL);
for (i = 0; i < count; i++) {
- sprintf(number, "%d", i + 1);
+ snprintf(number, ((size_t) log10((double) MAX_PAGE_NO)) + 2, "%d", i + 1);
elm_index_item_append(index, number, NULL, (void *) i);
}
elm_index_level_go(index, 0);
ret_if(NULL == obj);
ret_if(value <= 0);
- sprintf(str, "%d", value);
+ snprintf(str, sizeof(str), "%d", value);
if (edje_object_part_text_set(_EDJ(obj), "badge,txt", str) == EINA_FALSE) {
_E("Failed to set text on the part, edje:%p, part:%s, text:%s", _EDJ(obj), "badge,txt", str);
}
item_focus = elm_button_add(item);
retv_if(NULL == item_focus, NULL);
- elm_object_style_set(item_focus, "focus");
+ elm_object_theme_set(item_focus, menu_screen_get_theme());
+ elm_object_style_set(item_focus, "transparent");
elm_object_part_content_set(item, "focus", item_focus);
elm_access_info_cb_set(item_focus, ELM_ACCESS_INFO, _access_info_cb, item);
evas_object_smart_callback_add(item_focus, "clicked", _focus_clicked_cb, item);
focus = elm_button_add(item);
retv_if(NULL == focus, NULL);
- elm_object_style_set(focus, "focus");
+ elm_object_theme_set(focus, menu_screen_get_theme());
+ elm_object_style_set(focus, "transparent");
elm_object_part_content_set(item, "uninstall_focus", focus);
elm_access_info_cb_set(focus, ELM_ACCESS_INFO, _access_uninstall_cb, item);
evas_object_smart_callback_add(focus, "clicked", _uninstall_focus_clicked_cb, item);
int cur_idx = page_scroller_get_current_page_no(scroller);
int idx = 0, x = 0, w = 0;
elm_scroller_region_get(scroller, &x, NULL, &w, NULL);
+ break_if(w == 0);
- if (w) idx = x / w;
+ idx = x / w;
if (cur_idx != idx) {
page_scroller_bring_in(scroller, idx);
break;
/* If there are no items to be focused after pressing keys,
Menu-screen forces to focus the first item of the other page */
+
int rest = x % w;
if (rest) {
page_scroller_focus_into_vector(scroller, rest > w / 2 ? -1 : 1);
}
retv_if(pending_idx == -1, MENU_SCREEN_ERROR_FAIL);
- sprintf(tmp, "menu_swallow_%d", pending_idx);
+ snprintf(tmp, sizeof(tmp), "menu_swallow_%d", pending_idx);
check_item = edje_object_part_swallow_get(_EDJ(page), tmp);
retv_if(check_item != item, MENU_SCREEN_ERROR_FAIL);
object = page_get_item_at(page, idx);
if (object) {
Evas_Object *check_object;
- sprintf(tmp, "menu_swallow_%d", idx);
+ snprintf(tmp, sizeof(tmp), "menu_swallow_%d", idx);
check_object = elm_object_part_content_unset(page, tmp);
if (check_object != object) {
Eina_List *list = NULL;
page_max_app = (int) evas_object_data_get(scroller, "page_max_app");
+ ret_if (page_max_app == 0);
+
for (i = 0; i < MAX_PAGE_NO; i ++) {
page = page_scroller_get_page_at(scroller, i);
if (!page) break;