Set prescale size for bubble image, fixed GUI 90/85690/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Fri, 26 Aug 2016 12:49:18 +0000 (15:49 +0300)
committerAndrey Klimenko <and.klimenko@samsung.com>
Mon, 29 Aug 2016 09:58:26 +0000 (02:58 -0700)
Change-Id: Ie14b3ed5b9a74ed36fb332b8244fa2a1a85762a6
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
res/edje/conv_list_bubble.edc
src/Conversation/ConvList/View/inc/BubbleBgViewItem.h
src/Conversation/ConvList/View/inc/BubbleViewItem.h
src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp
src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp
src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp

index 196ec88..8b80f57 100644 (file)
@@ -4,7 +4,7 @@ collections {
 
     BASE_SCALE;
 
-    #define MAX_TEXT_LEN 300
+    #define MAX_TEXT_LEN 290
     #define BUBBLE_BG_COLOR 90 111 199 230
     #define BUBBLE_BG_COLOR_PRESSED 78 97 173 230
     #define BUBBLE_BG_DRAFT_COLOR 106 126 204 255
index 2970a1d..71f51d7 100644 (file)
@@ -34,6 +34,8 @@ namespace Msg
                 FailedStyle,
                 RestrictedStyle
             };
+            static const int bgPadLeft = 34;
+            static const int bgPadRight = 34;
 
         public:
             BubbleBgViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType);
index 7fae586..c49d487 100644 (file)
@@ -30,7 +30,7 @@ namespace Msg
         : public View
     {
         public:
-            static const int maxWidth = 340;
+            static const int maxWidth = 408;
 
             BubbleViewItem(BubbleEntity &entity);
             virtual ~BubbleViewItem();
index a70e4ad..a7c5f61 100644 (file)
@@ -35,11 +35,14 @@ BubbleImageViewItem::~BubbleImageViewItem()
 
 Evas_Object *BubbleImageViewItem::createImage(Evas_Object *parent, const std::string &path)
 {
+    int imageWidth = 0;
+    int imageHeight = 0;
+
     Evas_Object *image = elm_image_add(parent);
     elm_image_preload_disabled_set(image, true);
+    elm_image_prescale_set(image, maxWidth);
+    elm_image_aspect_fixed_set(image, true);
     elm_image_file_set(image, path.c_str(), nullptr);
-    int imageWidth = 0;
-    int imageHeight = 0;
     elm_image_object_size_get(image, &imageWidth, &imageHeight);
     if(imageWidth > maxWidth)
     {
index 332a7d2..ea62998 100644 (file)
@@ -36,6 +36,8 @@ Evas_Object *BubbleTextViewItem::createText(Evas_Object *parent, const std::stri
     if(text.empty())
         return nullptr;
 
+    static const int maxTextWidth = maxWidth - (bgPadLeft + bgPadRight);
+
     Evas_Object *label = elm_label_add(parent);
     elm_object_style_set(label, "conv_bubble");
 
@@ -48,8 +50,9 @@ Evas_Object *BubbleTextViewItem::createText(Evas_Object *parent, const std::stri
 
     Evas_Coord ww = 0;
     Evas_Coord hh = 0;
+
     evas_object_textblock_size_native_get(textBlock, &ww, &hh);
-    int wrapWidth = ww > maxWidth ? maxWidth : ww;
+    int wrapWidth = ww > maxTextWidth ? maxTextWidth : ww;
     elm_label_wrap_width_set(label, wrapWidth);
 
     return label;
index 9176be2..d73c98d 100644 (file)
@@ -38,6 +38,7 @@ BubbleVideoViewItem::~BubbleVideoViewItem()
 Evas_Object *BubbleVideoViewItem::createIamge(Evas_Object *parent, const std::string &path)
 {
     Evas_Object *image = elm_image_add(parent);
+    elm_image_prescale_set(image, maxWidth);
     elm_image_file_set(image, path.c_str(), nullptr);
     int imageWidth = 0;
     int imageHeight = 0;