TizenRefApp-7105 [Email] Implement favorites button accrding to GUI 88/87588/4
authorAndriy Kolesnichenko <a.kolesniche@samsung.com>
Thu, 8 Sep 2016 15:39:26 +0000 (18:39 +0300)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Tue, 13 Sep 2016 10:26:58 +0000 (03:26 -0700)
Change-Id: I634aeb326a50b4f6b76d8a53757b149790302d38
Signed-off-by: Andriy Kolesnichenko <a.kolesniche@samsung.com>
18 files changed:
CMake/modules/email-mailbox-module/CMakeLists.txt
edc/common/email-colors.edc
edc/common/email-flat-buttons.edc
edc/composer/email-composer-rich-text.edc
edc/images/list_icon/index_icon_favorite_off.png
edc/images/list_icon/index_icon_favorite_on.png
edc/images/viewer_icon/email_icon_favorite_off.png [new file with mode: 0644]
edc/images/viewer_icon/email_icon_favorite_on.png [new file with mode: 0644]
edc/mailbox/email-mailbox-genlist-style.edc
edc/mailbox/email-mailbox-theme.edc
edc/viewer/email-viewer-subject-layout.edc
modules/mailbox/inc/email-mailbox-util.h
modules/mailbox/inc/email-mailbox.h
modules/mailbox/src/email-mailbox-list.c
modules/mailbox/src/email-mailbox.c
modules/viewer/src/email-viewer-header.c
modules/viewer/src/email-viewer.c
res/edje/email-mailbox.edc

index 4a9f31d..47dd767 100644 (file)
@@ -41,6 +41,7 @@ ADD_CUSTOM_COMMAND(
                                ${PROJECT_EDC_DIR}/mailbox/email-mailbox-search-entry.edc
                                ${PROJECT_EDC_DIR}/common/email-colors.edc
                                ${PROJECT_EDC_DIR}/common/email-parts.edc
+                               ${PROJECT_EDC_DIR}/common/email-flat-buttons.edc
 )
 ADD_CUSTOM_TARGET(email-mailbox.edj ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/email-mailbox.edj)
 
index 38a66aa..af40def 100644 (file)
 #define NAVIFRAME_TITLE_BG     61 185 204 255
 #define NAVI_BTN_SELECT_BG     46 140 154 255
 
+/*Star button*/
+#define STAR_BTN_NORMAL_COLOR          245 171 0 255
+#define STAR_BTN_DIM_COLOR                     213 213 213 255
+
 #define AO001  42 184 66 255
 #define AO002  61 185 204 255
 #define AO003  255 178 0 255
