From cfd93db3e9c4586ccd37678a0a008da35fdd3ef6 Mon Sep 17 00:00:00 2001 From: Dmytro Dragan Date: Tue, 31 May 2016 16:23:55 +0300 Subject: [PATCH] TSAM-4217 Image scale bug fixed Change-Id: Ia7fae9a3c7023a2258d27e6cce17b28dbf146388 Signed-off-by: Dmytro Dragan --- res/edje/msg_body.edc | 1271 +++++++++++--------- .../Body/View/src/ImagePageViewItem.cpp | 13 +- 2 files changed, 700 insertions(+), 584 deletions(-) diff --git a/res/edje/msg_body.edc b/res/edje/msg_body.edc index f2cc920..a427170 100644 --- a/res/edje/msg_body.edc +++ b/res/edje/msg_body.edc @@ -1,589 +1,704 @@ #include "macros.inl" - #define COLOR_BLUE_EDC 2 61 132 255 #define BODY_MEDIA_LABEL_H 28 #define PAGE_DIVIDER_H 30 #define IMG_BODY_INPUT_FIELD "00_search_edit_field_bg.#.png" - #define MSGC_IMAGE_THUMB_LANDSCAPE_W 132 /* landscape mode */ #define MSGC_IMAGE_THUMB_LANDSCAPE_H 75 /* landscape mode */ #define MSGC_IMAGE_THUMB_PORTRAIT_W 80 /* portrait mode */ #define MSGC_IMAGE_THUMB_PORTRAIT_H 142 /* portrait mode */ #define MSGC_IMAGE_THUMB_EQUAL_H 110 /* portrait mode */ - collections { - - base_scale: 1.8; - - group { - images { - image: dotted_line_divider.png COMP; - } - name: "conv/body/page_divider"; - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - repeat_events: 1; - description { - state: "default" 0.0; - min: 0 PAGE_DIVIDER_H; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - align: 0.0 0.5; - } - } - PADDING_LEFT("padding_left", 5); // this is modified to stand in line with bottom line of entry - PADDING_RIGHT("padding_right", 0); - part { - name: "line"; - type: IMAGE; - scale: 1; - mouse_events: 0; - repeat_events: 0; - description { - state: "default" 0.0; - fixed: 0 1; - min: 0 1; - align: 0.5 0.5; - rel1 { to_x: "padding_left"; relative: 1.0 0.5; } - rel2 { to_x: "padding.divider_line"; relative: 0.0 0.5; } - visible: 1; - image.normal: dotted_line_divider.png; - - fill { - type: TILE; - } - } - } - part { - name: "padding.divider_line"; - type: SPACER; - scale: 1; - description { - state: "default" 0.0; - min: 8 PAGE_DIVIDER_H; - rel1 { to_x: "text.page_info"; relative: 0.0 0.0; } - rel2 { to_x: "text.page_info"; relative: 0.0 1.0; } - } - } - part { - name: "text.page_info"; - type: TEXT; - scale: 1; - description { - state: "default" 0.0; - align: 1.0 0.5; - text { - font: FONT_STYLE_BOLD; - text_class: FONT_TEXT_CLASS_BOLD; - size: 21; - align: 1.0 0.5; - min: 1 1; - ellipsis: -1; - } - color: COLOR_BLUE_EDC; - rel1 { to_x : "padding_right"; relative: 0.0 0.0; } - rel2 { to_x : "padding_right"; relative: 0.0 1.0; } - } - } - } - } - - group { - name: "conv/body/page"; //text input field - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - mouse_events: 0; - description { - state: "default" 0.0; - min: 0 20; - } - } - PADDING_LEFT("padding_left", 0); - PADDING_RIGHT("padding_right", 0); - PADDING_BOTTOM("padding_bottom", 0); - part { - name: "swl.page"; - type: SWALLOW; - scale:1; - description { - state: "default" 0.0; - min: 0 0; - fixed: 1 0; - rel1 { to: "padding_left"; relative: 1.0 0.0; } - rel2 { to_x: "padding_right"; to_y: "padding_bottom"; relative: 0.0 0.0; } - } - } - } - } - - group { - name: "conv/body/item_lyaout"; - parts { - part { - name: "rect"; - type: RECT; //It should be a RECT in oder to emit clicked signal - scale: 1; - mouse_events: 1; - description { - state: "default" 0.0; - min: 0 40; - color: 0 0 0 0; - } - } - PADDING_TOP("padding_top", 2); - PADDING_RIGHT("padding_right", 0); - part { - name: "padding_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { - state: "default" 0.0; - min: 0 0; - fixed: 0 1; - visible: 0; - color: 0 0 0 0; - rel1 { relative: 0.0 1.0; } - rel2 { relative: 1.0 1.0; } - align: 0.0 1.0; - } - description { //Padding increased for text entry not to come under character count. - state: "easy.mode" 0.0; - min: 0 32; - fixed: 0 1; - visible: 0; - color: 0 0 0 0; - rel1 { relative: 0.0 1.0; } - rel2 { relative: 1.0 1.0; } - align: 0.0 1.0; - } - } - part { - name: "swl.content"; - type: SWALLOW; - scale:1; - description { - state: "default" 0.0; - fixed: 1 0; - rel1 { to_y: "padding_top"; relative: 0.0 1.0; } - rel2 { to_x: "padding_right"; to_y: "padding_bottom"; relative: 0.0 0.0; } - align: 0.0 1.0; - } - } - } - programs { - program { - name: "page_layout_clicked"; - source: "rect"; - signal: "mouse,clicked,1"; - action: SIGNAL_EMIT "page_layout,clicked" ""; - } - program { - name: "show.easy.mode"; - signal: "show.easy.mode"; - source: "*"; - action: STATE_SET "easy.mode" 0.0; - target: "padding_bottom"; - } - program { - name: "show.normal.mode"; - signal: "show.normal.mode"; - source: "*"; - action: STATE_SET "default.mode" 0.0; - target: "padding_bottom"; - } - } - } - - group { - name: "conv/body/media_main"; - parts { - //If "rect.image" is not existed, then width of sound layout is not shown correctly. - part { - name: "bg"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - max: -1 110; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - align: 0.0 0.0; - } - description { - state: "image" 0.0; /* default state of image is landscape */ - max: MSGC_IMAGE_THUMB_LANDSCAPE_W MSGC_IMAGE_THUMB_LANDSCAPE_H; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - align: 0.0 0.0; - } - description { - state: "image.portrait" 0.0; - max: MSGC_IMAGE_THUMB_PORTRAIT_W MSGC_IMAGE_THUMB_PORTRAIT_H; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - align: 0.0 0.0; - } - description { - state: "image.equal" 0.0; /* in case of equal we set bg 110 110 */ - max: MSGC_IMAGE_THUMB_EQUAL_H MSGC_IMAGE_THUMB_EQUAL_H; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - align: 0.0 0.0; - } - } - - part { - name: "swl.content"; - type: SWALLOW; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - fixed: 0 0; - rel1.to: "bg"; - rel2.to: "bg"; - align: 0.0 0.0; - } - } - } - programs { - program { - name: "media.sound"; - signal: "media.sound"; - source: "*"; - } - program { - name: "media.image.landscape"; - signal: "media.image.landscape"; - source: "*"; - action: STATE_SET "image" 0.0; - target: "bg"; - } - program { - name: "media.image.portrait"; - signal: "media.image.portrait"; - source: "*"; - action: STATE_SET "image.portrait" 0.0; - target: "bg"; - } - program { - name: "media.image.equal"; - signal: "media.image.equal"; - source: "*"; - action: STATE_SET "image.equal" 0.0; - target: "bg"; - } - program { - name: "item_press"; - signal: "play,press,sound"; - source: "*"; - action: RUN_PLUGIN "touch_sound"; - } - } - } - - group { - name: "conv/body/media_label"; - images { - image: IMG_BODY_INPUT_FIELD COMP; - image: "00_search_edit_field_selected.#.png" COMP; - } - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1{ relative: 0.0 0.0; } - rel2{ relative: 1.0 1.0; } - fixed: 1 1; - align: 0.0 0.0; - } - } - PADDING_TOP("padding_top", 0); - PADDING_LEFT("padding_left", 5); // this is modified to stand in line with bottom line of entry - PADDING_RIGHT("padding_right", 0); - PADDING_BOTTOM("padding_bottom", 0); - part { - name: "rect.bg"; - type: RECT; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - min: 0 BODY_MEDIA_LABEL_H; - rel1{ to_x: "padding_left"; to_y: "padding_top"; relative: 1.0 1.0;} - rel2{ to_x: "padding_right"; to_y: "padding_bottom"; relative: 0.0 0.0;} - align: 0.0 0.0; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { - name: "main.bg"; - type: IMAGE; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - fixed: 0 1; - visible: 0; - rel1 { to: "rect.bg"; } - rel2 { to: "rect.bg"; } - image.normal: IMG_BODY_INPUT_FIELD; - color_class: "W031L1"; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - color_class: "W031L1"; - visible: 1; - } - } - part { - name: "glow"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { to: "main.bg"; } - rel2 { to: "main.bg"; } - image.normal: "00_search_edit_field_selected.#.png"; - color_class: "W031L2"; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: COLOR_BLUE_EDC; - } - } - part { - name: "text.filename"; - type: TEXT; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1 { to_x: "padding_left"; to_y: "padding_top"; relative: 1.0 1.0; offset: 2 0; } - rel2 { to_x: "padding_right"; to_y: "padding_bottom"; relative: 0.0 0.0; offset: -10 0; } - align: 0.0 0.5; - color: COLOR_BLUE_EDC; - text { - font: FONT_STYLE_REGULAR; - text_class: FONT_TEXT_CLASS_REGULAR; - size: 25; - align: 0.0 0.5; - text: ""; - } - } - } - } - programs { - #if 0 //clicked cb from edc is not supported - program { - name: "sound_clicked"; - source: "rect.bg"; - signal: "mouse,clicked,1"; - script { - emit ("sound_clicked", ""); - } - } - #endif - program { - name: "focused"; - signal: "focused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - - if (!strcmp(st, "default")) { - set_state(PART:"glow", "focused", 0.0); - set_state(PART:"main.bg", "focused", 0.0); - set_state(PART:"rect.bg", "focused", 0.0); - } - } - } - program { - name: "unfocused"; - signal: "unfocused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - - if (!strcmp(st, "focused")) { - set_state(PART:"glow", "default", 0.0); - set_state(PART:"main.bg", "default", 0.0); - set_state(PART:"rect.bg", "default", 0.0); - } - } - } - } - } - group { - name: "conv/body/media_image"; - images { - image: "00_video_play.png" COMP; - } - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1{ relative: 0.0 0.0; } - rel2{ relative: 1.0 1.0; } - fixed: 1 1; - align: 0.0 0.0; - } - } - PADDING_TOP("padding_top", 0); - PADDING_LEFT("padding_left", 5); // this is modified to stand in line with bottom line of entry - PADDING_RIGHT("padding_right", 0); - PADDING_BOTTOM("padding_bottom", 0); - - //If "rect.left_padding" is not existed, then height of image layout is not updated correctly. - part { - name: "rect.bg"; - type: RECT; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1{ to_x: "padding_left"; to_y: "padding_top"; relative: 1.0 1.0;} - rel2{ to_x: "padding_right"; to_y: "padding_bottom"; relative: 0.0 0.0;} - align: 0.0 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "focus" 0.0; - inherit: "default" 0.0; - color: COLOR_BLUE_EDC; - visible: 1; - } - } - part { - name: "rect.thumbnail"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - rel1 { to: "rect.bg"; relative: 0.0 0.0; offset: 2 2; } - rel2 { to: "rect.bg"; relative: 1.0 1.0; offset: -3 -3; } - align: 0.0 0.0; - } - } - part { - name: "swl.thumbnail"; - type: SWALLOW; - scale: 1; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - fixed: 0 0; - rel1 { to: "rect.thumbnail"; relative: 0.0 0.0; } - rel2 { to: "rect.thumbnail"; relative: 1.0 1.0; } - align: 0.0 0.0; - } - } - part { - name: "play_button"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - image.normal: "00_video_play.png"; - align: 0.5 0.5; - min: 48 48; - rel1 {to: "swl.thumbnail"; relative: 0.5 0.5; offset: -36 -36;} - rel2 {to: "swl.thumbnail"; relative: 0.5 0.5; offset: 36 36;} - } - description { - state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - #if 0 //clicked cb from edc is not supported - program { - name: "image_clicked"; - source: "rect"; - signal: "mouse,clicked,1"; - script { - emit ("image_clicked", ""); - } - } - #endif - program { - name: "focused"; - signal: "focused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - - if (!strcmp(st, "default")) { - set_state(PART:"rect.bg", "focus", 0.0); - } - } - } - program { - name: "unfocused"; - signal: "unfocused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - - if (!strcmp(st, "focus")) { - set_state(PART:"rect.bg", "default", 0.0); - } - } - } - program { - name: "play_icon_show"; - signal: "play_icon_show"; - source: ""; - action: STATE_SET "show" 0.0; - target: "play_button"; - } - } - } -} + base_scale: 2.6; + group { + images { + image: dotted_line_divider.png COMP; + } + name: "conv/body/page_divider"; + parts { + part { + name: "rect"; + type: SPACER; + scale: 1; + repeat_events: 1; + description { + state: "default" 0.0; + min: 0 PAGE_DIVIDER_H; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 0.0 0.5; + } + } + PADDING_LEFT("padding_left", 5); + // this is modified to stand in line with bottom line of entry + PADDING_RIGHT("padding_right", 0); + part { + name: "line"; + type: IMAGE; + scale: 1; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + fixed: 0 1; + min: 0 1; + align: 0.5 0.5; + rel1 { + to_x: "padding_left"; + relative: 1.0 0.5; + } + rel2 { + to_x: "padding.divider_line"; + relative: 0.0 0.5; + } + visible: 1; + image.normal: dotted_line_divider.png; + fill { + type: TILE; + } + } + } + part { + name: "padding.divider_line"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: 8 PAGE_DIVIDER_H; + rel1 { + to_x: "text.page_info"; + relative: 0.0 0.0; + } + rel2 { + to_x: "text.page_info"; + relative: 0.0 1.0; + } + } + } + part { + name: "text.page_info"; + type: TEXT; + scale: 1; + description { + state: "default" 0.0; + align: 1.0 0.5; + text { + font: FONT_STYLE_BOLD; + text_class: FONT_TEXT_CLASS_BOLD; + size: 21; + align: 1.0 0.5; + min: 1 1; + ellipsis: -1; + } + color: COLOR_BLUE_EDC; + rel1 { + to_x : "padding_right"; + relative: 0.0 0.0; + } + rel2 { + to_x : "padding_right"; + relative: 0.0 1.0; + } + } + } + } + } + group { + name: "conv/body/page"; + //text input field + parts { + part { + name: "rect"; + type: SPACER; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + min: 0 20; + } + } + PADDING_LEFT("padding_left", 0); + PADDING_RIGHT("padding_right", 0); + PADDING_BOTTOM("padding_bottom", 0); + part { + name: "swl.page"; + type: SWALLOW; + scale:1; + description { + state: "default" 0.0; + min: 0 0; + fixed: 1 0; + rel1 { + to: "padding_left"; + relative: 1.0 0.0; + } + rel2 { + to_x: "padding_right"; + to_y: "padding_bottom"; + relative: 0.0 0.0; + } + } + } + } + } + group { + name: "conv/body/item_lyaout"; + parts { + part { + name: "rect"; + type: RECT; + //It should be a RECT in oder to emit clicked signal + scale: 1; + mouse_events: 1; + description { + state: "default" 0.0; + min: 0 40; + color: 0 0 0 0; + } + } + PADDING_TOP("padding_top", 2); + PADDING_RIGHT("padding_right", 0); + part { + name: "padding_bottom"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + min: 0 0; + fixed: 0 1; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 0.0 1.0; + } + description { + //Padding increased for text entry not to come under character count. + state: "easy.mode" 0.0; + min: 0 32; + fixed: 0 1; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 0.0 1.0; + } + } + part { + name: "swl.content"; + type: SWALLOW; + scale:1; + description { + state: "default" 0.0; + fixed: 1 0; + rel1 { + to_y: "padding_top"; + relative: 0.0 1.0; + } + rel2 { + to_x: "padding_right"; + to_y: "padding_bottom"; + relative: 0.0 0.0; + } + align: 0.0 1.0; + } + } + } + programs { + program { + name: "page_layout_clicked"; + source: "rect"; + signal: "mouse,clicked,1"; + action: SIGNAL_EMIT "page_layout,clicked" ""; + } + program { + name: "show.easy.mode"; + signal: "show.easy.mode"; + source: "*"; + action: STATE_SET "easy.mode" 0.0; + target: "padding_bottom"; + } + program { + name: "show.normal.mode"; + signal: "show.normal.mode"; + source: "*"; + action: STATE_SET "default.mode" 0.0; + target: "padding_bottom"; + } + } + } + group { + name: "conv/body/media_main"; + parts { + //If "rect.image" is not existed, then width of sound layout is not shown correctly. + part { + name: "bg"; + type: SPACER; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + max: -1 110; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 0.0 0.0; + } + description { + state: "image" 0.0; + /* default state of image is landscape */ + max: MSGC_IMAGE_THUMB_LANDSCAPE_W MSGC_IMAGE_THUMB_LANDSCAPE_H; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 0.0 0.0; + } + description { + state: "image.portrait" 0.0; + max: MSGC_IMAGE_THUMB_PORTRAIT_W MSGC_IMAGE_THUMB_PORTRAIT_H; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 0.0 0.0; + } + description { + state: "image.equal" 0.0; + /* in case of equal we set bg 110 110 */ + max: MSGC_IMAGE_THUMB_EQUAL_H MSGC_IMAGE_THUMB_EQUAL_H; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 0.0 0.0; + } + } + part { + name: "swl.content"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + fixed: 0 0; + rel1.to: "bg"; + rel2.to: "bg"; + align: 0.0 0.0; + } + } + } + programs { + program { + name: "media.sound"; + signal: "media.sound"; + source: "*"; + } + program { + name: "media.image.landscape"; + signal: "media.image.landscape"; + source: "*"; + action: STATE_SET "image" 0.0; + target: "bg"; + } + program { + name: "media.image.portrait"; + signal: "media.image.portrait"; + source: "*"; + action: STATE_SET "image.portrait" 0.0; + target: "bg"; + } + program { + name: "media.image.equal"; + signal: "media.image.equal"; + source: "*"; + action: STATE_SET "image.equal" 0.0; + target: "bg"; + } + program { + name: "item_press"; + signal: "play,press,sound"; + source: "*"; + action: RUN_PLUGIN "touch_sound"; + } + } + } + group { + name: "conv/body/media_label"; + images { + image: IMG_BODY_INPUT_FIELD COMP; + image: "00_search_edit_field_selected.#.png" COMP; + } + parts { + part { + name: "rect"; + type: SPACER; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + rel1{ + relative: 0.0 0.0; + } + rel2{ + relative: 1.0 1.0; + } + fixed: 1 1; + align: 0.0 0.0; + } + } + PADDING_TOP("padding_top", 0); + PADDING_LEFT("padding_left", 5); + // this is modified to stand in line with bottom line of entry + PADDING_RIGHT("padding_right", 0); + PADDING_BOTTOM("padding_bottom", 0); + part { + name: "rect.bg"; + type: RECT; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + min: 0 BODY_MEDIA_LABEL_H; + rel1{ + to_x: "padding_left"; + to_y: "padding_top"; + relative: 1.0 1.0; + } + rel2{ + to_x: "padding_right"; + to_y: "padding_bottom"; + relative: 0.0 0.0; + } + align: 0.0 0.0; + visible: 0; + } + description { + state: "focused" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "main.bg"; + type: IMAGE; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + fixed: 0 1; + visible: 0; + rel1 { + to: "rect.bg"; + } + rel2 { + to: "rect.bg"; + } + image.normal: IMG_BODY_INPUT_FIELD; + color_class: "W031L1"; + } + description { + state: "focused" 0.0; + inherit: "default" 0.0; + color_class: "W031L1"; + visible: 1; + } + } + part { + name: "glow"; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "main.bg"; + } + rel2 { + to: "main.bg"; + } + image.normal: "00_search_edit_field_selected.#.png"; + color_class: "W031L2"; + visible: 0; + } + description { + state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color: COLOR_BLUE_EDC; + } + } + part { + name: "text.filename"; + type: TEXT; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + rel1 { + to_x: "padding_left"; + to_y: "padding_top"; + relative: 1.0 1.0; + offset: 2 0; + } + rel2 { + to_x: "padding_right"; + to_y: "padding_bottom"; + relative: 0.0 0.0; + offset: -10 0; + } + align: 0.0 0.5; + color: COLOR_BLUE_EDC; + text { + font: FONT_STYLE_REGULAR; + text_class: FONT_TEXT_CLASS_REGULAR; + size: 25; + align: 0.0 0.5; + text: ""; + } + } + } + } + programs { + #if 0 //clicked cb from edc is not supported + program { + name: "sound_clicked"; + source: "rect.bg"; + signal: "mouse,clicked,1"; + script { + emit ("sound_clicked", ""); + } + } + #endif + program { + name: "focused"; + signal: "focused"; + source: "*"; + script { + new st[31]; + new Float:vl; + get_state(PART:"rect.bg", st, 30, vl) + if (!strcmp(st, "default")) { + set_state(PART:"glow", "focused", 0.0); + set_state(PART:"main.bg", "focused", 0.0); + set_state(PART:"rect.bg", "focused", 0.0); + } + } + } + program { + name: "unfocused"; + signal: "unfocused"; + source: "*"; + script { + new st[31]; + new Float:vl; + get_state(PART:"rect.bg", st, 30, vl) + if (!strcmp(st, "focused")) { + set_state(PART:"glow", "default", 0.0); + set_state(PART:"main.bg", "default", 0.0); + set_state(PART:"rect.bg", "default", 0.0); + } + } + } + } + } + group { + name: "conv/body/media_image"; + images { + image: "00_video_play.png" COMP; + } + parts { + part { + name: "rect"; + type: SPACER; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + rel1{ + relative: 0.0 0.0; + } + rel2{ + relative: 1.0 1.0; + } + fixed: 1 1; + align: 0.0 0.0; + } + } + PADDING_TOP("padding_top", 0); + PADDING_LEFT("padding_left", 5); + // this is modified to stand in line with bottom line of entry + PADDING_RIGHT("padding_right", 0); + PADDING_BOTTOM("padding_bottom", 0); + //If "rect.left_padding" is not existed, then height of image layout is not updated correctly. + part { + name: "rect.bg"; + type: RECT; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + rel1{ + to_x: "padding_left"; + to_y: "padding_top"; + relative: 1.0 1.0; + } + rel2{ + to: "rect.thumbnail"; + relative: 1.0 1.0; + } + align: 0.0 0.0; + visible: 1; + color: 255 255 255 255; + } + description { + state: "focus" 0.0; + inherit: "default" 0.0; + color: COLOR_BLUE_EDC; + visible: 1; + } + } + part { + name: "rect.thumbnail"; + type: SPACER; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { + to: "rect.bg"; + relative: 0.0 0.0; + offset: 2 2; + } + rel2 { + to: "swl.thumbnail"; + relative: 1.0 1.0; + offset: 1 1; + } + align: 0.0 0.0; + } + } + part { + name: "swl.thumbnail"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + fixed: 0 0; + rel1 { + to: "rect.thumbnail"; + relative: 0.0 0.0; + } + rel2 { + to: "rect.thumbnail"; + relative: 0.0 0.0; + } + align: 0.0 0.0; + } + } + part { + name: "play_button"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + image.normal: "00_video_play.png"; + align: 0.5 0.5; + min: 48 48; + rel1 { + to: "swl.thumbnail"; + relative: 0.5 0.5; + offset: -36 -36; + } + rel2 { + to: "swl.thumbnail"; + relative: 0.5 0.5; + offset: 36 36; + } + } + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + #if 0 //clicked cb from edc is not supported + program { + name: "image_clicked"; + source: "rect"; + signal: "mouse,clicked,1"; + script { + emit ("image_clicked", ""); + } + } + #endif + program { + name: "focused"; + signal: "focused"; + source: "*"; + script { + new st[31]; + new Float:vl; + get_state(PART:"rect.bg", st, 30, vl) + if (!strcmp(st, "default")) { + set_state(PART:"rect.bg", "focus", 0.0); + } + } + } + program { + name: "unfocused"; + signal: "unfocused"; + source: "*"; + script { + new st[31]; + new Float:vl; + get_state(PART:"rect.bg", st, 30, vl) + if (!strcmp(st, "focus")) { + set_state(PART:"rect.bg", "default", 0.0); + } + } + } + program { + name: "play_icon_show"; + signal: "play_icon_show"; + source: ""; + action: STATE_SET "show" 0.0; + target: "play_button"; + } + } + } +} \ No newline at end of file diff --git a/src/Conversation/Body/View/src/ImagePageViewItem.cpp b/src/Conversation/Body/View/src/ImagePageViewItem.cpp index 7b722dd..d044b31 100644 --- a/src/Conversation/Body/View/src/ImagePageViewItem.cpp +++ b/src/Conversation/Body/View/src/ImagePageViewItem.cpp @@ -33,9 +33,7 @@ namespace const char *showPlayIconSig = "play_icon_show"; const int thumbOriginHeight = 75; - const int thumbLandscapeWidth = 128; const int thumbLandscapeHeight = 102; - const int thumbPortraitWidth = 102; const int thumbPortraitHeight = 128; const int thumbEqual = 106; } @@ -124,11 +122,13 @@ Evas_Object *ImagePageViewItem::createImage(Evas_Object *parent) int width = 0; int height = 0; + float ratio = 0.0; evas_object_image_size_get(img, &width, &height); evas_object_del(img); MSG_LOG("Image: width = ", width, " height = ", height); - + if(height > 0) + ratio = width / (float)height; // Set orientation of media layout and icon dimension: int iconWidth = 0; int iconHeight = 0; @@ -136,13 +136,13 @@ Evas_Object *ImagePageViewItem::createImage(Evas_Object *parent) if(width > height) // Landscape { - iconWidth = (int)ELM_SCALE_SIZE(thumbLandscapeWidth); + iconWidth = (int)ELM_SCALE_SIZE(ratio * thumbLandscapeHeight); iconHeight = (int)ELM_SCALE_SIZE(thumbLandscapeHeight); sig = mediaImageLandscapeSig; } else if(height > width) // Portrait { - iconWidth = (int)ELM_SCALE_SIZE(thumbPortraitWidth); + iconWidth = (int)ELM_SCALE_SIZE(ratio * thumbPortraitHeight); iconHeight = (int)ELM_SCALE_SIZE(thumbPortraitHeight); sig = mediaImagePortraitSig; } @@ -157,8 +157,9 @@ Evas_Object *ImagePageViewItem::createImage(Evas_Object *parent) // Create and load icon image: Evas_Object *icon = elm_icon_add(parent); elm_image_file_set(icon, m_ImagePath.c_str(), NULL); + evas_object_size_hint_align_set(icon, 0.0, EVAS_HINT_FILL); evas_object_size_hint_min_set(icon, iconWidth, iconHeight); - elm_image_aspect_fixed_set(icon, EINA_FALSE); + elm_image_aspect_fixed_set(icon, EINA_TRUE); evas_object_show(icon); return icon; -- 2.7.4