fix N_SE-17540, update subject font size issue
authorSoonmin Jung <sm0415.jung@samsung.com>
Thu, 27 Dec 2012 07:03:42 +0000 (16:03 +0900)
committerSoonmin Jung <sm0415.jung@samsung.com>
Thu, 27 Dec 2012 07:03:42 +0000 (16:03 +0900)
Change-Id: I8ccfed8e8d1b19a1c9afbcbcab75cffd8070831d

composer/include/msg-ui-composer-common.h
composer/include/msg-ui-composer-data.h
composer/include/msg-ui-composer-subject.h
composer/src/external/msg-ui-composer-external.c
composer/src/gadget/msg-ui-composer-gadget.c
composer/src/ui-composer/msg-ui-composer-common.c
composer/src/ui-composer/msg-ui-composer-main.c
composer/src/ui-composer/msg-ui-composer-subject.c

index c6dfaa9..e60a11f 100755 (executable)
@@ -77,6 +77,6 @@ int msg_ui_composer_get_keypad_height(Evas_Object *entry);
 void msg_ui_composer_change_body_scroll_size(MSG_COMPOSER_VIEW_DATA_S *cd, int keypad_height);
 void msg_ui_composer_make_default_body_size(MSG_COMPOSER_VIEW_DATA_S *cd);
 
-void msg_ui_composer_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd);
+void msg_ui_composer_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd, bool update_subject);
 
 #endif/*__MSG_COMPOSER_COMMON_H__*/
index 5315e39..3e35ae6 100755 (executable)
@@ -122,7 +122,8 @@ typedef long long int64;
 #define MSGC_POPUP_GENLIST_H 128
 #define MSGC_POPUP_LIST_H 112
 
-#define MSGC_BODY_FONT_SIZE 32
+#define MSGC_BODY_FONT_SIZE 36
+#define MSGC_SUBJECT_FONT_SIZE 32
 
 /*********************
  * enum types
index 9a92620..50e0107 100755 (executable)
@@ -28,5 +28,6 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_subject_clear(MSG_COMPOSER_VIEW_DATA_S *c
 COMPOSER_RETURN_TYPE_E msg_ui_composer_read_subject(MSG_COMPOSER_VIEW_DATA_S *cd);
 COMPOSER_RETURN_TYPE_E msg_ui_composer_subject_set_loaded_data(void *data, const char *subject);
 COMPOSER_RETURN_TYPE_E msg_ui_composer_remove_subject_layout(MSG_COMPOSER_VIEW_DATA_S *cd);
+void msg_ui_composer_subject_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd, const char *font_sytle);
 
 #endif /*__MSG_UI_COMPOSER_SUBJECT_H_*/
index 11c8a29..c621c16 100755 (executable)
@@ -612,7 +612,7 @@ static void __ug_closed_cb(ui_gadget_h ug, void *priv)
        }
 
        msg_common_apply_font_size("bubble", cd->content_layout);
-       msg_ui_composer_apply_font_size(cd);
+       msg_ui_composer_apply_font_size(cd, true);
 
        msg_ui_composer_connect_handler(cd);
 
index 75beab9..4e1b589 100755 (executable)
@@ -185,7 +185,7 @@ static void __msg_ui_composer_on_start(ui_gadget_h ug, service_h data, void *pri
        msg_ui_composer_start(cd, data);
 
        msg_common_apply_font_size("bubble", cd->content_layout);
-       msg_ui_composer_apply_font_size(cd);
+       msg_ui_composer_apply_font_size(cd, true);
 
        D_LEAVE;
 }
@@ -218,7 +218,7 @@ static void __msg_ui_composer_on_resume(ui_gadget_h ug, service_h data, void *pr
        if (!cd->loaded_ug)
                msg_common_apply_font_size("bubble", cd->content_layout);
 
-       msg_ui_composer_apply_font_size(cd);
+       msg_ui_composer_apply_font_size(cd, true);
 
        /* coonect volume key handler */
        msg_ui_composer_connect_handler(cd);
index f8535b1..ec76352 100755 (executable)
@@ -1348,7 +1348,7 @@ void msg_ui_composer_entry_imf_state_cb(void * data, Ecore_IMF_Context *ctx, int
        D_LEAVE;
 }
 
-void msg_ui_composer_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd)
+void msg_ui_composer_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd, bool update_subject)
 {
        D_ENTER;
        D_MSG_RETM_IF(cd == NULL, "Composer Data is Invalid");
@@ -1381,6 +1381,30 @@ void msg_ui_composer_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd)
        msg_ui_composer_recipient_apply_font_size(cd, font_style_str);
        msg_ui_composer_body_apply_font_size(cd, font_style_str);
 