index ff0e2d7..ff33af1 100644 (file)
@@ -25,7 +25,6 @@ plugins {
 
 #define GLIDE_EASE_OUT(duration) CUBIC_BEZIER (duration) 0.25 0.46 0.45 1.0
 #define FLAT_SQUARE_BTN_CORNER_RADIUS "10"
-#define FLAT_SQUARE_BTN_VG_EFFECT_SPACER_SIZE_KOEFF 1.3
 
 /**
  * @brief Macros to generate styles for button with icon inside with support of click VI effect and sound.
@@ -324,7 +323,7 @@ plugins {
                } \
        }
 
-#define FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, part_ext) \
+#define FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, vg_effect_start_koeff, vg_effect_end_koeff, part_ext) \
        group { name: "elm/button/base/email.flat.square."style_name; \
                data.item: "vector_ux" "no_bg"; \
                data.item: "corner_radius" FLAT_SQUARE_BTN_CORNER_RADIUS; \
@@ -355,8 +354,8 @@ plugins {
                                        fixed: 1 1; \
                                        rel1.relative: 0.5 0.5; \
                                        rel2.relative: 0.5 0.5; \
-                                       min: (FLAT_SQUARE_BTN_VG_EFFECT_SPACER_SIZE_KOEFF * min_width) (FLAT_SQUARE_BTN_VG_EFFECT_SPACER_SIZE_KOEFF * min_height); \
-                                       max: (FLAT_SQUARE_BTN_VG_EFFECT_SPACER_SIZE_KOEFF * min_width) (FLAT_SQUARE_BTN_VG_EFFECT_SPACER_SIZE_KOEFF * min_height); \
+                                       min: (vg_effect_end_koeff * min_width) (vg_effect_end_koeff * min_height); \
+                                       max: (vg_effect_end_koeff * min_width) (vg_effect_end_koeff * min_height); \
                                } \
                        } \
                        part { name: "tizen_vg_shape"; \
@@ -370,13 +369,13 @@ plugins {
                                } \
                                description { state: "ready" 0.0; \
                                        fixed: 1 1; \
-                                       rel1.to: "effect_spacer"; \
-                                       rel2.to: "effect_spacer"; \
+                                       rel1.relative: ((1.0 - vg_effect_start_koeff) / 2.0) ((1.0 - vg_effect_start_koeff) / 2.0); \
+                                       rel2.relative: (1.0 + (vg_effect_start_koeff - 1.0) / 2.0) (1.0 + (vg_effect_start_koeff - 1.0) / 2.0); \
                                } \
                                description { state: "pressed" 0.0; \
                                        inherit: "ready" 0.0; \
-                                       rel1.relative: -0.15 -0.15; \
-                                       rel2.relative: 1.15 1.15; \
+                                       rel1.relative: ((1.0 - vg_effect_end_koeff) / 2.0) ((1.0 - vg_effect_end_koeff) / 2.0); \
+                                       rel2.relative: (1.0 + (vg_effect_end_koeff - 1.0) / 2.0) (1.0 + (vg_effect_end_koeff - 1.0) / 2.0); \
                                } \
                        } \
                        part { name: "tizen_vg_shape_clipper"; \
@@ -593,5 +592,5 @@ plugins {
                } \
        }
 
-#define FLAT_SQUARE_BTN_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height) \
-       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, )
+#define FLAT_SQUARE_BTN_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, vg_effect_start_koeff, vg_effect_end_koeff) \
+       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, vg_effect_start_koeff, vg_effect_end_koeff,)
index b1ffa04..516f54c 100644 (file)
@@ -109,12 +109,12 @@ group { name: "ec/rt/layout/base";
                } \
        } \
 
-FLAT_SQUARE_BTN_STYLE("insert_image", EC_IMAGE_TOOLBAR_INSERT_IMAGE, AO007, AO007S, AO007D, 48, 48);
-FLAT_SQUARE_BTN_STYLE("fontsize", EC_IMAGE_TOOLBAR_FONTSIZE, AO007, AO007S, AO007D, 48, 48);
-FLAT_SQUARE_BTN_STYLE("bold", EC_IMAGE_TOOLBAR_BOLD, AO007, AO007S, AO007D, 48, 48);
-FLAT_SQUARE_BTN_STYLE("italic", EC_IMAGE_TOOLBAR_ITALIC, AO007, AO007S, AO007D, 48, 48);
-FLAT_SQUARE_BTN_STYLE("underline", EC_IMAGE_TOOLBAR_UNDERLINE, AO007, AO007S, AO007D, 48, 48);
-FLAT_SQUARE_BTN_CUSTOM_STYLE("fontcolor", EC_IMAGE_TOOLBAR_FONTCOLOR, AO007, AO007S, AO007D, 48, 48, FONTCOLOR_SQUARE_ICON_BUTTON_PART_EXT);
-FLAT_SQUARE_BTN_CUSTOM_STYLE("fontbgcolor", EC_IMAGE_TOOLBAR_FONTBGCOLOR, AO007, AO007S, AO007D, 48, 48, FONTCOLOR_SQUARE_ICON_BUTTON_PART_EXT);
-FLAT_SQUARE_BTN_STYLE("ordered_list", EC_IMAGE_TOOLBAR_NUMBERING, AO007, AO007S, AO007D, 48, 48);
-FLAT_SQUARE_BTN_STYLE("unordered_list", EC_IMAGE_TOOLBAR_ALEADSYMBOL, AO007, AO007S, AO007D, 48, 48);
+FLAT_SQUARE_BTN_STYLE("insert_image", EC_IMAGE_TOOLBAR_INSERT_IMAGE, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3);
+FLAT_SQUARE_BTN_STYLE("fontsize", EC_IMAGE_TOOLBAR_FONTSIZE, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3);
+FLAT_SQUARE_BTN_STYLE("bold", EC_IMAGE_TOOLBAR_BOLD, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3);
+FLAT_SQUARE_BTN_STYLE("italic", EC_IMAGE_TOOLBAR_ITALIC, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3);
+FLAT_SQUARE_BTN_STYLE("underline", EC_IMAGE_TOOLBAR_UNDERLINE, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3);
+FLAT_SQUARE_BTN_CUSTOM_STYLE("fontcolor", EC_IMAGE_TOOLBAR_FONTCOLOR, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3, FONTCOLOR_SQUARE_ICON_BUTTON_PART_EXT);
+FLAT_SQUARE_BTN_CUSTOM_STYLE("fontbgcolor", EC_IMAGE_TOOLBAR_FONTBGCOLOR, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3, FONTCOLOR_SQUARE_ICON_BUTTON_PART_EXT);
+FLAT_SQUARE_BTN_STYLE("ordered_list", EC_IMAGE_TOOLBAR_NUMBERING, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3);
+FLAT_SQUARE_BTN_STYLE("unordered_list", EC_IMAGE_TOOLBAR_ALEADSYMBOL, AO007, AO007S, AO007D, 48, 48, 1.0, 1.3);
\ No newline at end of file
index d6e1b9a..7e24bec 100644 (file)
Binary files a/edc/images/list_icon/index_icon_favorite_off.png and b/edc/images/list_icon/index_icon_favorite_off.png differ
index 92b6613..db7e6be 100644 (file)
Binary files a/edc/images/list_icon/index_icon_favorite_on.png and b/edc/images/list_icon/index_icon_favorite_on.png differ
diff --git a/edc/images/viewer_icon/email_icon_favorite_off.png b/edc/images/viewer_icon/email_icon_favorite_off.png
new file mode 100644 (file)
index 0000000..db2a7f6
Binary files /dev/null and b/edc/images/viewer_icon/email_icon_favorite_off.png differ
diff --git a/edc/images/viewer_icon/email_icon_favorite_on.png b/edc/images/viewer_icon/email_icon_favorite_on.png
new file mode 100644 (file)
index 0000000..b89c2ce
Binary files /dev/null and b/edc/images/viewer_icon/email_icon_favorite_on.png differ
index 8cc8f02..8627db1 100644 (file)
@@ -354,59 +354,6 @@ group { name: "elm/genlist/item/email_mailbox/default";
        }
 }
 
-#define STAR_ICON_PADDING_LEFT 15
-#define STAR_ICON_PADDING_RIGHT 15
-#define STAR_ICON_PADDING_TOP 15
-#define STAR_ICON_PADDING_BOTTOM 15
-#define STAR_ICON_SIZE 50
-
-       group {
-               name: "email/layout/star.icon";
-               parts {
-                       PART(RECT, "bg",
-                               repeat_events: 0;\
-                               description { state: "default" 0.0;
-                                       color: 0 0 0 0;
-                               }
-                       )
-
-                       PART(SPACER, "elm.padding.left",
-                               DSC_FROM_L("default" 0.0,
-                                       min: STAR_ICON_PADDING_LEFT 0;
-                                       max: STAR_ICON_PADDING_LEFT -1;
-                               )
-                       )
-
-                       PART(SPACER, "elm.padding.right",
-                               DSC_FROM_R("default" 0.0,
-                                       min: STAR_ICON_PADDING_RIGHT 0;
-                                       max: STAR_ICON_PADDING_RIGHT -1;
-                               )
-                       )
-
-                       PART(SPACER, "elm.padding.top",
-                               DSC_FROM_T("default" 0.0,
-                                       min: 0 STAR_ICON_PADDING_TOP;
-                                       max: -1 STAR_ICON_PADDING_TOP;
-                               )
-                       )
-
-                       PART(SPACER, "elm.padding.bottom",
-                               DSC_FROM_B("default" 0.0,
-                                       min: 0 STAR_ICON_PADDING_BOTTOM;
-                                       max: -1 STAR_ICON_PADDING_BOTTOM;
-                               )
-                       )
-
-                       PART(SWALLOW, "elm.swallow.content",
-                               DSC_LR("default" 0.0, "elm.padding.left", "elm.padding.right",
-                                       min: STAR_ICON_SIZE STAR_ICON_SIZE;
-                                       max: STAR_ICON_SIZE STAR_ICON_SIZE;
-                               )
-                       )
-               }
-       }
-
 #define SELECT_ICON_PADDING_LEFT 0
 #define SELECT_ICON_PADDING_RIGHT 32
 #define SELECT_ICON_PADDING_TOP 47
@@ -453,8 +400,8 @@ group { name: "elm/genlist/item/email_mailbox/default";
 
                        PART(SWALLOW, "elm.swallow.content",
                                DSC_LR("default" 0.0, "elm.padding.left", "elm.padding.right",
-                                       min: SELECT_ICON_SIZE STAR_ICON_SIZE;
-                                       max: SELECT_ICON_SIZE STAR_ICON_SIZE;
+                                       min: SELECT_ICON_SIZE SELECT_ICON_SIZE;
+                                       max: SELECT_ICON_SIZE SELECT_ICON_SIZE;
                                )
                        )
                }
index c87ff09..a90d86b 100644 (file)
                        }
                }
        }
+
+FLAT_SQUARE_BTN_STYLE("mbox.favourite_on", "list_icon/index_icon_favorite_on.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80, 0.7, 1.0);
+FLAT_SQUARE_BTN_STYLE("mbox.favourite_off", "list_icon/index_icon_favorite_off.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80, 0.7, 1.0);
index c7edfaa..f4a8759 100644 (file)
 #define SUBJECT_LAYOUT_LEFT_PADDING 32
 #define SUBJECT_LAYOUT_TOP_PADDING 24
 #define SUBJECT_LAYOUT_BOTTOM_PADDING 12
-#define SUBJECT_LAYOUT_FAVOURITE_BTN_OUTER_SIZE 80
-#define SUBJECT_LAYOUT_FAVOURITE_BTN_INNER_SIZE 50
-#define SUBJECT_LAYOUT_FAVOURITE_BTN_INNER_PADDING 15
-#define SUBJECT_LAYOUT_FAVOURITE_BTN_TOP_PADDING (17 + SUBJECT_LAYOUT_FAVOURITE_BTN_INNER_PADDING)
-#define SUBJECT_LAYOUT_FAVOURITE_BTN_RIGHT_PADDING (17 + SUBJECT_LAYOUT_FAVOURITE_BTN_INNER_PADDING)
+#define SUBJECT_LAYOUT_FAVOURITE_BTN_TOP_PADDING 17
+#define SUBJECT_LAYOUT_FAVOURITE_BTN_LEFT_PADDING 17
+#define SUBJECT_LAYOUT_FAVOURITE_BTN_RIGHT_PADDING 17
+#define SUBJECT_LAYOUT_FAVOURITE_BTN_SIZE 80
 
 //details layout
 #define DETAILS_LAYOUT_LEFT_PADDING 32
@@ -162,21 +161,31 @@ group {
                        }
                )
 
+               E_PART_SPACER("favourite_btn.padding.right",
+                       description { state: "default" 0.0;
+                               fixed: 1 0;
+                               align: 1.0 0.5;
+                               rel1.relative: 1.0 0.0;
+                               min: SUBJECT_LAYOUT_FAVOURITE_BTN_RIGHT_PADDING 0;
+                       }
+               )
+
                E_PART_SWALLOW("swallow.favourite.btn",
                        description { state: "default" 0.0;
                                fixed: 1 0;
                                align: 1 0;
                                rel1 {
                                        relative: 0 1;
-                                       to_x: "padding.right";
+                                       to_x: "favourite_btn.padding.right";
                                        to_y: "favourite_btn.padding.top";
                                }
                                rel2 {
                                        relative: 0 0;
-                                       to_x: "padding.right";
+                                       to_x: "favourite_btn.padding.right";
                                        to_y: "padding.bottom";
                                }
-                               min: SUBJECT_LAYOUT_FAVOURITE_BTN_INNER_SIZE SUBJECT_LAYOUT_FAVOURITE_BTN_INNER_SIZE;
+                               min: SUBJECT_LAYOUT_FAVOURITE_BTN_SIZE SUBJECT_LAYOUT_FAVOURITE_BTN_SIZE;
+                               max: SUBJECT_LAYOUT_FAVOURITE_BTN_SIZE SUBJECT_LAYOUT_FAVOURITE_BTN_SIZE;
                        }
                )
 
@@ -192,7 +201,7 @@ group {
                                        relative: 0 1;
                                        to_x: "swallow.favourite.btn";
                                }
-                               min: SUBJECT_LAYOUT_FAVOURITE_BTN_RIGHT_PADDING 0;
+                               min: SUBJECT_LAYOUT_FAVOURITE_BTN_LEFT_PADDING 0;
                        }
                )
 
@@ -347,72 +356,6 @@ group {
        }
 }
 
-#define PROG1 \
-               programs { \
-                       program { name: "clicked"; \
-                               signal: "mouse,clicked,1"; \
-                               source: "bg"; \
-                               action: SIGNAL_EMIT "clicked" "edje"; \
-                               after: "touch_snd"; \
-                       } \
-                       program { name: "pressed"; \
-                               signal: "mouse,down,1"; \
-                               source: "bg"; \
-                               script { \
-                                       set_state(PART:"icon", "pressed", 0.0); \
-                               } \
-                       } \
-                       program { name: "unpressed"; \
-                               signal: "mouse,up,1"; \
-                               source: "bg"; \
-                               script { \
-                                       set_state(PART:"icon", "default", 0.0); \
-                               } \
-                       } \
-                       program { name: "touch_snd"; \
-                               action: RUN_PLUGIN "touch_sound"; \
-                       } \
-               }
-
-#define PROG2 \
-               programs { \
-                       program { name: "clicked"; \
-                               signal: "mouse,clicked,1"; \
-                               source: "bg"; \
-                               action: SIGNAL_EMIT "clicked" "edje"; \
-                               after: "touch_snd"; \
-                       } \
-                       program { name: "touch_snd"; \
-                               action: RUN_PLUGIN "touch_sound"; \
-                       } \
-               }
-#define PROG3 \
-               programs { \
-                       program { name: "clicked"; \
-                               signal: "mouse,clicked,1"; \
-                               source: "bg"; \
-                               action: SIGNAL_EMIT "clicked" "edje"; \
-                               after: "touch_snd"; \
-                       } \
-                       program { name: "pressed"; \
-                               signal: "mouse,down,1"; \
-                               source: "bg"; \
-                               script { \
-                                       set_state(PART:"btn_text", "pressed", 0.0); \
-                               } \
-                       } \
-                       program { name: "unpressed"; \
-                               signal: "mouse,up,1"; \
-                               source: "bg"; \
-                               script { \
-                                       set_state(PART:"btn_text", "default", 0.0); \
-                               } \
-                       } \
-                       program { name: "touch_snd"; \
-                               action: RUN_PLUGIN "touch_sound"; \
-                       } \
-               }
-
 #define BODY_BUTTON_STYLE(_name, _color) \
        style { \
                name: _name; \
@@ -548,49 +491,5 @@ group { name: "elm/button/base/body_button";
        }
 }
 
-#define ICON_BUTTON(NAME, IMG, PAD_L, PAD_T, WIDTH, HEIGHT, COLOR, PROG) \
-       group { name: NAME; \
-               images { image: IMG COMP; } \
-               parts { \
-                       part { name: "bg"; \
-                               type: RECT; \
-                               scale: 1; \
-                               mouse_events: 1; \
-                               description { \
-                                       state: "default" 0.0; \
-                                       color: 0 0 0 0; \
-                               } \
-                       } \
-                       part { name: "pad_l_t"; \
-                               type: SPACER; \
-                               scale: 1; \
-                               description { \
-                                       state: "default" 0.0; \
-                                       min: PAD_L PAD_T; fixed: 1 1; \
-                                       rel2.relative: 0 0; \
-                                       align: 0 0; \
-                               } \
-                       } \
-                       part { name: "icon"; \
-                               type: IMAGE; \
-                               scale: 1; \
-                               repeat_events: 1; \
-                               description { \
-                                       state: "default" 0.0; \
-                                       image.normal: IMG; \
-                                       color: COLOR; \
-                                       min: WIDTH HEIGHT; max: WIDTH HEIGHT; \
-                                       fixed: 1 1; align: 0 0; \
-                                       rel1 { relative: 1 1; to: "pad_l_t"; } \
-                               } \
-                               description { \
-                                       state: "pressed" 0.0; \
-                                       inherit: "default" 0.0; \
-                               } \
-                       } \
-               } \
-               PROG\
-       }
-
-ICON_BUTTON("elm/layout/flag.none.icon/default", "list_icon/index_icon_favorite_off.png", 0, 0, 50, 50, AO003, PROG2)
-ICON_BUTTON("elm/layout/flag.star.icon/default", "list_icon/index_icon_favorite_on.png", 0, 0, 50, 50, AO003, PROG2)
+FLAT_SQUARE_BTN_STYLE("ev.favourite_on", "viewer_icon/email_icon_favorite_on.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80, 0.7, 1.0);
+FLAT_SQUARE_BTN_STYLE("ev.favourite_off", "viewer_icon/email_icon_favorite_off.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80, 0.7, 1.0);
\ No newline at end of file
index 00efa79..2479433 100644 (file)
                                        if(ld) {\
                                                switch(flag_type) { \
                                                        case EMAIL_FLAG_NONE:\
-                                                       elm_check_state_set(ld->check_favorite_btn, EINA_FALSE); \
+                                                       elm_object_style_set(ld->check_favorite_btn, "email.flat.square.mbox.favourite_off"); \
                                                        break;\
                                                        case EMAIL_FLAG_FLAGED:\
-                                                       elm_check_state_set(ld->check_favorite_btn, EINA_TRUE); \
+                                                       elm_object_style_set(ld->check_favorite_btn, "email.flat.square.mbox.favourite_on"); \
                                                        break;\
                                                } \
                                                break;\
index 97c1615..4950d44 100644 (file)
@@ -291,7 +291,6 @@ struct _view_data {
 
        AddRemainingMailReqData *remaining_req;
 
-       EmailMailboxCheckCache star_check_cache;
        EmailMailboxCheckCache select_check_cache;
 
        Eina_List *folders_names_cache;
index 573b043..1ed3c47 100644 (file)
@@ -79,7 +79,7 @@ static char *_mail_item_gl_sender_text_add(MailItemData *ld);
 static char *_mail_item_gl_time_stamp_text_add(MailItemData *ld);
 static Evas_Object *_mail_item_gl_attach_icon_add(Evas_Object *parent, MailItemData *ld);
 static Evas_Object *_mail_item_gl_status_icons_add(Evas_Object *parent, MailItemData *ld);
-static Evas_Object *_mail_item_gl_star_checkbox_add(Evas_Object *parent, MailItemData *ld);
+static Evas_Object *_mail_item_gl_star_btn_add(Evas_Object *parent, MailItemData *ld);
 static Evas_Object *_mail_item_gl_select_checkbox_add(Evas_Object *parent, MailItemData *ld);
 static Evas_Object *_mail_item_gl_account_colorbar_add(Evas_Object *parent, MailItemData *ld);
 static void _mail_item_gl_text_style_set(MailItemData *ld);
@@ -91,7 +91,7 @@ static void _mail_item_important_status_changed_cb(void *data, Evas_Object *obj,
 static void _mail_item_data_insert_search_tag(char *dest, int dest_len, const char *src, const char *key);
 static void _mail_item_data_list_free(GList **mail_item_data_list);
 
-static void _mailbox_star_ly_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _mailbox_star_btn_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _mailbox_select_checkbox_ly_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
 /* insert mail item data into list */
@@ -209,7 +209,6 @@ static void _mailbox_gl_free_cb(void *data, Evas *e, Evas_Object *o, void *info)
 {
        EmailMailboxView *view = data;
 
-       _mailbox_check_cache_free(&view->star_check_cache);
        _mailbox_check_cache_free(&view->select_check_cache);
 }
 
@@ -255,36 +254,32 @@ static Evas_Object *_mail_item_gl_select_checkbox_add(Evas_Object *parent, MailI
 
 }
 
-static Evas_Object *_mail_item_gl_star_checkbox_add(Evas_Object *parent, MailItemData *ld)
+static Evas_Object *_mail_item_gl_star_btn_add(Evas_Object *parent, MailItemData *ld)
 {
        retvm_if(!ld, NULL,  "ld is NULL");
        retvm_if(!parent, NULL,  "parent is NULL");
 
-       Evas_Object *star_ly = elm_layout_add(parent);
-       evas_object_size_hint_weight_set(star_ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_layout_file_set(star_ly, email_get_mailbox_theme_path(), "email/layout/star.icon");
+       Evas_Object *star_btn = elm_button_add(parent);
+       evas_object_repeat_events_set(star_btn, EINA_FALSE);
+       evas_object_propagate_events_set(star_btn, EINA_FALSE);
 
-       Evas_Object *star_checkbox = _mailbox_check_cache_get_obj(&ld->view->star_check_cache, parent);
-
-       if (ld->flag_type == EMAIL_FLAG_FLAGED) {
-               elm_check_state_set(star_checkbox, EINA_TRUE);
+       if (ld->flag_type == EMAIL_FLAG_NONE) {
+               elm_object_style_set(star_btn, "email.flat.square.mbox.favourite_off");
        } else {
-               elm_check_state_set(star_checkbox, EINA_FALSE);
+               elm_object_style_set(star_btn, "email.flat.square.mbox.favourite_on");
        }
 
        if (!ld->view->b_editmode) {
-               evas_object_freeze_events_set(star_checkbox, EINA_FALSE);
-               evas_object_smart_callback_add(star_checkbox, "changed", _mail_item_important_status_changed_cb, ld);
+               evas_object_freeze_events_set(star_btn, EINA_FALSE);
+               evas_object_smart_callback_add(star_btn, "clicked", _mail_item_important_status_changed_cb, ld);
        } else {
-               evas_object_freeze_events_set(star_checkbox, EINA_TRUE);
+               evas_object_freeze_events_set(star_btn, EINA_TRUE);
        }
 
-       ld->check_favorite_btn = star_checkbox;
-       elm_layout_content_set(star_ly, "elm.swallow.content", star_checkbox);
-
-       evas_object_event_callback_add(star_ly, EVAS_CALLBACK_DEL, _mailbox_star_ly_del_cb, ld);
+       ld->check_favorite_btn = star_btn;
+       evas_object_event_callback_add(star_btn, EVAS_CALLBACK_DEL, _mailbox_star_btn_del_cb, ld);
 
-       return star_ly;
+       return star_btn;
 }
 
 static Evas_Object *_mail_item_gl_status_icons_add(Evas_Object *parent, MailItemData *ld)
@@ -445,7 +440,7 @@ static Evas_Object *_mail_item_gl_content_get(void *data, Evas_Object *obj, cons
        }
 
        if (!strcmp(part, "email.star.icon") && (ld->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX && ld->mailbox_type != EMAIL_MAILBOX_TYPE_DRAFT)) {
-               return _mail_item_gl_star_checkbox_add(obj, ld);
+               return _mail_item_gl_star_btn_add(obj, ld);
        }
 
        if (!strcmp(part, "email.status.icon") && (ld->reply_flag || ld->forward_flag ||  (ld->is_priority_sender_mail &&  (view->mode == EMAIL_MAILBOX_MODE_ALL
@@ -601,23 +596,24 @@ static void _mail_item_important_status_changed_cb(void *data, Evas_Object *obj,
        debug_enter();
 
        MailItemData *ld = (MailItemData *)data;
-       int count = 0;
+       int count = 1;
        retm_if(!ld, "ld is NULL");
        retm_if(!ld->check_favorite_btn, "ld->check_favorite_btn is NULL");
 
-       if (email_dpm_is_policy_not_allowed(EMAIL_DPM_POLICY_POPIMAP)) {
-               if (ld->flag_type == EMAIL_FLAG_FLAGED) {
-                       elm_check_state_set(ld->check_favorite_btn, EINA_TRUE);
-                       common_util_show_dpm_error_popup("IDS_EMAIL_OPT_UNMARK_AS_FAVOURITES_ABB");
-               } else {
-                       elm_check_state_set(ld->check_favorite_btn, EINA_FALSE);
-                       common_util_show_dpm_error_popup("IDS_EMAIL_OPT_MARK_AS_FAVOURITES_ABB");
-               }
+       if (email_dpm_show_policy_not_allowed_error(EMAIL_DPM_POLICY_POPIMAP,
+                       (ld->flag_type == EMAIL_FLAG_FLAGED) ? "IDS_EMAIL_OPT_MARK_AS_UNREAD_ABB" : "IDS_EMAIL_OPT_MARK_AS_FAVOURITES_ABB")) {
                return;
        }
 
        int mail_id = (int)ld->mail_id;
-       email_engine_set_flags_field(ld->account_id, &mail_id, count, EMAIL_FLAGS_FLAGGED_FIELD, ld->flag_type ? 0 : 1, true);
+       int res = email_engine_set_flags_field(ld->account_id, &mail_id, count, EMAIL_FLAGS_FLAGGED_FIELD, ld->flag_type ? 0 : 1, true);
+
+       if (res) {
+               int new_flag_val = ((ld->flag_type == EMAIL_FLAG_FLAGED) ? EMAIL_FLAG_NONE : EMAIL_FLAG_FLAGED);
+               MAILBOX_UPDATE_GENLIST_ITEM_FLAG_STATE(ld->view->gl, ld->base.item, new_flag_val);
+       } else {
+               notification_status_message_post(_("IDS_EMAIL_HEADER_UNABLE_TO_PERFORM_ACTION_ABB"));
+       }
 }
 
 /* dest_len is max str len of dest (not including \0)*/
@@ -673,14 +669,9 @@ static void _mail_item_data_list_free(GList **mail_item_data_list)
        *mail_item_data_list = NULL;
 }
 
-static void _mailbox_star_ly_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _mailbox_star_btn_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        MailItemData *ld = data;
-
-       evas_object_smart_callback_del(ld->check_favorite_btn, "changed", _mail_item_important_status_changed_cb);
-
-       _mailbox_check_cache_release_obj(&ld->view->star_check_cache, ld->check_favorite_btn);
-
        ld->check_favorite_btn = NULL;
 }
 
@@ -2245,11 +2236,6 @@ void mailbox_list_create_view(EmailMailboxView *view)
        }
 
        Evas_Object *gl = elm_genlist_add(view->content_layout);
-       if (view->theme) {
-               elm_object_theme_set(gl, view->theme);
-       }
-
-       debug_log("genlist = %p", gl);
        evas_object_smart_callback_add(gl, "realized", _realized_item_cb, view);
        evas_object_smart_callback_add(gl, "unhighlighted", _realized_item_cb, view);
        evas_object_smart_callback_add(gl, "highlighted", _pressed_item_cb, view);
@@ -2269,7 +2255,6 @@ void mailbox_list_create_view(EmailMailboxView *view)
        view->selected_group_list = eina_list_free(view->selected_group_list);
        mailbox_refresh_flicks_cb_register(view);
 
-       _mailbox_check_cache_init(&view->star_check_cache, "favorite");
        _mailbox_check_cache_init(&view->select_check_cache, "default");
 
        evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_DOWN, mailbox_set_main_thread_busy_cb, NULL);
index 888b82f..4c55d93 100644 (file)
@@ -78,6 +78,9 @@ static void _mailbox_on_back_key(email_view_t *self);
 static int _mailbox_initialize(EmailMailboxView *view);
 static void _mailbox_finalize(EmailMailboxView *view);
 
+static void _mailbox_initialize_theme(EmailMailboxView *view);
+static void _mailbox_deinitialize_theme(EmailMailboxView *view);
+
 static email_run_type_e _mailbox_params_get_run_type(email_params_h params);
 static int _mailbox_params_get_account_id(email_params_h params);
 static int _mailbox_params_get_mail_id(email_params_h params);
@@ -360,6 +363,9 @@ static int _mailbox_create(email_view_t *self)
                return -1;
        }
 
+       /*Initialize theme*/
+       _mailbox_initialize_theme(view);
+
        ret = _mailbox_push_base_view_layout(view);
        retvm_if(ret != 0, -1, "_mailbox_push_base_view_layout() failed! ret: [%d]", ret);
 
@@ -484,8 +490,9 @@ static int _mailbox_initialize(EmailMailboxView *view)
                }
        }
 
-       if (account_list)
+       if (account_list) {
                email_engine_free_account_list(&account_list, account_count);
+       }
 
        mailbox_view_title_update_all(view);
        mailbox_list_refresh(view, NULL);
@@ -501,6 +508,30 @@ static int _mailbox_initialize(EmailMailboxView *view)
        return 0;
 }
 
