forked from enlightenment/efl
parent
ed6cd22ddf
commit
bad1264722
|
@ -8894,6 +8894,13 @@ collections {
|
|||
image: "bubble_shine3.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "event";
|
||||
type: RECT;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.icon";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -9042,6 +9049,13 @@ collections {
|
|||
image: "bubble_shine4.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "event";
|
||||
type: RECT;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.icon";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -9190,6 +9204,13 @@ collections {
|
|||
image: "bubble_shine.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "event";
|
||||
type: RECT;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.icon";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -9338,6 +9359,13 @@ collections {
|
|||
image: "bubble_shine.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part { name: "event";
|
||||
type: RECT;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.icon";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
|
|
|
@ -3,6 +3,13 @@
|
|||
# include "elementary_config.h"
|
||||
#endif
|
||||
#ifndef ELM_LIB_QUICKLAUNCH
|
||||
|
||||
static void
|
||||
_print_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
printf("bubble clicked\n");
|
||||
}
|
||||
|
||||
static void
|
||||
my_anchorblock_bt(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -143,6 +150,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
|
|||
elm_bubble_label_set(bb, "Message 3");
|
||||
elm_bubble_info_set(bb, "10:32 4/11/2008");
|
||||
elm_bubble_icon_set(bb, ic);
|
||||
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
|
||||
evas_object_show(ic);
|
||||
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -169,6 +177,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
|
|||
elm_bubble_label_set(bb, "Message 2");
|
||||
elm_bubble_info_set(bb, "7:16 27/10/2008");
|
||||
elm_bubble_icon_set(bb, ic);
|
||||
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
|
||||
evas_object_show(ic);
|
||||
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -205,6 +214,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
|
|||
elm_bubble_label_set(bb, "Message 1");
|
||||
elm_bubble_info_set(bb, "20:47 18/6/2008");
|
||||
elm_bubble_icon_set(bb, ic);
|
||||
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
|
||||
evas_object_show(ic);
|
||||
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
|
|
@ -3,6 +3,13 @@
|
|||
# include "elementary_config.h"
|
||||
#endif
|
||||
#ifndef ELM_LIB_QUICKLAUNCH
|
||||
|
||||
static void
|
||||
_print_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
printf("bubble clicked\n");
|
||||
}
|
||||
|
||||
void
|
||||
test_bubble(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -34,6 +41,7 @@ test_bubble(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
elm_bubble_info_set(bb, "Corner: bottom_right");
|
||||
elm_bubble_icon_set(bb, ic);
|
||||
elm_bubble_corner_set(bb, "bottom_right");
|
||||
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
|
||||
evas_object_show(ic);
|
||||
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -56,6 +64,7 @@ test_bubble(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
elm_bubble_label_set(bb, "Message 2");
|
||||
elm_bubble_info_set(bb, "10:32 4/11/2008");
|
||||
elm_bubble_icon_set(bb, ic);
|
||||
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
|
||||
evas_object_show(ic);
|
||||
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
|
|
@ -1234,6 +1234,7 @@ extern "C" {
|
|||
EAPI void elm_bubble_corner_set(Evas_Object *obj, const char *corner);
|
||||
EAPI const char* elm_bubble_corner_get(const Evas_Object *obj);
|
||||
/* smart callbacks called:
|
||||
* "clicked" - the user clicked the bubble
|
||||
*/
|
||||
|
||||
/* photo */
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
*
|
||||
* The Bubble is an widget used to show a text in a frame as speech is
|
||||
* represented in comics.
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
* clicked - This is called when a user has clicked the bubble.
|
||||
*/
|
||||
|
||||
typedef struct _Widget_Data Widget_Data;
|
||||
|
@ -24,6 +28,13 @@ static void _sizing_eval(Evas_Object *obj);
|
|||
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
|
||||
|
||||
#define SIG_CLICKED "clicked"
|
||||
static const Evas_Smart_Cb_Description _signals[] =
|
||||
{
|
||||
{SIG_CLICKED, ""},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static void
|
||||
_del_hook(Evas_Object *obj)
|
||||
{
|
||||
|
@ -110,6 +121,15 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
|||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Up *ev = event_info;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
return;
|
||||
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new bubble to the parent
|
||||
*
|
||||
|
@ -146,7 +166,10 @@ elm_bubble_add(Evas_Object *parent)
|
|||
elm_widget_resize_object_set(obj, wd->bbl);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
evas_object_event_callback_add(wd->bbl, EVAS_CALLBACK_MOUSE_UP,
|
||||
_mouse_up, obj);
|
||||
|
||||
evas_object_smart_callbacks_descriptions_set(obj, _signals);
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue