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
FailedStyle,
RestrictedStyle
};
+ static const int bgPadLeft = 34;
+ static const int bgPadRight = 34;
public:
BubbleBgViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType);
: public View
{
public:
- static const int maxWidth = 340;
+ static const int maxWidth = 408;
BubbleViewItem(BubbleEntity &entity);
virtual ~BubbleViewItem();
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)
{
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");
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;
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;