#define THREAD_THEME_EDJ_PATH EDJ_PATH"/thread_genlist_theme.edj"
#define CONV_GENLIST_THEME_EDJ_PATH EDJ_PATH"/conv_genlist_theme.edj"
+#define CONV_LABEL_THEME_EDJ_PATH EDJ_PATH"/conv_label_theme.edj"
#define MSG_INPUT_PANEL_EDJ_PATH EDJ_PATH"/msg_input_panel.edj"
#define RECIPIENT_PANEL_EDJ_PATH EDJ_PATH"/recipient_panel.edj"
# User Includes
## C Compiler
-USER_INC_DIRS = USER_INC_DIRS = src/Conversation/Utils/inc src/Common/SystemSettingsManager/inc inc src/Conversation/AppControl/inc src/Conversation/ConvList/Controller/inc src/Conversation/ConvList/View/inc src/Conversation/Main/Controller/inc src/Conversation/Main/View/inc src/Conversation/Recipients/Controller/inc src/Conversation/Recipients/View/inc src/Common/ContactManager/inc src/Common/AppControl/inc src/Conversation/Body/Controller/inc src/Conversation/ContactList/Controller/inc src/Conversation/ContactList/View/inc src/Conversation/Body/View/inc src/Settings/Controller/inc src/Settings/View/inc src/Viewer/Controller/inc src/Viewer/View/inc src/Viewer/Utils/inc src/MsgThread/Controller/inc src/MsgThread/View/inc src/Common/MsgEngine/inc src/Common/Utils/inc src/Common/View/inc src/Common/Controller/inc
+USER_INC_DIRS = src/Conversation/Utils/inc src/Common/SystemSettingsManager/inc inc src/Conversation/AppControl/inc src/Conversation/ConvList/Controller/inc src/Conversation/ConvList/View/inc src/Conversation/Main/Controller/inc src/Conversation/Main/View/inc src/Conversation/Recipients/Controller/inc src/Conversation/Recipients/View/inc src/Common/ContactManager/inc src/Common/AppControl/inc src/Conversation/Body/Controller/inc src/Conversation/ContactList/Controller/inc src/Conversation/ContactList/View/inc src/Conversation/Body/View/inc src/Settings/Controller/inc src/Settings/View/inc src/Viewer/Controller/inc src/Viewer/View/inc src/Viewer/Utils/inc src/MsgThread/Controller/inc src/MsgThread/View/inc src/Common/MsgEngine/inc src/Common/Utils/inc src/Common/View/inc src/Common/Controller/inc
USER_INC_DIRS_ABS =
USER_INC_FILES =
USER_INC_FILES_ABS =
# EDC Flags
USER_EXT_EDC_KEYS = EDC0
-USER_EXT_EDC0_EDCS = res/edje/msg_title.edc res/edje/msg_body.edc res/edje/conv_layout.edc res/edje/viewer_layout.edc res/edje/msg_thread.edc res/edje/smil_item.edc res/edje/msg_input_panel.edc res/edje/select_all.edc res/edje/thread_genlist_theme.edc res/edje/recipient_panel.edc res/edje/viewer_player.edc res/edje/conv_list.edc res/edje/viewer_subject_layout.edc res/edje/conv_genlist_theme.edc res/edje/conv_contact_list_layout.edc res/edje/contact_search.edc res/edje/button_theme.edc res/edje/conv_list_bubble.edc res/edje/msg_thumbnail.edc res/edje/images.edc
+USER_EXT_EDC0_EDCS = res/edje/msg_title.edc res/edje/msg_body.edc res/edje/conv_layout.edc res/edje/viewer_layout.edc res/edje/msg_thread.edc res/edje/smil_item.edc res/edje/msg_input_panel.edc res/edje/select_all.edc res/edje/thread_genlist_theme.edc res/edje/recipient_panel.edc res/edje/viewer_player.edc res/edje/conv_list.edc res/edje/viewer_subject_layout.edc res/edje/conv_genlist_theme.edc res/edje/conv_contact_list_layout.edc res/edje/conv_label_theme.edc res/edje/contact_search.edc res/edje/button_theme.edc res/edje/conv_list_bubble.edc res/edje/msg_thumbnail.edc res/edje/images.edc
USER_EXT_EDC0_EDCS_IMAGE_DIRS = edje/images res/images
USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds
tag: "em" "+ font=Tizen:style=Oblique";
tag: "b" "+ font=Tizen:style=Bold";
tag: "link" "+ color=#800 underline=on underline_color=#8008";
- tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "highlight" "+ font=Tizen:style=Bold";
tag: "match" "+ color=#FFFFFF color_class=T1067";
}
style {
tag: "em" "+ font=Tizen:style=Oblique";
tag: "b" "+ font=Tizen:style=Bold";
tag: "link" "+ color=#800 underline=on underline_color=#8008";
- tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "highlight" "+ font=Tizen:style=Bold";
tag: "match" "+ color=#FFFFFF color_class=T1067";
}
style {
tag: "em" "+ font=Tizen:style=Oblique";
tag: "b" "+ font=Tizen:style=Bold";
tag: "link" "+ color=#00000080 underline=on underline_color=#00000080";
- tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "highlight" "+ font=Tizen:style=Bold";
tag: "match" "+ color=#FFFFFF color_class=T1067";
}
style {
name: "dateline_textblock_style";
- base: "font=Tizen:style=Roman font_size="DATELINE_TEXT_SIZE" color=#"BUBBLE_DATELINE_TEXTSTYLE_COLOR_HEX" align=center";
+ base: "font=Tizen:style=Regular font_size="DATELINE_TEXT_SIZE" color=#"BUBBLE_DATELINE_TEXTSTYLE_COLOR_HEX" align=center";
}
}
--- /dev/null
+#include "macros.inl"
+
+#define SLIDE_SPEED_WEIGHT 0.5
+#define SLIDE_TEXT_GAP 60
+#define SLIDE_TEXT_CHAR_GAP " " //60 (6 spaces)
+#define SLIDE_TEXT_MAX_LENGTH (2*(1024+6))
+#define LABEL_FONT_SIZE_INC 30
+
+collections {
+ BASE_SCALE;
+
+ styles {
+ style { name: "textblock_style";
+ base: "font=Samsung Condensed:style=Latin font_size="36" color=#080808ff wrap=mixed text_class=label align=left";
+ tag: "br" "\n";
+ tag: "ps" "ps";
+ tag: "highlight" "+ font_weight=Bold";
+ tag: "b" "+ font_weight=Bold";
+ tag: "tab" "\t";
+ }
+ }
+
+ group { name: "elm/label/base/conv_bubble";
+ parts {
+ part { name: "label.text.clip";
+ type: RECT;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "elm.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ clip_to: "label.text.clip";
+ description { state: "default" 0.0;
+ text {
+ style: "textblock_style";
+ min: 0 1;
+ align: 0.0 0.0;
+ }
+ }
+ }
+ }
+ }
+}
styles {
style {
name: "main_text_style";
- base: "font=Samsung Condensed:style=Latin font_size="32" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
+ base: "font=Samsung Condensed:style=Latin font_size="36" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
tag: "tab" "\t";
tag: "em" "+ font=Tizen:style=Oblique";
tag: "b" "+ font=Tizen:style=Bold";
tag: "link" "+ color=#800 underline=on underline_color=#8008";
- tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "highlight" "+ font=Tizen:style=Bold";
tag: "match" "+ color=#FFFFFF color_class=T1067";
}
style {
name: "sub_text_style";
- base: "font=Samsung Condensed:style=Latin font_size="28" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
+ base: "font=Samsung Condensed:style=Latin font_size="32" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
tag: "tab" "\t";
tag: "em" "+ font=Tizen:style=Oblique";
tag: "b" "+ font=Tizen:style=Bold";
tag: "link" "+ color=#800 underline=on underline_color=#8008";
- tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "highlight" "+ font=Tizen:style=Bold";
tag: "match" "+ color=#FFFFFF color_class=T1067";
}
}
clip_to: "masking";
description {
state: "default" 0.0;
+ color: 0 0 0 128;
+ }
+ }
+ part {
+ name: "press_effect";
+ type: IMAGE;
+ description {
+ state: "default" 0.0;
+ image.normal: "messages_attach_image_round_mask.#.png";
+ color: 0 0 0 0;
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default";
+ color: 0 0 0 70;
}
}
part {
}
}
}
+ programs {
+ program { name: "pressed";
+ signal: "mouse,down,1";
+ source: "*";
+ action: STATE_SET "pressed" 0.0;
+ target: "press_effect";
+ transition: LINEAR 0.1;
+ }
+ program { name: "unpressed";
+ signal: "mouse,up,1";
+ source: "*";
+ action: STATE_SET "default" 0.0;
+ target: "press_effect";
+ transition: LINEAR 0.1;
+ }
+ }
}
group {
image.normal: "messages_bubble_bg.#.png";
rel1 { relative: 0.0 0.0; }
rel2 { relative: 1.0 1.0; }
- min: 120 122;
color: BUBBLE_BG_COLOR;
}
description {
signal: "mouse,down,1";
source: "*";
action: STATE_SET "pressed" 0.0;
+ transition: LINEAR 0.1;
target: "bg";
}
program { name: "unpressed";
signal: "mouse,up,1";
source: "*";
action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
target: "bg";
}
}
std::string threadThemePath = PathUtils::getResourcePath(THREAD_THEME_EDJ_PATH);
elm_theme_extension_add(nullptr, threadThemePath.c_str());
+ std::string convLabelThemePath = PathUtils::getResourcePath(CONV_LABEL_THEME_EDJ_PATH);
+ elm_theme_extension_add(nullptr, convLabelThemePath.c_str());
+
return true;
}
{
public:
static std::string make(const std::string &text, const TextStyle &style);
+ static std::string make(const std::string &text, const std::string &color);
static std::string make(const std::string &text,
int size = TextStyle::defaultFontSize,
const std::string &color = TextStyle::defaultColor,
const char *TextStyle::whiteColor = "#FFFFFFFF";
const int TextStyle::defaultFontSize = 28;
+#define OPEN_TAG_STR(name, str) "<" name "=" + str + ">"
#define OPEN_TAG(name, val) "<" name "=" << (val) << ">"
#define CLOSE_TAG(name) "</" name ">"
return make(text, style.getSize(), style.getColor(), style.getAlign());
}
+std::string TextDecorator::make(const std::string &text, const std::string &color)
+{
+ std::string res = OPEN_TAG_STR("color", color) + text + CLOSE_TAG("color");
+ return res;
+}
+
std::string TextDecorator::make(const std::string &text,
int size,
const std::string &color,
auto *item = new BubbleContactViewItem(*this, parent, m_BgType, type);
item->setMainText(m_Name);
- Evas_Object *thumb = m_ThumbPath.empty() ? BubbleContactViewItem::createIcon(*item, ATTACH_CONTACT_ICON)
+ Evas_Object *thumb = m_ThumbPath.empty() ? item->createIcon(ATTACH_CONTACT_ICON)
: m_ThumbMaker.getThumb(*item, m_ThumbPath, BubbleContactViewItem::iconSize);
if(thumb)
item->setIcon(thumb);
inline BubbleAudioViewItem::BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType)
: BubbleIconTextLayoutItem(entity, parent, bgType, Layout1Icon2Text)
{
- setIcon(createIcon(getContent(), ATTACH_MUSIC_ICON));
+ setIcon(createIcon(ATTACH_MUSIC_ICON));
}
inline BubbleAudioViewItem::~BubbleAudioViewItem()
BubbleBgViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType);
virtual ~BubbleBgViewItem();
+ BgType getBgType() const;
void showSearch(bool search);
void setContent(Evas_Object *obj);
Evas_Object *getContent() const;
+
+ static std::string applyColor(const std::string &text, BgType bgType);
+ static void applyColor(Evas_Object *obj, BgType bgType);
+ std::string applyColor(const std::string &text) const;
+ void applyColor(Evas_Object *obj) const;
+
+ private:
+ BgType m_BgType;
};
}
inline BubbleCalEventViewItem::BubbleCalEventViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType layoutType)
: BubbleIconTextLayoutItem(entity, parent, bgType, layoutType)
{
- setIcon(createIcon(getContent(), ATTACH_CAL_ICON));
+ setIcon(createIcon(ATTACH_CAL_ICON));
}
inline BubbleCalEventViewItem::~BubbleCalEventViewItem()
void setMainText(const std::string &text);
void setSubText(const std::string &text);
- static Evas_Object *createIcon(Evas_Object *parent, const std::string &edjFileName);
+ static Evas_Object *createIcon(Evas_Object *parent, const std::string &edjFileName, BgType bgType);
+ Evas_Object *createIcon(const std::string &edjFileName) const;
private:
LayoutType m_LayoutType;
inline BubbleUnknownFileViewItem::BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType)
: BubbleIconTextLayoutItem(entity, parent, bgType, Layout1Icon1Text)
{
- setIcon(createIcon(getContent(), ATTACH_UNKNOWN_ICON));
+ setIcon(createIcon(ATTACH_UNKNOWN_ICON));
}
inline BubbleUnknownFileViewItem::~BubbleUnknownFileViewItem()
#include "BubbleBgViewItem.h"
#include "Resource.h"
+#include "TextDecorator.h"
using namespace Msg;
+const std::string whiteTextColor = "#fafafa";
+const std::string darkTextColor = "#808080";
+#define WHITE_OBJ_COLOR 250, 250, 250, 255
+#define DARK_OBJ_COLOR 128, 128, 128, 255
BubbleBgViewItem::BubbleBgViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType)
: BubbleViewItem(entity)
+ , m_BgType(bgType)
{
const char *group = nullptr;
switch(bgType)
}
+BubbleBgViewItem::BgType BubbleBgViewItem::getBgType() const
+{
+ return m_BgType;
+}
+
void BubbleBgViewItem::setContent(Evas_Object *obj)
{
View::setContent(obj, "content");
{
// TODO: impl
}
+
+std::string BubbleBgViewItem::applyColor(const std::string &text, BgType bgType)
+{
+ const std::string &color = (bgType == SentStyle || bgType == ReceivedStyle) ? whiteTextColor : darkTextColor;
+ return TextDecorator::make(text, color);
+}
+
+void BubbleBgViewItem::applyColor(Evas_Object *obj, BgType bgType)
+{
+ if(bgType == SentStyle || bgType == ReceivedStyle)
+ evas_object_color_set(obj, WHITE_OBJ_COLOR);
+ else
+ evas_object_color_set(obj, DARK_OBJ_COLOR);
+}
+
+std::string BubbleBgViewItem::applyColor(const std::string &text) const
+{
+ return applyColor(text, m_BgType);
+}
+
+void BubbleBgViewItem::applyColor(Evas_Object *obj) const
+{
+ applyColor(obj, m_BgType);
+}
+
#include "TextDecorator.h"
#include "Resource.h"
-using namespace Msg;
+#include "TextDecorator.h"
-#define DEF_ICON_COLOR 128, 128, 128, 255
+using namespace Msg;
BubbleIconTextLayoutItem::BubbleIconTextLayoutItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType layoutType)
: BubbleBgViewItem(entity, parent, bgType)
}
m_pIconTextLayout = addLayout(getEo(), CONV_LIST_BUBBLE_EDJ_PATH, group);
+ evas_object_smart_calculate(m_pIconTextLayout);
setContent(m_pIconTextLayout);
}
void BubbleIconTextLayoutItem::setMainText(const std::string &text)
{
- elm_object_part_text_set(m_pIconTextLayout, "main.text", text.c_str());
+ elm_object_part_text_set(m_pIconTextLayout, "main.text", applyColor(text).c_str());
}
void BubbleIconTextLayoutItem::setSubText(const std::string &text)
{
- elm_object_part_text_set(m_pIconTextLayout, "sub.text", text.c_str());
+ elm_object_part_text_set(m_pIconTextLayout, "sub.text", applyColor(text).c_str());
}
-Evas_Object *BubbleIconTextLayoutItem::createIcon(Evas_Object *parent, const std::string &edjFileName)
+Evas_Object *BubbleIconTextLayoutItem::createIcon(Evas_Object *parent, const std::string &edjFileName, BgType bgType)
{
Evas_Object *icon = elm_icon_add(parent);
std::string resPath = PathUtils::getResourcePath(IMAGES_EDJ_PATH);
elm_image_file_set(icon, resPath.c_str(), edjFileName.c_str());
- evas_object_color_set(icon, DEF_ICON_COLOR);
+ applyColor(icon, bgType);
evas_object_show(icon);
return icon;
}
+Evas_Object *BubbleIconTextLayoutItem::createIcon(const std::string &edjFileName) const
+{
+ return createIcon(*this, edjFileName, getBgType());
+}
+
BubbleIconTextLayoutItem::LayoutType BubbleIconTextLayoutItem::getLayoutType() const
{
return m_LayoutType;
*/
#include "BubbleTextViewItem.h"
+#include "Resource.h"
+#include "Logger.h"
using namespace Msg;
-namespace
-{
- const char *textStyle = "DEFAULT='font=Tizen:style=Regular font_size=24 wrap=mixed text_class=label'";
-}
-
BubbleTextViewItem::BubbleTextViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, const std::string &text)
: BubbleBgViewItem(entity, parent, bgType)
{
- setContent(createText(*this, text));
+ setContent(createText(*this, applyColor(text)));
}
BubbleTextViewItem::~BubbleTextViewItem()
Evas_Object *BubbleTextViewItem::createText(Evas_Object *parent, const std::string &text)
{
- //TODO: apply to label the same text style as to textblock (figure out how-to)
if(text.empty())
return nullptr;
- Evas_Coord ww = 0;
- Evas_Coord hh = 0;
-
Evas_Object *label = elm_label_add(parent);
- Evas_Object *textBlock = evas_object_textblock_add(evas_object_evas_get(label));
- Evas_Textblock_Style *ts = evas_textblock_style_new();
-
- evas_textblock_style_set(ts, textStyle);
- evas_object_textblock_style_set(textBlock, ts);
- evas_object_textblock_text_markup_set(textBlock, text.c_str());
- evas_object_textblock_size_native_get(textBlock, &ww, &hh);
-
- evas_textblock_style_free(ts);
- evas_object_del(textBlock);
-
- int wrapWidth = ww > maxWidth ? (int)ELM_SCALE_SIZE(maxWidth) : (int)ELM_SCALE_SIZE(ww);
+ elm_object_style_set(label, "conv_bubble");
elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
- elm_label_wrap_width_set(label, wrapWidth);
elm_object_part_text_set(label, nullptr, text.c_str());
evas_object_show(label);
+
+ Evas_Object *edjeLabel = elm_layout_edje_get(label);
+ const Evas_Object *textBlock = edje_object_part_object_get(edjeLabel, "elm.text");
+
+ Evas_Coord ww = 0;
+ Evas_Coord hh = 0;
+ evas_object_textblock_size_native_get(textBlock, &ww, &hh);
+ int wrapWidth = ww > maxWidth ? maxWidth : ww;
+ elm_label_wrap_width_set(label, wrapWidth);
+
return label;
}