+       if (update_subject) {
+               int access_font_index = 0;
+               /* get accessibility font index */
+               if (vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &access_font_index) < 0) {
+                       D_EMSG("vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE) is failed !!");
+                       access_font_index = MSG_SYS_FONT_SIZE_INDEX_NORMAL;     /* 1 */
+               }
+
+               font_size = msg_common_get_font_size_from_index(access_font_index);
+               if (font_size == -1) {
+                       D_EMSG("msg_common_get_font_size_from_index() is failed !!");
+                       return;
+               }
+
+               converted_size = (MSGC_SUBJECT_FONT_SIZE * font_size) / MSG_APP_FONT_SIZE_NORMAL;
+
+               /* apply font size */
+               memset(font_style_str, 0, sizeof(font_style_str));
+               snprintf(font_style_str, sizeof(font_style_str), "DEFAULT='font_size=%d'", converted_size);
+               D_MSG("subject font_style_str = (%s)", font_style_str);
+
+               msg_ui_composer_subject_apply_font_size(cd, font_style_str);
+       }
+
        D_LEAVE;
 }
 
index 63ab32e..c8a4faa 100755 (executable)
@@ -1870,7 +1870,7 @@ static Eina_Bool __msgc_up_key_long_press_cb(void *data)
        if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
                msg_common_apply_font_size("bubble", cd->content_layout);
 
-       msg_ui_composer_apply_font_size(cd);
+       msg_ui_composer_apply_font_size(cd, false);
 
        return EINA_TRUE;
 }
@@ -1890,7 +1890,7 @@ static Eina_Bool __msgc_down_key_long_press_cb(void *data)
        if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
                msg_common_apply_font_size("bubble", cd->content_layout);
 
-       msg_ui_composer_apply_font_size(cd);
+       msg_ui_composer_apply_font_size(cd, false);
 
        return EINA_TRUE;
 }
@@ -1952,7 +1952,7 @@ Eina_Bool msg_ui_composer_key_press_cb(void *data, int type, void *event)
                        if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
                                msg_common_apply_font_size("bubble", cd->content_layout);
 
-                       msg_ui_composer_apply_font_size(cd);
+                       msg_ui_composer_apply_font_size(cd, false);
 
                        cd->vol_up_key_longpress = ecore_timer_add(0.1, (Ecore_Task_Cb) __msgc_up_key_long_press_cb, (void *)cd);
                } else if (!g_strcmp0(ev->keyname, KEY_VOLUMEDOWN)) {   /* KEY_VOLUMEDOWN */
@@ -1964,7 +1964,7 @@ Eina_Bool msg_ui_composer_key_press_cb(void *data, int type, void *event)
                        if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
                                msg_common_apply_font_size("bubble", cd->content_layout);
 
-                       msg_ui_composer_apply_font_size(cd);
+                       msg_ui_composer_apply_font_size(cd, false);
 
                        cd->vol_down_key_longpress = ecore_timer_add(0.1, (Ecore_Task_Cb) __msgc_down_key_long_press_cb, (void *)cd);
                } else {
index 169d374..cab8a9d 100755 (executable)
@@ -343,7 +343,9 @@ Evas_Object *msg_ui_composer_create_subject_entry(Evas_Object *parent, MSG_COMPO
        evas_object_size_hint_weight_set(entry, 0.0, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(entry, 0.0, EVAS_HINT_FILL);
        /* fix font size */
-       elm_entry_text_style_user_push(entry, "DEFAULT='font_size=32'");
+       char font_style[DEF_BUF_LEN_S + 1] = {0,};
+       snprintf(font_style, sizeof(font_style), "DEFAULT='font_size=%d'", MSGC_SUBJECT_FONT_SIZE);
+       elm_entry_text_style_user_push(entry, font_style);
 
        evas_object_show(entry);
 
@@ -448,3 +450,18 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_add_subject(MSG_COMPOSER_VIEW_DATA_S *cd)
        return COMPOSER_RETURN_SUCCESS;
 }
 
+void msg_ui_composer_subject_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd, const char *font_sytle)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(font_sytle == NULL, "font_sytle is NULL");
+
+       Evas_Object *entry = cd->sub_data.entry;
+
+       if (cd->isSubject && entry) {
+               elm_entry_text_style_user_push(entry, font_sytle);
+       }
+
+       D_LEAVE;
+}
+