+static void _mailbox_initialize_theme(EmailMailboxView *view)
+{
+       debug_enter();
+       retm_if(!view, "Invalid parameter, view is NULL");
+
+       view->theme = elm_theme_new();
+       elm_theme_ref_set(view->theme, NULL);
+       elm_theme_extension_add(view->theme, email_get_mailbox_theme_path());
+
+       debug_leave();
+}
+
+static void _mailbox_deinitialize_theme(EmailMailboxView *view)
+{
+       debug_enter();
+       retm_if(!view, "Invalid parameter, view is NULL");
+
+       elm_theme_extension_del(view->theme, email_get_mailbox_theme_path());
+       elm_theme_free(view->theme);
+       view->theme = NULL;
+
+       debug_leave();
+}
+
 static void _mailbox_activate(email_view_t *self, email_view_state prev_state)
 {
        debug_enter();
@@ -680,8 +711,7 @@ static void _mailbox_finalize(EmailMailboxView *view)
                debug_error("email_unset_vip_rule_change_callback failed. err = %d", res);
        }
 
-       elm_theme_extension_del(view->theme, email_get_mailbox_theme_path());
-       elm_theme_free(view->theme);
+       _mailbox_deinitialize_theme(view);
 
        mailbox_list_system_settings_callback_unregister();
 
