image: "badge_bg_draft.png" COMP;
image: "messages_bubble_bg.#.png" COMP;
image: "messages_bubble_bg_ef.#.png" COMP;
+ image: "messages_bubble_line_draft.#.png" COMP;
}
group {
#define BUBBLE_INFO_STATUS_WIDTH 30
#define BUBBLE_INFO_STATUS_PAD_WIDTH 4
#define BUBBLE_INFO_TEXT_HEIGHT 38
+#define BUBBLE_DRAFT_PAD_WIDTH 94
+#define BUBBLE_DRAFT_BUTTON_PAD_WIDTH 26
+#define BUBBLE_DRAFT_BUTTON_PAD_HEIGHT 7
+#define BUBBLE_DRAFT_BUTTON_WIDTH 56
+#define BUBBLE_DRAFT_BUTTON_HEIGHT 56
#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
+#define BUBBLE_BG_DRAFT_COLOR_PRESSED 80 94 153 255
group { name: "elm/genlist/item/sentbubble/default";
alias: "elm/genlist/item_compress/sentbubble/default";
data.item: "texts" "info.time";
data.item: "contents" "bubble.content info.thumbnail info.status info.status1 bubble.check";
parts{
- rect { "base"; scale;
+ spacer { "base"; scale; mouse;
desc { "default";
rel1.to_y: "info.pad";
rel2.to_y: "pad.bottom";
align: 0.0 0.0;
- color: 0 0 0 0;
}
}
swallow { "elm.swallow.bg"; scale;
group { name: "elm/genlist/item/draft/default";
alias: "elm/genlist/item_compress/draft/default";
inherit: "elm/genlist/item/sentbubble/default";
- //TODO: implement in next commit
+
+ data.item: "contents" "bubble.content info.thumbnail info.status info.status1 bubble.check draft.button";
+
+ parts {
+ image { "bubble.bg.image"; scale;
+ desc { "default";
+ image.normal: "messages_bubble_line_draft.#.png";
+ color: BUBBLE_BG_DRAFT_COLOR;
+ }
+ desc { "pressed";
+ color: BUBBLE_BG_DRAFT_COLOR_PRESSED;
+ }
+ }
+ spacer { "bubble.pad.right"; scale;
+ desc { "default";
+ rel2.to_x: "draft.pad";
+ }
+ }
+ spacer { "draft.pad"; scale;
+ desc { "default";
+ min: BUBBLE_DRAFT_PAD_WIDTH 0;
+ max: BUBBLE_DRAFT_PAD_WIDTH -1;
+ rel2.to_x: "pad.right";
+ rel2.relative: 0.0 0.0;
+ align: 1.0 0.0;
+ fixed: 1 0;
+ }
+ }
+ spacer { "draft.pad.button"; scale;
+ desc { "default";
+ min: BUBBLE_DRAFT_BUTTON_PAD_WIDTH BUBBLE_DRAFT_BUTTON_PAD_HEIGHT;
+ max: BUBBLE_DRAFT_BUTTON_PAD_WIDTH BUBBLE_DRAFT_BUTTON_PAD_HEIGHT;
+ rel1.to_x: "draft.pad";
+ rel1.to_y: "bubble.pad.top";
+ fixed: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ swallow { "draft.button"; scale;
+ desc { "default";
+ min: BUBBLE_DRAFT_BUTTON_WIDTH BUBBLE_DRAFT_BUTTON_HEIGHT;
+ max: BUBBLE_DRAFT_BUTTON_WIDTH BUBBLE_DRAFT_BUTTON_HEIGHT;
+ rel1.to: "draft.pad.button";
+ rel1.relative: 1.0 1.0;
+ align: 0.0 0.0;
+ }
+ }
+ }
}
group { name: "elm/genlist/item/receivebubble/default";
#define BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC 28 28
#define BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC 28 28
#define BUTTON_BG_BORDER_INC 8 8 8 8
+#define BUTTON_BG_WIDTH 56
+#define BUTTON_BG_HEIGHT 56
//text
#define BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC 249 249 249 255
scale: 1; \
description { \
state: "default" 0.0; \
- min: 40 40; \
- max: 40 40; \
+ min: BUTTON_BG_WIDTH BUTTON_BG_HEIGHT; \
+ max: BUTTON_BG_WIDTH BUTTON_BG_HEIGHT; \
image.normal: bg_image; \
} \
description { \
MSG_BUBBLE_BUTTON_STYLE("resend_button", "M01_circle_button_delete.png", "M01_circle_button_delete_press.png", "M01_circle_button_delete_dim.png", "M01_btn_warning.png")
MSG_BUBBLE_BUTTON_STYLE("scheduled_button", "M01_circle_button.png", "M01_circle_button_press.png", "M01_circle_button_dim.png", "M01_btn_schedule.png")
-MSG_BUBBLE_BUTTON_STYLE("edit_button", "M01_circle_button_press.png", "M01_circle_button_press.png", "M01_circle_button_press.png", "badge_icon_draft_pencil.png")
+MSG_BUBBLE_BUTTON_STYLE("edit_button", "M01_circle_button_press.png", "M01_circle_button.png", "M01_circle_button_dim.png", "badge_icon_draft_pencil.png")
#define MSG_BUTTON_CIRCLE_STYLE(style_name, image_normal, image_effect, image_dim_effect, min_width, min_height) \
group { name: "elm/button/base/"style_name; \
virtual std::string getText();
virtual std::string getTime();
+ virtual void onEditButtonClicked(Evas_Object *obj, void *event_info);
+
private:
ConvListViewItem::ConvItemType getConvItemType(MsgConversationItem &item);
MSG_LOG("");
}
+void ConvListItem::onEditButtonClicked(Evas_Object *obj, void *event_info)
+{
+ MSG_LOG("");
+}
+
virtual std::string getText() = 0;
virtual std::string getTime() = 0;
+ virtual void onEditButtonClicked(Evas_Object *obj, void *event_info) = 0;
+
private:
+ Evas_Object *getDraftButton(bool isEnabled);
virtual std::string getText(ListItem &item, const char *part);
virtual Evas_Object *getContent(ListItem &item, const char *part);
virtual const char *getCheckPart(ListItem &item);
*/
#include "ConvListViewItem.h"
+#include "CallbackAssist.h"
+#include "ListView.h"
using namespace Msg;
const char *bubbleContentPart = "bubble.content";
const char *thumbContentPart = "info.thumbnail";
const char *timeTextPart = "info.time";
+ const char *draftButtonPart = "draft.button";
+
+ const char *draftButtonStyle = "edit_button";
}
ConvListViewItem::ConvListViewItem(ConvItemType type)
return getBubble();
else if(!strcmp(part, thumbContentPart))
return getThumbnail();
+ else if(!strcmp(part, draftButtonPart))
+ return getDraftButton(!getOwner()->getCheckMode());
else
return nullptr;
}
{
return checkBoxPart;
}
+
+Evas_Object *ConvListViewItem::getDraftButton(bool isEnabled)
+{
+ Evas_Object *button = elm_button_add(*getOwner());
+ elm_object_style_set(button, draftButtonStyle);
+ evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(button);
+
+ if(isEnabled)
+ {
+ evas_object_propagate_events_set(button, EINA_FALSE);
+ evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(ConvListViewItem, onEditButtonClicked), this);
+ }
+ else
+ {
+ elm_object_disabled_set(button, EINA_TRUE);
+ }
+
+ return button;
+}