}
}
-//////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////
-// button for bubble warning / scheduled message /
-/////////////////////////////////////////////////////////////////
-#define MSG_BUBBLE_BUTTON_STYLE(style_name, bg_image, press_image, dim_image, btn_image) \
-group { \
- name: "elm/button/base/"style_name; \
- data.item: "focus_highlight" "on"; \
- images { \
- image: bg_image COMP; \
- image: press_image COMP; \
- image: dim_image COMP; \
- image: btn_image COMP; \
- } \
- parts { \
- part { \
- name: "button_image"; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- min: BUTTON_BG_WIDTH BUTTON_BG_HEIGHT; \
- max: BUTTON_BG_WIDTH BUTTON_BG_HEIGHT; \
- image.normal: bg_image; \
- } \
- description { \
- state: "clicked" 0.0; \
- inherit: "default" 0.0; \
- image.normal: press_image; \
- } \
- description { \
- state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- image.normal: dim_image; \
- } \
- } \
- part { \
- name: "left_top_padding"; \
- scale: 1; \
- type: SPACER; \
- description { \
- state: "default" 0.0; \
- min: 6 6; \
- max: 6 6; \
- fixed: 1 1; \
- align: 0.0 0.0; \
- rel1.to: "button_image"; \
- rel2.to: "button_image"; \
- } \
- } \
- part { \
- name: "right_bottom_padding"; \
- scale: 1; \
- type: SPACER; \
- description { \
- state: "default" 0.0; \
- min: 5 5; \
- max: 7 7; \
- fixed: 1 1; \
- align: 1.0 1.0; \
- rel1.to: "button_image"; \
- rel1.relative: 1.0 1.0; \
- rel2.to: "button_image"; \
- } \
- } \
- part { \
- name: "button_center_part"; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- min: 30 30; \
- max: 30 30; \
- image.normal: btn_image; \
- align: 0.5 0.5; \
- } \
- } \
- part { \
- name: "elm.swallow.icon.shadow.proxy"; \
- type: PROXY; \
- clip_to: "elm.icon.proxy.clipper"; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- source: "button_center_part"; \
- proxy.source_clip: 0; \
- rel1 { to: "button_center_part"; } \
- rel2 { to: "button_center_part"; } \
- } \
- description { \
- state: "clicked" 0.0; \
- inherit: "default" 0.0; \
- rel1 { to: "button_center_part"; } \
- rel2 { to: "button_center_part"; } \
- } \
- description { \
- state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- } \
- } \
- part { \
- name: "elm.swallow.icon.proxy"; \
- type: PROXY; \
- scale: 1; \
- clip_to: "icon_clipper"; \
- description { \
- state: "default" 0.0; \
- source: "button_center_part"; \
- proxy.source_clip: 0; \
- rel1.to: "button_center_part"; \
- rel2.to: "button_center_part"; \
- } \
- } \
- part { \
- name: "elm.icon.proxy.clipper"; \
- type: RECT; \
- description { \
- state: "default" 0.0; \
- color: 0 0 0 255; \
- } \
- description { \
- state: "clicked" 0.0; \
- color: 0 0 0 255; \
- } \
- description { \
- state: "disabled" 0.0; \
- color: 34 44 72 255; \
- } \
- } \
- part { \
- name: "icon_clipper"; \
- type: RECT; \
- scale: 1; \
- description { \
- state: "default" 0.0; \
- color: 250 250 250 255; \
- } \
- description { \
- state: "clicked" 0.0; \
- color: 250 250 250 255; \
- } \
- description { \
- state: "disabled" 0.0; \
- color: 166 167 169 255; \
- } \
- } \
- part { \
- name: "over1"; \
- type: RECT; \
- ignore_flags: ON_HOLD; \
- description { \
- state: "default" 0.0; \
- color: 0 0 0 0; \
- min: 30 30; \
- } \
- } \
- part { \
- name: "over2"; \
- type: RECT; \
- repeat_events: 1; \
- description { \
- state: "default" 0.0; \
- color: 0 0 0 0; \
- } \
- } \
- part { \
- name: "disabler"; \
- type: RECT; \
- description { \
- state: "default" 0.0; \
- color: 0 0 0 0; \
- visible: 0; \
- } \
- description { \
- state: "disabled" 0.0; \
- inherit: "default" 0.0; \
- visible: 1; \
- } \
- } \
- } \
- programs { \
- program { \
- name: "button_click"; \
- signal: "mouse,down,1"; \
- source: "over1"; \
- action: SIGNAL_EMIT "elm,action,press" ""; \
- after: "button_click_anim"; \
- } \
- program { \
- name: "button_click_anim"; \
- action: STATE_SET "clicked" 0.0; \
- target: "button_image"; \
- target: "elm.swallow.icon.shadow.proxy"; \
- target: "elm.icon.proxy.clipper"; \
- target: "icon_clipper"; \
- } \
- program { \
- name: "button_double_click"; \
- signal: "mouse,down,1,double"; \
- source: "over1"; \
- after: "button_click_anim"; \
- } \
- program { \
- name: "button_unclick"; \
- signal: "mouse,up,1"; \
- source: "over2"; \
- action: SIGNAL_EMIT "elm,action,unpress" ""; \
- after: "button_unclick_anim"; \
- } \
- program { \
- name: "button_unclick_anim"; \
- action: STATE_SET "default" 0.0; \
- target: "button_image"; \
- target: "elm.swallow.icon.shadow.proxy"; \
- target: "elm.icon.proxy.clipper"; \
- target: "icon_clipper"; \
- } \
- program { \
- name: "touch_snd"; \
- signal: "mouse,clicked,1"; \
- source: "over1"; \
- action: RUN_PLUGIN "touch_sound"; \
- after: "button_unclick3"; \
- } \
- program { \
- name: "button_unclick3"; \
- action: SIGNAL_EMIT "elm,action,click" ""; \
- } \
- program { \
- name: "disable"; \
- signal: "elm,state,disabled"; \
- source: "elm"; \
- action: STATE_SET "disabled" 0.0; \
- target: "disabler"; \
- target: "button_image"; \
- target: "elm.swallow.icon.shadow.proxy"; \
- target: "elm.icon.proxy.clipper"; \
- target: "icon_clipper"; \
- } \
- program { \
- name: "enable"; \
- signal: "elm,state,enabled"; \
- source: "elm"; \
- action: STATE_SET "default" 0.0; \
- target: "disabler"; \
- target: "button_image"; \
- target: "elm.swallow.icon.shadow.proxy"; \
- target: "elm.icon.proxy.clipper"; \
- target: "icon_clipper"; \
- } \
- } \
-}
-
-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.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; \
data { \
#include "ConvListViewItem.h"
#include "CallbackAssist.h"
#include "ListView.h"
+#include "Resource.h"
using namespace Msg;
const char *failedButtonPart = "failed.button";
const char *infoStatus = "info.status";
const char *msgType = "msg.type";
-
- const char *draftButtonStyle = "edit_button";
- const char *failedButtonStyle = "resend_button";
}
ConvListViewItem::ConvListViewItem(ConvItemType type)
Evas_Object *ConvListViewItem::createButton(bool isEnabled, ConvItemType type)
{
- Evas_Object *button = nullptr;
- if(type == Draft || type == Failed)
- {
- button = elm_button_add(*getOwner());
- if(type == Draft)
+ Evas_Object *button = elm_button_add(*getOwner());
+ evas_object_event_callback_add
+ (
+ button,
+ EVAS_CALLBACK_MOUSE_DOWN,
+ [](void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- elm_object_style_set(button, draftButtonStyle);
- evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(ConvListViewItem, onEditButtonClicked), this);
- }
- else if(type == Failed)
+ if(!elm_object_disabled_get(obj))
+ elm_object_signal_emit(elm_object_content_get(obj), "pressed", "*");
+ },
+ this
+ );
+ evas_object_event_callback_add
+ (
+ button,
+ EVAS_CALLBACK_MOUSE_UP,
+ [](void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- elm_object_style_set(button, failedButtonStyle);
- evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(ConvListViewItem, onFailedButtonClicked), this);
- }
- View::expand(button);
- evas_object_show(button);
+ if(!elm_object_disabled_get(obj))
+ elm_object_signal_emit(elm_object_content_get(obj), "unpressed", "*");
+ },
+ this
+ );
- evas_object_propagate_events_set(button, !isEnabled);
- elm_object_disabled_set(button, !isEnabled);
+ elm_object_style_set(button, "transparent");
+ Evas_Object *icon = nullptr;
+ evas_object_show(icon);
+ if(type == Draft)
+ {
+ icon = View::addLayout(button, ICONS_EDJ_PATH, "draft_icon");
+ evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(ConvListViewItem, onEditButtonClicked), this);
}
+ else if(type == Failed)
+ {
+ icon = View::addLayout(button, ICONS_EDJ_PATH, "failed_icon");
+ evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(ConvListViewItem, onFailedButtonClicked), this);
+ }
+
+ elm_object_content_set(button, icon);
+ evas_object_propagate_events_set(button, !isEnabled);
+ elm_object_disabled_set(button, !isEnabled);
+
return button;
}