tag: "match" "+ color=#FFFFFF color_class=T1067";
}
}
-
+ group {
+ name: "conv/list/compose_layout";
+ parts {
+ part {
+ name: "content.pad.right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 0;
+ fixed: 1 0;
+ rel1{relative: 1.0 0.0;}
+ rel2{relative: 1.0 1.0;}
+ align: 1.0 0.0;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ min: 80 0;
+ }
+ }
+ part {
+ name: "pad.content";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; }
+ rel2 {to_x: "content.pad.right"; relative: 0.0 1.0; }
+ }
+ }
+ part {
+ name: "del_button";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ align: 1.0 0.0;
+ min: 56 56;
+ max: 56 56;
+ fixed: 1 1;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default";
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program { name: "show_del_button";
+ signal: "show_del_button";
+ source: "*";
+ action: STATE_SET "show" 0.0;
+ target: "content.pad.right";
+ target: "del_button";
+ }
+ program { name: "hide_del_button";
+ signal: "hide_del_button";
+ source: "*";
+ action: STATE_SET "default" 0.0;
+ target: "content.pad.right";
+ target: "del_button";
+ }
+ }
+ }
group {
name: "conv/list/1icon_1text";
parts {
group {
name: "conv/list/image_item";
+ inherit: "conv/list/compose_layout";
parts {
part {
name: "masking";
precise_is_inside: 1;
description {
state: "default" 0.0;
+ rel1.to: "content";
+ rel2.to: "content";
image.normal: "messages_attach_image_round_mask.#.png";
}
}
clip_to: "masking";
description {
state: "default" 0.0;
+ rel1.to: "pad.content";
+ rel2.to: "pad.content";
}
}
part {
name: "press_effect";
type: IMAGE;
+ repeat_events: 1;
description {
state: "default" 0.0;
+ rel1.to: "content";
+ rel2.to: "content";
image.normal: "messages_attach_image_round_mask.#.png";
color: 0 0 0 0;
}
part {
name: "line";
type: IMAGE;
+ repeat_events: 1;
description {
state: "default" 0.0;
+ rel1.to: "content";
+ rel2.to: "content";
image.normal: "messages_attach_image_round_line.#.png";
color: 0 0 0 51;
}
programs {
program { name: "pressed";
signal: "mouse,down,1";
- source: "*";
+ source: "content";
action: STATE_SET "pressed" 0.0;
target: "press_effect";
transition: LINEAR 0.1;
}
program { name: "unpressed";
signal: "mouse,up,1";
- source: "*";
+ source: "content";
action: STATE_SET "default" 0.0;
target: "press_effect";
transition: LINEAR 0.1;
group {
name: "conv/list/video_item";
+ inherit: "conv/list/compose_layout";
images {
image: "messages_play_btn.png" COMP;
}
precise_is_inside: 1;
description {
state: "default" 0.0;
+ rel1.to: "content";
+ rel2.to: "content";
image.normal: "messages_attach_image_round_mask.#.png";
}
}
clip_to: "masking";
description {
state: "default" 0.0;
- rel1 {
- relative: 0.0 0.0;
- }
- rel2 {
- relative: 1.0 1.0;
- }
+ rel1.to: "pad.content";
+ rel2.to: "pad.content";
}
}
part {
type: IMAGE;
description {
state: "default" 0.0;
+ rel1.to: "content";
+ rel2.to: "content";
image.normal: "messages_attach_image_round_line.#.png";
color: 0 0 0 51;
}
image.normal: "messages_play_btn.png";
max: 128 128;
align: 0.5 0.5;
- rel1 {
- to: "content";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "content";
- relative: 1.0 1.0;
- }
+ rel1.to: "content";
+ rel2.to: "content";
}
description {
state: "pressed";
inherit: "default";
- color: 190 190 190 255;
+ color: 170 170 170 255;
}
}
}
programs {
program { name: "pressed";
signal: "mouse,down,1";
- source: "*";
+ source: "play_button";
action: STATE_SET "pressed" 0.0;
transition: LINEAR 0.1;
target: "play_button";
}
program { name: "unpressed";
signal: "mouse,up,1";
- source: "*";
+ source: "play_button";
action: STATE_SET "default" 0.0;
transition: LINEAR 0.1;
target: "play_button";
group {
name: "conv/list/bubble_sent_bg";
+ inherit: "conv/list/compose_layout";
parts {
part {
name: "bg";
description {
state: "default";
image.normal: "messages_bubble_bg.#.png";
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 1.0; }
+ rel1.to: "pad.content";
+ rel2.to: "pad.content";
color: BUBBLE_BG_COLOR;
}
description {
rel2.to: "bg";
}
}
- PADDING_TOP("pad.top", 10);
- PADDING_BOTTOM("pad.bottom", 16);
- PADDING_LEFT("pad.left", 34);
- PADDING_RIGHT("pad.right", 34);
+ part {
+ name: "pad.left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 34 0;
+ fixed: 1 0;
+ rel1{to: "pad.content"; relative: 0.0 0.0;}
+ rel2{to: "pad.content"; relative: 0.0 1.0;}
+ align: 0.0 0.0;
+ }
+ }
+ part {
+ name: "pad.top";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 10;
+ fixed: 0 1;
+ rel1{to: "pad.content"; relative: 0.0 0.0;}
+ rel2{to: "pad.content"; relative: 1.0 0.0;}
+ align: 0.0 0.0;
+ }
+ }
+ part{
+ name: pad.bottom;
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 16;
+ fixed: 0 1;
+ rel1{to: "pad.content"; relative: 0.0 1.0;}
+ rel2{to: "pad.content"; relative: 1.0 1.0;}
+ align: 0.0 1.0;
+ }
+ }
+ part {
+ name: "pad.right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 34 0;
+ fixed: 1 0;
+ rel1{to: "pad.content"; relative: 1.0 0.0;}
+ rel2{to: "pad.content"; relative: 1.0 1.0;}
+ align: 1.0 0.0;
+ }
+ }
part {
name: "content";
type: SWALLOW;
programs {
program { name: "pressed";
signal: "mouse,down,1";
- source: "*";
+ source: "content";
action: STATE_SET "pressed" 0.0;
transition: LINEAR 0.1;
target: "bg";
}
program { name: "unpressed";
signal: "mouse,up,1";
- source: "*";
+ source: "content";
action: STATE_SET "default" 0.0;
transition: LINEAR 0.1;
target: "bg";
}
}
}
+ group {
+ name: "attach_del_icon";
+ images {
+ image: "messages_btn_del.png" RAW;
+ }
+ parts {
+ part {
+ name: "icon";
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ image.normal: "messages_btn_del.png";
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default";
+ color: 160 160 160 255;
+ }
+ }
+ }
+ programs {
+ program { name: "pressed";
+ source: "*";
+ signal: "pressed";
+ action: STATE_SET "pressed" 0.0;
+ target: "icon";
+ transition: LINEAR 0.1;
+ }
+ program { name: "unpressed";
+ source: "*";
+ signal: "unpressed";
+ action: STATE_SET "default" 0.0;
+ target: "icon";
+ transition: LINEAR 0.1;
+ }
+ }
+ }
}
virtual void calculate();
void setListener(IBubbleViewItemListener *l);
BubbleEntity &getEntity();
+ void showDelButton(bool show);
protected:
void emitActionEvent();
void attachGestureTapLayer(Evas_Object *parent, Evas_Object *obj);
private:
+ void onDelButtonClicked(Evas_Object *obj, void *eventInfo);
+
+ private:
BubbleEntity &m_Entity;
IBubbleViewItemListener *m_pListener;
+ Evas_Object *m_pDelButton;
};
class IBubbleViewItemListener
public:
virtual ~IBubbleViewItemListener() {};
virtual void onAction(BubbleViewItem &item) {}; // Tap or Click
+ virtual void onDelClecked(BubbleViewItem &item) {}; // Delete button clicked
};
}
*/
#include "BubbleViewItem.h"
+#include "Resource.h"
#include "Logger.h"
using namespace Msg;
-const int tapFingerSize = 12;
-
BubbleViewItem::BubbleViewItem(BubbleEntity &entity)
: m_Entity(entity)
, m_pListener(nullptr)
+ , m_pDelButton(nullptr)
{
-
}
BubbleViewItem::~BubbleViewItem()
void BubbleViewItem::attachGestureTapLayer(Evas_Object *parent, Evas_Object *obj)
{
+ const int tapFingerSize = 12;
+
Evas_Object *layer = elm_gesture_layer_add(parent);
evas_object_show(layer);
elm_gesture_layer_attach(layer, obj);
);
}
+void BubbleViewItem::showDelButton(bool show)
+{
+ if(!m_pDelButton)
+ {
+ m_pDelButton = elm_button_add(getEo());
+ elm_object_style_set(m_pDelButton, "transparent");
+ evas_object_smart_callback_add(m_pDelButton, "clicked", SMART_CALLBACK(BubbleViewItem, onDelButtonClicked), this);
+ evas_object_event_callback_add
+ (
+ m_pDelButton,
+ EVAS_CALLBACK_MOUSE_DOWN,
+ [](void *data, Evas *e, Evas_Object *obj, void *event_info)
+ {
+ if(!elm_object_disabled_get(obj))
+ emitSignal(elm_object_content_get(obj), "pressed", "*");
+ },
+ this
+ );
+ evas_object_event_callback_add
+ (
+ m_pDelButton,
+ EVAS_CALLBACK_MOUSE_UP,
+ [](void *data, Evas *e, Evas_Object *obj, void *event_info)
+ {
+ if(!elm_object_disabled_get(obj))
+ emitSignal(elm_object_content_get(obj), "unpressed", "*");
+ },
+ this
+ );
+
+ const char *delButtonPart = "del_button";
+
+ Evas_Object *icon = View::addLayout(m_pDelButton, ICONS_EDJ_PATH, "attach_del_icon");
+ elm_object_content_set(m_pDelButton, icon);
+
+ setContent(m_pDelButton, delButtonPart);
+ if(!getContent(delButtonPart))
+ {
+ MSG_LOG_ERROR("Layout has not 'del_button' part");
+ evas_object_del(m_pDelButton);
+ m_pDelButton = nullptr;
+ return;
+ }
+ }
+ const char *sig = show ? "show_del_button" : "hide_del_button";
+ emitSignal(sig, "*");
+}
+
+void BubbleViewItem::calculate()
+{
+ evas_object_smart_calculate(getEo());
+}
+
void BubbleViewItem::emitActionEvent()
{
if(m_pListener)
m_pListener->onAction(*this);
}
-void BubbleViewItem::calculate()
+void BubbleViewItem::onDelButtonClicked(Evas_Object *obj, void *eventInfo)
{
- evas_object_smart_calculate(getEo());
+ if(m_pListener)
+ m_pListener->onDelClecked(*this);
}