-#define BASE_SCALE 1.8
+#define BASE_SCALE base_scale: 2.6;
#define PADDING_LEFT(param_padding_name, param_padding_size) \
part \
#define COLOR_WHITE 255 255 255 255
#define COLOR_BLUE 2 61 132 255
+#define COLOR_GRAY 128 128 128 255
-#define BODY_ADDBUTTON_SIZE 50 50
-#define BODY_SENDBUTTON_SIZE 46 40
+#define BODY_ADDBUTTON_SIZE 72 72
+#define BODY_SENDBUTTON_SIZE 72 43
collections {
- base_scale: 1.8;
+ BASE_SCALE;
group {
name: "conversation/msg_input_panel";
mouse_events: 0;
description {
state: "default" 0.0;
- min: 0 80;
+ min: 0 154;
rel1{ relative: 0.0 0.0; }
rel2{ relative: 1.0 1.0; }
- color: COLOR_WHITE;
}
}
PADDING_TOP("padding_top", 1);
- PADDING_BOTTOM("padding_btn_bottom", 18);
PADDING_TOP("padding_entry_top", 5);
- PADDING_BOTTOM("padding_entry_bottom", 18);
- PADDING_BOTTOM("padding_send_btn_bottom", 4);
- PADDING_LEFT("padding_left", 11);
- PADDING_RIGHT("padding_right", 15);
+ PADDING_BOTTOM("padding_entry_bottom", 56);
+ PADDING_BOTTOM("padding_add_btn_bottom", 44);
+ PADDING_LEFT("padding_left", 32);
+ PADDING_RIGHT("padding_right", 43);
part {
- name: "rect.add_bt_area";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- min: BODY_ADDBUTTON_SIZE;
- max: BODY_ADDBUTTON_SIZE;
- fixed: 1 1;
- rel1 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; }
- rel2 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; }
- align: 0.0 1.0;
- }
- description {
- state: "landscape" 0.0;
- inherit: "default" 0.0;
- rel1 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; }
- rel2 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; }
- align: 0.0 1.0;
- }
- }
- part {
name: "swl.add_button";
type: SWALLOW;
scale: 1;
description {
- max: BODY_ADDBUTTON_SIZE;
- min: BODY_ADDBUTTON_SIZE;
- state: "default" 0.0;
- fixed: 1 1;
- rel1 { to: "rect.add_bt_area"; relative: 0.0 0.0; }
- rel2 { to: "rect.add_bt_area"; relative: 1.0 1.0; }
- align: 0.5 0.5;
+ state: "default" 0.0;
+ min: BODY_ADDBUTTON_SIZE;
+ max: BODY_ADDBUTTON_SIZE;
+ fixed: 1 1;
+ rel1 { to_x: "padding_left"; to_y: "padding_add_btn_bottom"; relative: 1.0 0.0; }
+ rel2 { to_x: "padding_left"; to_y: "padding_add_btn_bottom"; relative: 1.0 0.0; }
+ align: 0.0 1.0;
}
}
part {
- name: "padding1"; //padding between add button and input field..
+ name: "padding1"; //padding between add button and input field.
type: SPACER;
scale: 1;
description {
state: "default" 0.0;
min: 10 0;
fixed: 1 0;
- rel1 { to_x: "rect.add_bt_area"; relative: 1.0 0.0; }
- rel2 { to_x: "rect.add_bt_area"; relative: 1.0 1.0; }
+ rel1 { to_x: "swl.add_button"; relative: 1.0 0.0; }
+ rel2 { to_x: "swl.add_button"; relative: 1.0 1.0; }
align: 0.0 0.0;
}
}
max: -1 2;
fixed: 1 1;
align: 0.0 1.0;
- rel1 { to: "text_count_rect"; relative: 0.0 0.0; }
- rel2 { to: "text_count_rect"; relative: 1.0 0.0; }
+ rel1 { to: "text.char_count"; relative: 0.0 0.0; }
+ rel2 { to: "text.char_count"; relative: 1.0 0.0; }
}
}
part {
scale: 1;
mouse_events: 0;
description {
- state: "default" 0.0;
- rel1 { to: "text_count_rect"; relative: 0.0 0.0; }
- rel2 { to: "text_count_rect"; relative: 1.0 1.0; }
- align: 0.5 0.5;
- color: COLOR_BLUE;
+ state: "default" 0.0;
+ min: 73 31;
+ max: 73 31;
+ fixed: 1 1;
+ rel1 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; }
+ rel2 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; }
+ align: 1.0 1.0;
+ visible: 1;
+ color: COLOR_GRAY;
text {
- size: 17;
- text: "";
+ size: 23;
+ align: 1.0 0.5;
}
}
}
part {
- name: "text_count_rect";
- type: RECT;
- scale: 1;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- min: 54 20;
- max: 54 20;
- fixed: 1 1;
- rel1 { to_x: "padding_right"; to_y: "padding_send_btn_bottom"; relative: 0.0 0.0; }
- rel2 { to_x: "padding_right"; to_y: "padding_send_btn_bottom"; relative: 0.0 0.0; }
- align: 1.0 1.0;
- color: 0 0 0 0;
- visible: 1;
- }
- }
- part {
name: "padding2"; //padding between input field of right side and send button
type: SPACER;
scale: 1;
fixed: 1 0;
min: 14 0;
align: 1.0 0.0;
- rel1 { to_x: "rect.send_button"; relative: 0.0 0.0; }
- rel2 { to_x: "rect.send_button"; relative: 0.0 1.0; }
- }
- }
- part {
- name: "rect.send_button";
- type: SPACER;
- scale: 1;
- description {
- state: "default" 0.0;
- fixed: 1 1;
- min: BODY_SENDBUTTON_SIZE;
- max: BODY_SENDBUTTON_SIZE;
- align: 1.0 1.0;
- rel1 { to_x: "padding_right"; to_y: "padding_top"; relative: 0.0 1.0; }
- rel2 { to_x: "padding_right"; to_y: "text_padding"; relative: 0.0 0.0; }
- }
- description {
- state: "landscape" 0.0;
- inherit: "default" 0.0;
- rel1 { to_x: "padding_right"; to_y: "padding_top"; relative: 0.0 1.0; }
- rel2 { to_x: "padding_right"; to_y: "text_padding"; relative: 0.0 0.0; }
+ rel1 { to_x: "swl.send_button"; relative: 0.0 0.0; }
+ rel2 { to_x: "swl.send_button"; relative: 0.0 1.0; }
}
}
part {
scale: 1;
description {
state: "default" 0.0;
- fixed: 1 1;
- min: BODY_SENDBUTTON_SIZE;
- max: BODY_SENDBUTTON_SIZE;
- rel1 { to: "rect.send_button"; relative: 0.0 0.0; }
- rel2 { to: "rect.send_button"; relative: 1.0 1.0; }
- align: 0.5 0.5;
- visible: 1;
+ fixed: 1 1;
+ min: BODY_SENDBUTTON_SIZE;
+ max: BODY_SENDBUTTON_SIZE;
+ align: 1.0 0.0;
+ rel1 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; }
+ rel2 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; }
}
description {
state: "hide" 0.0;
visible: 0;
}
- description {
- state: "landscape" 0.0;
- inherit: "default" 0.0;
- }
}
}
programs {
action: STATE_SET "default" 0.0;
target: "swl.send_button";
}
- program {
- name: "show.portrait.mode";
- signal: "show.portrait.mode";
- source: "*";
- action: STATE_SET "default" 0.0;
- target: "rect.send_button";
- target: "swl.send_button";
- target: "rect.add_bt_area";
- target: "swl.main";
- target: "text_padding";
- }
- program {
- name: "show.landscape.mode";
- signal: "show.landscape.mode";
- source: "*";
- action: STATE_SET "landscape" 0.0;
- target: "rect.send_button";
- target: "swl.send_button";
- target: "rect.add_bt_area";
- target: "swl.main";
- target: "text_padding";
- }
}
}
}
collections {
- base_scale: BASE_SCALE;
+ BASE_SCALE;
group { name: "msg_thread_layout";
parts {
class TextStyle
{
public:
- static const std::string defaultColor;
+ static const char *defaultColor;
+ static const char *whiteColor;
static const int defaultFontSize;
public:
using namespace Msg;
-const std::string TextStyle::defaultColor = "#000000FF";
+const char *TextStyle::defaultColor = "#000000FF";
+const char *TextStyle::whiteColor = "#FFFFFFFF";
const int TextStyle::defaultFontSize = 28;
#define OPEN_TAG(name, val) "<" name "=" << (val) << ">"
private:
void create(Evas_Object *parent);
- Evas_Object *createButton(Evas_Object *parent, const char *iconRes, const char *style, ButtonId buttonId);
+ Evas_Object *createButton(Evas_Object *parent, ButtonId buttonId);
+ Evas_Object *createAddButton(Evas_Object *parent);
+ Evas_Object *createSendButton(Evas_Object *parent);
Evas_Object *getIcon(Evas_Object *button);
Evas_Object *getButton(ButtonId id);
+ void updateSendButtonTitle();
+
void setNormalColor(Evas_Object *button);
void setPressedColor(Evas_Object *button);
void setDisabledColor(Evas_Object *button);
IMessageInputPanelListener * m_pListener;
Evas_Object *m_pLayout;
Evas_Object *m_pSendButton;
+ Evas_Object *m_pSendLabel;
Evas_Object *m_pAddButton;
};
#include "PathUtils.h"
#include "CallbackAssist.h"
#include "Logger.h"
+#include "LangUtils.h"
+#include "TextDecorator.h"
+
+using namespace Msg;
namespace
{
const char *buttonIdKey = "id";
+ const TextStyle sendTextStyle(32, TextStyle::whiteColor, TextAlign::Right);
}
-using namespace Msg;
-
MessageInputPanel::MessageInputPanel(Evas_Object *parent)
: m_pListener(nullptr)
, m_pLayout(nullptr)
, m_pSendButton(nullptr)
+ , m_pSendLabel(nullptr)
, m_pAddButton(nullptr)
{
create(parent);
std::string edjPath = PathUtils::getResourcePath(MSG_INPUT_PANEL_EDJ_PATH);
elm_layout_file_set(m_pLayout, edjPath.c_str(), "conversation/msg_input_panel");
- m_pSendButton = createButton(m_pLayout, CONV_SEND_IMG, "send_custom", SendButtonId);
- m_pAddButton = createButton(m_pLayout, CONV_ADD_IMG, "body_button", AddButtonId);
+ m_pSendButton = createSendButton(m_pLayout);
+ m_pAddButton = createAddButton(m_pLayout);
elm_object_part_content_set(m_pLayout, "swl.send_button", m_pSendButton);
elm_object_part_content_set(m_pLayout, "swl.add_button", m_pAddButton);
Evas_Object *MessageInputPanel::getIcon(Evas_Object *button)
{
- return elm_object_part_content_get(button, "button_center_part");
+ return elm_object_content_get(button);
}
void MessageInputPanel::setNormalColor(Evas_Object *button)
return nullptr;
}
-Evas_Object *MessageInputPanel::createButton(Evas_Object *parent, const char *iconRes, const char *style, ButtonId buttonId)
+Evas_Object *MessageInputPanel::createButton(Evas_Object *parent, ButtonId buttonId)
{
Evas_Object *button = elm_button_add(parent);
- elm_object_style_set(button, style);
+ elm_object_style_set(button, "transparent");
evas_object_data_set(button, buttonIdKey, (void*)buttonId);
evas_object_size_hint_weight_set(button, 0.0, 0.0);
- evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(MessageInputPanel, onButtonClicked), this);
+ evas_object_smart_callback_add(button, "pressed", SMART_CALLBACK(MessageInputPanel, onButtonPressed), this);
+ evas_object_smart_callback_add(button, "unpressed", SMART_CALLBACK(MessageInputPanel, onButtonUnpressed), this);
evas_object_show(button);
+ return button;
+}
+
+void MessageInputPanel::updateSendButtonTitle()
+{
+ //TODO: on language changed cb
+ std::string text = TextDecorator::make(msg("IDS_MSG_BUTTON_SEND_ABB3"), sendTextStyle);
+ elm_object_text_set(m_pSendLabel, text.c_str());
+}
+
+Evas_Object *MessageInputPanel::createSendButton(Evas_Object *parent)
+{
+ Evas_Object *button = createButton(parent, SendButtonId);
+
+ m_pSendLabel = elm_label_add(button);
+ updateSendButtonTitle();
+ elm_object_content_set(button, m_pSendLabel);
+ evas_object_show(m_pSendLabel);
+ evas_object_color_set(m_pSendLabel, BUTTON_COLOR);
+
+ return button;
+}
+
+Evas_Object *MessageInputPanel::createAddButton(Evas_Object *parent)
+{
+ Evas_Object *button = createButton(parent, AddButtonId);
Evas_Object *icon = elm_icon_add(button);
std::string resPath = PathUtils::getResourcePath(IMAGES_EDJ_PATH);
evas_object_show(icon);
- elm_image_file_set(icon, resPath.c_str(), iconRes);
+ elm_image_file_set(icon, resPath.c_str(), CONV_ADD_IMG);
evas_object_color_set(icon, BUTTON_COLOR);
- elm_object_part_content_set(button, "button_center_part", icon);
-
- evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(MessageInputPanel, onButtonClicked), this);
- evas_object_smart_callback_add(button, "pressed", SMART_CALLBACK(MessageInputPanel, onButtonPressed), this);
- evas_object_smart_callback_add(button, "unpressed", SMART_CALLBACK(MessageInputPanel, onButtonUnpressed), this);
+ elm_object_content_set(button, icon);
return button;
}