@@ -1043,11 +1073,6 @@ static void _mailbox_create_view(EmailMailboxView *view)
 {
        debug_enter();
 
-       /*load theme*/
-       view->theme = elm_theme_new();
-       elm_theme_ref_set(view->theme, NULL); /* refer to default theme(NULL) */
-       elm_theme_extension_add(view->theme, email_get_mailbox_theme_path()); /* add extension to the new theme */
-
        /*base content*/
        view->content_layout = elm_layout_add(view->base.content);
        evas_object_size_hint_weight_set(view->content_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1124,6 +1149,9 @@ static int _mailbox_push_base_view_layout(EmailMailboxView *view)
        view->base.content = elm_layout_add(view->base.module->navi);
        elm_layout_theme_set(view->base.content, "layout", "application", "default");
        evas_object_size_hint_weight_set(view->base.content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       if (view->theme) {
+               elm_object_theme_set(view->base.content, view->theme);
+       }
        evas_object_show(view->base.content);
        email_module_view_push(&view->base, NULL, EVPF_NO_BACK_BUTTON | EVPF_NO_TITLE);
 
index 370c3bc..08dda39 100644 (file)
@@ -96,7 +96,6 @@ static void _header_create_subject_layout(EmailViewerView *view)
 
        if ((view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (view->viewer_type == EMAIL_VIEWER)) {
                view->favourite_btn = elm_button_add(view->subject_ly);
-               elm_object_style_set(view->favourite_btn, "transparent");
                evas_object_smart_callback_add(view->favourite_btn, "clicked", _header_favorite_clicked_cb, view);
                elm_object_part_content_set(view->subject_ly, "swallow.favourite.btn", view->favourite_btn);
        }
@@ -651,17 +650,14 @@ void header_update_favorite_icon(EmailViewerView *view)
        retm_if(!view, "Invalid parameter: view[NULL]");
        retm_if(!view->favourite_btn, "Invalid parameter: favourite_btn[NULL]");
 
-       Evas_Object *start_icon = elm_layout_add(view->favourite_btn);
-       debug_log("favorite: %d", view->favorite);
        switch (view->favorite) {
                case EMAIL_FLAG_NONE:
-                       elm_layout_file_set(start_icon, email_get_viewer_theme_path(), "elm/layout/flag.none.icon/default");
+                       elm_object_style_set(view->favourite_btn, "email.flat.square.ev.favourite_off");
                        break;
                case EMAIL_FLAG_FLAGED:
-                       elm_layout_file_set(start_icon, email_get_viewer_theme_path(), "elm/layout/flag.star.icon/default");
+                       elm_object_style_set(view->favourite_btn, "email.flat.square.ev.favourite_on");
                        break;
        }
-       elm_object_content_set(view->favourite_btn, start_icon);
 }
 
 void header_update_subject_text(EmailViewerView *view)
index 9c0ac8a..fe5ea9d 100644 (file)
@@ -1419,7 +1419,6 @@ static void _viewer_initialize_theme(EmailViewerView *view)
        elm_theme_extension_add(view->theme, email_get_viewer_theme_path());
 
        debug_leave();
-
 }
 
 static void _viewer_deinitialize_theme(EmailViewerView *view)
@@ -1432,7 +1431,6 @@ static void _viewer_deinitialize_theme(EmailViewerView *view)
        view->theme = NULL;
 
        debug_leave();
-
 }
 
 static void _destroy_viewer(EmailViewerView *view)
index 543569e..8fa22e7 100644 (file)
  */
 
 collections {
-       plugins {
-               plugin {
-                       name: "touch_sound";// Name run by RUN_PLUGIN
-                       source: "feedback";// External edje plugin name
-                       param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_TAP";
-               }
-       }
        base_scale: 2.6;
        #include "../../edc/common/email-colors.edc"
        #include "../../edc/common/email-parts.edc"
+       #include "../../edc/common/email-flat-buttons.edc"
        #include "../../edc/mailbox/email-mailbox-macros.edc"
        #include "../../edc/mailbox/email-mailbox-theme.edc"
        #include "../../edc/mailbox/email-mailbox-genlist-style.edc"
        #include "../../edc/mailbox/email-mailbox-server-search.edc"
        #include "../../edc/mailbox/email-mailbox-search-entry.edc"
-}
\ No newline at end of file
+}