2012-03-05 15:51:56 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2017-09-20 03:36:39 -07:00
|
|
|
|
2012-03-29 12:27:13 -07:00
|
|
|
#include <Elementary.h>
|
2013-11-04 00:54:31 -08:00
|
|
|
|
2014-04-29 09:21:53 -07:00
|
|
|
#define POPUP_POINT_MAX 8
|
2013-12-01 23:10:53 -08:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double x;
|
|
|
|
double y;
|
2013-12-02 04:17:06 -08:00
|
|
|
} Evas_Rel_Coord_Point;
|
2012-03-05 15:51:56 -08:00
|
|
|
|
2012-04-08 21:48:09 -07:00
|
|
|
static Evas_Object *g_popup = NULL;
|
|
|
|
static int times = 0;
|
2015-08-15 08:32:33 -07:00
|
|
|
static Eina_Bool is_popup_scroll;
|
2013-12-01 23:10:53 -08:00
|
|
|
static Evas_Rel_Coord_Point _popup_point[POPUP_POINT_MAX] =
|
|
|
|
{
|
|
|
|
{ 0.01, 0.01 },
|
|
|
|
{ 0.2, 0.2 },
|
|
|
|
{ 0.5, 0.5 },
|
|
|
|
{ 0.99, 0.01 },
|
|
|
|
{ 0.01, 0.99 },
|
2014-04-29 09:21:53 -07:00
|
|
|
{ 0.99, 0.99 },
|
|
|
|
{ 0.0, 0.0 },
|
|
|
|
{ 1.5, 1.5 }
|
2013-12-01 23:10:53 -08:00
|
|
|
};
|
2012-04-08 21:48:09 -07:00
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_response_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_del(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_close_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2013-08-13 07:59:22 -07:00
|
|
|
{
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_del(data);
|
|
|
|
}
|
|
|
|
|
2015-12-30 20:08:28 -08:00
|
|
|
static void
|
|
|
|
_popup_dismiss_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
elm_popup_dismiss(data);
|
|
|
|
}
|
|
|
|
|
2013-12-01 23:10:53 -08:00
|
|
|
static void
|
2013-12-02 04:17:06 -08:00
|
|
|
_popup_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
2013-12-01 23:10:53 -08:00
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
static int k = 0;
|
|
|
|
double h = -1, v = -1;
|
|
|
|
|
|
|
|
elm_popup_align_set(data, _popup_point[k].x, _popup_point[k].y);
|
|
|
|
elm_popup_align_get(data, &h, &v);
|
|
|
|
|
|
|
|
printf("elm_popup_align_get :: Aligned: %lf %lf\n", h, v);
|
|
|
|
|
|
|
|
k++;
|
|
|
|
if (k >= POPUP_POINT_MAX)
|
|
|
|
k = 0;
|
|
|
|
}
|
|
|
|
|
2012-04-08 21:48:09 -07:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_g_popup_response_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-04-08 21:48:09 -07:00
|
|
|
{
|
|
|
|
evas_object_hide(data);
|
|
|
|
}
|
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_restack_block_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
2013-08-13 07:59:22 -07:00
|
|
|
// remove restacked image if there is any
|
2012-03-30 02:56:22 -07:00
|
|
|
Evas_Object *popup_data = evas_object_data_get(obj, "im");
|
|
|
|
if (popup_data) evas_object_del(popup_data);
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_del(obj);
|
|
|
|
}
|
|
|
|
|
2013-08-13 07:59:22 -07:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_restack_popup_close_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2013-08-13 07:59:22 -07:00
|
|
|
{
|
|
|
|
Evas_Object *popup_data = evas_object_data_get(data, "im");
|
|
|
|
if (popup_data) evas_object_del(popup_data);
|
|
|
|
evas_object_del(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-11-24 21:05:17 -08:00
|
|
|
_block_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2013-08-13 07:59:22 -07:00
|
|
|
{
|
2013-11-24 21:05:17 -08:00
|
|
|
if (data)
|
|
|
|
evas_object_del(data);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_del(obj);
|
|
|
|
}
|
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_item_selected_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
2012-03-05 15:51:56 -08:00
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
printf("popup item selected: %s\n", elm_object_item_text_get(event_info));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_click(void *data EINA_UNUSED, Evas_Object *obj,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
Elm_Object_Item *it = elm_list_selected_item_get(obj);
|
|
|
|
if (!it) return;
|
|
|
|
elm_list_item_selected_set(it, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
2014-11-23 22:29:39 -08:00
|
|
|
static void
|
|
|
|
_popup_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
|
|
|
|
printf("Key: %s\n", ev->keyname);
|
|
|
|
}
|
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_center_text_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
2015-08-15 08:32:33 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_text_set(popup, "This Popup has content area and "
|
|
|
|
"timeout value is 3 seconds");
|
|
|
|
elm_popup_timeout_set(popup, 3.0);
|
notify: fix hide animation logic for popup
Summary:
When popup is timeout, notify call hide func, and send time out event to popup.
After popup receiving time out event, popup hide object again,
so hide animation doesn't show.
And notify hide function doesn't send hide signal to block events part,
(but dismiss function send it)
So add that signal.
Test Plan:
1. elementary_test -to popup
2. click first item, "popup+center+text"
3. compare time out event before this patch and after.
@fix
Reviewers: herb, singh.amitesh, Hermet, cedric, raster, jpeg
Differential Revision: https://phab.enlightenment.org/D4780
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-04-12 14:25:51 -07:00
|
|
|
evas_object_smart_callback_add(popup, "dismissed", _response_cb, popup);
|
2014-11-23 22:29:39 -08:00
|
|
|
evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_DOWN,
|
|
|
|
_popup_key_down_cb, NULL);
|
2013-09-03 18:02:03 -07:00
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_center_text_1button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btn;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
2015-08-15 08:32:33 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_text_set(popup, "This Popup has content area and "
|
|
|
|
"action area set, action area has one button Close");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-03-05 15:51:56 -08:00
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_center_title_text_1button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btn;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
2015-08-15 08:32:33 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup text
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_text_set(popup, "This Popup has title area, content area and "
|
|
|
|
"action area set, action area has one button Close");
|
2013-06-09 23:13:17 -07:00
|
|
|
// popup title
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-03-05 15:51:56 -08:00
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_popup_center_title_text_block_clicked_event_cb(void *data,
|
2013-08-31 18:18:03 -07:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
2015-08-15 08:32:33 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-06-09 23:13:17 -07:00
|
|
|
evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
// popup text
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_text_set(popup, "This Popup has title area and content area. "
|
|
|
|
"When clicked on blocked event region, popup gets "
|
|
|
|
"deleted");
|
2013-06-09 23:13:17 -07:00
|
|
|
// popup title
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2013-11-24 21:05:17 -08:00
|
|
|
static void
|
|
|
|
_popup_center_title_text_block_clicked_event_with_parent_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Object *bg, *popup;
|
|
|
|
|
|
|
|
bg = elm_bg_add(data);
|
|
|
|
elm_bg_color_set(bg, 255, 0, 0);
|
|
|
|
evas_object_resize(bg, 350, 200);
|
|
|
|
evas_object_move(bg, 100, 100);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
popup = elm_popup_add(bg);
|
2015-08-15 08:32:33 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-11-24 21:05:17 -08:00
|
|
|
evas_object_smart_callback_add(popup, "block,clicked",
|
|
|
|
_block_clicked_cb, bg);
|
|
|
|
|
|
|
|
// popup text
|
|
|
|
elm_object_text_set(popup, "This Popup has title area and content area. "
|
|
|
|
"Its blocked event region is a small rectangle. "
|
|
|
|
"When clicked on blocked event region, popup gets "
|
|
|
|
"deleted");
|
|
|
|
// popup title
|
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_bottom_title_text_3button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *icon, *btn1, *btn2, *btn3;
|
|
|
|
char buf[256];
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
2015-08-15 08:32:33 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_BOTTOM);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup text
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_text_set(popup, "This Popup has title area, content area and "
|
|
|
|
"action area set with content being character wrapped. "
|
|
|
|
"action area has three buttons OK, Cancel and Close");
|
|
|
|
elm_popup_content_text_wrap_type_set(popup, ELM_WRAP_CHAR);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup title
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup title icon
|
2012-03-05 15:51:56 -08:00
|
|
|
icon = elm_icon_add(popup);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
|
|
|
|
elm_app_data_dir_get());
|
2012-05-28 14:50:11 -07:00
|
|
|
elm_image_file_set(icon, buf, NULL);
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_part_content_set(popup, "title,icon", icon);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-03-05 15:51:56 -08:00
|
|
|
btn1 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn1, "OK");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn1);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn1, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
btn2 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn2, "Cancel");
|
|
|
|
elm_object_part_content_set(popup, "button2", btn2);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn2, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
btn3 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn3, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button3", btn3);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn3, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_center_title_content_3button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *icon, *btn, *btn1, *btn2, *btn3;
|
|
|
|
char buf[256];
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup title
|
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
|
|
|
|
|
|
|
// popup content
|
2012-03-05 15:51:56 -08:00
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Content");
|
|
|
|
icon = elm_icon_add(btn);
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
|
|
|
|
elm_app_data_dir_get());
|
2012-05-28 14:50:11 -07:00
|
|
|
elm_image_file_set(icon, buf, NULL);
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_content_set(btn, icon);
|
|
|
|
elm_object_content_set(popup, btn);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-03-05 15:51:56 -08:00
|
|
|
btn1 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn1, "OK");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn1);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn1, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
btn2 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn2, "Cancel");
|
|
|
|
elm_object_part_content_set(popup, "button2", btn2);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn2, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
btn3 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn3, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button3", btn3);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn3, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2014-02-17 11:03:34 -08:00
|
|
|
static void
|
|
|
|
_item_focused_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Object_Item *it = event_info;
|
|
|
|
|
|
|
|
printf("item,focused:%p\n", it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_unfocused_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Object_Item *it = event_info;
|
|
|
|
|
|
|
|
printf("item,unfocused:%p\n", it);
|
|
|
|
}
|
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_center_title_item_3button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
unsigned int i;
|
|
|
|
Evas_Object *popup, *icon1, *btn1, *btn2, *btn3;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup title
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup items
|
|
|
|
icon1 = elm_icon_add(popup);
|
2012-03-05 15:51:56 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
|
|
|
|
elm_app_data_dir_get());
|
2012-05-28 14:50:11 -07:00
|
|
|
elm_image_file_set(icon1, buf, NULL);
|
2014-02-25 08:41:11 -08:00
|
|
|
for (i = 0; i < 20; i++)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Item%u", i+1);
|
|
|
|
if (i == 3)
|
|
|
|
elm_popup_item_append(popup, buf, icon1, _item_selected_cb, NULL);
|
|
|
|
else
|
|
|
|
elm_popup_item_append(popup, buf, NULL, _item_selected_cb, NULL);
|
|
|
|
}
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-03-05 15:51:56 -08:00
|
|
|
btn1 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn1, "OK");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn1);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn1, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
btn2 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn2, "Cancel");
|
|
|
|
elm_object_part_content_set(popup, "button2", btn2);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn2, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
btn3 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn3, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button3", btn3);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn3, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-05 15:51:56 -08:00
|
|
|
evas_object_show(popup);
|
2014-02-17 11:03:34 -08:00
|
|
|
evas_object_smart_callback_add(popup, "item,focused", _item_focused_cb, NULL);
|
|
|
|
evas_object_smart_callback_add(popup, "item,unfocused", _item_unfocused_cb, NULL);
|
2012-03-05 15:51:56 -08:00
|
|
|
}
|
|
|
|
|
2012-03-30 02:56:22 -07:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_restack_btn_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2012-03-30 02:56:22 -07:00
|
|
|
{
|
|
|
|
Evas_Object *im;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
void *popup_data;
|
|
|
|
|
|
|
|
popup_data = evas_object_data_get(data, "im");
|
|
|
|
if (popup_data) return;
|
|
|
|
|
|
|
|
im = evas_object_image_filled_add(evas_object_evas_get(obj));
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/%s",
|
|
|
|
elm_app_data_dir_get(), "twofish.jpg");
|
|
|
|
evas_object_image_file_set(im, buf, NULL);
|
|
|
|
evas_object_move(im, 40, 40);
|
|
|
|
evas_object_resize(im, 320, 320);
|
|
|
|
evas_object_show(im);
|
|
|
|
evas_object_data_set((Evas_Object *)data, "im", im);
|
|
|
|
|
|
|
|
evas_object_raise((Evas_Object *)data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_center_title_text_2button_restack_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-30 02:56:22 -07:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btn, *btn2;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(popup, "block,clicked",
|
|
|
|
_restack_block_clicked_cb, NULL);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup text
|
2012-03-30 02:56:22 -07:00
|
|
|
elm_object_text_set(popup, "When you click the 'Restack' button, "
|
|
|
|
"an image will be located under this popup");
|
2013-06-09 23:13:17 -07:00
|
|
|
// popup title
|
2012-03-30 02:56:22 -07:00
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-03-30 02:56:22 -07:00
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Restack");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _restack_btn_clicked, popup);
|
|
|
|
|
|
|
|
btn2 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn2, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button2", btn2);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn2, "clicked",
|
|
|
|
_restack_popup_close_cb, popup);
|
2012-03-30 02:56:22 -07:00
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-03-30 02:56:22 -07:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2012-04-08 21:48:09 -07:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_center_text_1button_hide_show_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-04-08 21:48:09 -07:00
|
|
|
{
|
|
|
|
Evas_Object *btn;
|
|
|
|
char str[128];
|
|
|
|
|
|
|
|
times++;
|
|
|
|
if (g_popup)
|
|
|
|
{
|
|
|
|
sprintf(str, "You have checked this popup %d times.", times);
|
|
|
|
elm_object_text_set(g_popup, str);
|
|
|
|
evas_object_show(g_popup);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(g_popup, is_popup_scroll);
|
2012-04-08 21:48:09 -07:00
|
|
|
elm_object_text_set(g_popup, "Hide this popup by using the button."
|
|
|
|
"When you click list item again, you can see this popup.");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-04-08 21:48:09 -07:00
|
|
|
btn = elm_button_add(g_popup);
|
|
|
|
elm_object_text_set(btn, "Hide");
|
|
|
|
elm_object_part_content_set(g_popup, "button1", btn);
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _g_popup_response_cb, g_popup);
|
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-04-08 21:48:09 -07:00
|
|
|
evas_object_show(g_popup);
|
|
|
|
}
|
|
|
|
|
2013-10-13 08:57:42 -07:00
|
|
|
static void
|
|
|
|
_toggle_button_cb(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Object *btn = data;
|
|
|
|
char buf[] = "button0";
|
|
|
|
int i;
|
|
|
|
|
|
|
|
i = (int)(uintptr_t)evas_object_data_get(btn, "index");
|
|
|
|
|
|
|
|
buf[6] = '0' + i + 1;
|
|
|
|
if (evas_object_visible_get(btn))
|
|
|
|
{
|
|
|
|
elm_object_part_content_unset(obj, buf);
|
|
|
|
evas_object_hide(btn);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
elm_object_part_content_set(obj, buf, btn);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_popup_center_text_3button_add_remove_button_cb(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btns[3];
|
|
|
|
|
|
|
|
char buf[256];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-10-13 08:57:42 -07:00
|
|
|
|
|
|
|
// popup title
|
|
|
|
elm_object_part_text_set(popup, "title,text",
|
|
|
|
"Click the item to toggle button");
|
|
|
|
|
|
|
|
// popup buttons
|
|
|
|
for (i = 0; i < 3; ++i)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "Btn #%d", i + 1);
|
|
|
|
btns[i] = elm_button_add(popup);
|
|
|
|
evas_object_data_set(btns[i], "index", (void*)(uintptr_t)i);
|
|
|
|
elm_object_text_set(btns[i], buf);
|
|
|
|
|
|
|
|
elm_popup_item_append(popup, buf, NULL, _toggle_button_cb, btns[i]);
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "button%d", i + 1);
|
|
|
|
elm_object_part_content_set(popup, buf, btns[i]);
|
|
|
|
evas_object_smart_callback_add(btns[i], "clicked",
|
|
|
|
_popup_close_cb, popup);
|
|
|
|
}
|
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2012-09-03 02:26:57 -07:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_popup_transparent_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-09-03 02:26:57 -07:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btn;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2012-09-03 02:26:57 -07:00
|
|
|
elm_object_style_set(popup, "transparent");
|
|
|
|
elm_object_text_set(popup, "This Popup has transparent background");
|
2013-06-09 23:13:17 -07:00
|
|
|
|
|
|
|
// popup buttons
|
2012-09-03 02:26:57 -07:00
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
2013-09-03 18:02:03 -07:00
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2012-09-03 02:26:57 -07:00
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2013-12-01 23:10:53 -08:00
|
|
|
static void
|
2013-12-02 04:17:06 -08:00
|
|
|
_popup_transparent_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2013-12-01 23:10:53 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btn, *btn1;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-12-01 23:10:53 -08:00
|
|
|
elm_object_style_set(popup, "transparent");
|
|
|
|
elm_object_text_set(popup, "This Popup has transparent background");
|
|
|
|
|
|
|
|
// popup buttons
|
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Move");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
2013-12-02 04:17:06 -08:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_align_cb, popup);
|
2013-12-01 23:10:53 -08:00
|
|
|
|
|
|
|
btn1 = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn1, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button2", btn1);
|
|
|
|
evas_object_smart_callback_add(btn1, "clicked", _popup_close_cb, popup);
|
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2012-11-27 07:21:20 -08:00
|
|
|
static void
|
2013-08-31 18:18:03 -07:00
|
|
|
_list_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-11-27 07:21:20 -08:00
|
|
|
{
|
|
|
|
evas_object_del(data);
|
|
|
|
}
|
|
|
|
|
2015-03-03 02:58:40 -08:00
|
|
|
char *
|
|
|
|
gl_popup_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
snprintf(buf, sizeof(buf), "Item # %i", (int)(uintptr_t)data);
|
|
|
|
return strdup(buf);
|
|
|
|
}
|
|
|
|
|
2012-11-27 07:21:20 -08:00
|
|
|
static void
|
2017-07-14 03:46:33 -07:00
|
|
|
_delete_btn_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2017-07-10 23:36:06 -07:00
|
|
|
{
|
|
|
|
elm_object_content_set(data, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_popup_center_title_list_content_2button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
2013-08-31 18:18:03 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2012-11-27 07:21:20 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup, *list;
|
|
|
|
Evas_Object *btn;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2012-11-27 07:21:20 -08:00
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
|
|
|
|
2013-06-09 23:13:17 -07:00
|
|
|
// list as a popup content
|
2012-11-27 07:21:20 -08:00
|
|
|
list = elm_list_add(popup);
|
|
|
|
elm_list_mode_set(list, ELM_LIST_EXPAND);
|
|
|
|
elm_list_item_append(list, "List Item #1", NULL, NULL, _list_cb, popup);
|
|
|
|
elm_list_item_append(list, "List Item #2", NULL, NULL, _list_cb, popup);
|
|
|
|
elm_list_item_append(list, "List Item #3", NULL, NULL, _list_cb, popup);
|
|
|
|
elm_object_content_set(popup, list);
|
|
|
|
|
2013-06-09 23:13:17 -07:00
|
|
|
// popup buttons
|
2012-11-27 07:21:20 -08:00
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "OK");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
2013-08-13 07:59:22 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
2013-06-09 23:13:17 -07:00
|
|
|
|
2017-07-10 23:36:06 -07:00
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Delete");
|
|
|
|
elm_object_part_content_set(popup, "button2", btn);
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _delete_btn_clicked, popup);
|
|
|
|
|
2013-09-03 18:02:03 -07:00
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
2013-06-09 23:13:17 -07:00
|
|
|
evas_object_show(popup);
|
2012-11-27 07:21:20 -08:00
|
|
|
}
|
|
|
|
|
2015-03-03 02:58:40 -08:00
|
|
|
static void
|
|
|
|
_popup_center_title_genlist_content_1button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Object *popup, *genlist;
|
|
|
|
Evas_Object *btn;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2015-03-03 02:58:40 -08:00
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
|
|
|
|
|
|
|
Elm_Genlist_Item_Class *itc1 = elm_genlist_item_class_new();
|
|
|
|
itc1->item_style = "default";
|
|
|
|
itc1->func.text_get = gl_popup_text_get;
|
|
|
|
itc1->func.content_get = NULL;
|
|
|
|
itc1->func.state_get = NULL;
|
|
|
|
itc1->func.del = NULL;
|
|
|
|
|
|
|
|
// genlist as a popup content
|
|
|
|
genlist = elm_genlist_add(popup);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_genlist_mode_set(genlist, ELM_LIST_EXPAND);
|
2015-03-03 02:58:40 -08:00
|
|
|
elm_scroller_content_min_limit(genlist, EINA_FALSE, EINA_TRUE);
|
|
|
|
|
|
|
|
for (i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
elm_genlist_item_append(genlist,
|
|
|
|
itc1,
|
|
|
|
(void *)(uintptr_t)i/* item data */,
|
|
|
|
NULL/* parent */,
|
|
|
|
ELM_GENLIST_ITEM_NONE,
|
|
|
|
NULL,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
elm_genlist_item_class_free(itc1);
|
|
|
|
elm_object_content_set(popup, genlist);
|
|
|
|
|
|
|
|
// popup buttons
|
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "OK");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2013-12-28 00:33:10 -08:00
|
|
|
static void
|
|
|
|
_subpopup_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
2015-08-03 10:25:51 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2013-12-28 00:33:10 -08:00
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btn, *btnclose;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2013-12-28 00:33:10 -08:00
|
|
|
elm_object_style_set(popup, "subpopup");
|
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
|
|
|
|
|
|
|
// button as a popup content
|
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "content");
|
2015-08-05 02:34:30 -07:00
|
|
|
elm_object_content_set(popup, btn);
|
2013-12-28 00:33:10 -08:00
|
|
|
|
|
|
|
// popup buttons
|
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "OK");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
|
|
|
|
|
|
|
//popup-base close button
|
|
|
|
btnclose = elm_button_add(popup);
|
|
|
|
//TODO: write a X style button theme
|
|
|
|
elm_object_text_set(btnclose, "x");
|
|
|
|
elm_object_part_content_set(popup, "elm.swallow.closebtn", btnclose);
|
|
|
|
evas_object_smart_callback_add(btnclose, "clicked", _popup_close_cb, popup);
|
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2015-08-03 10:25:51 -07:00
|
|
|
static void
|
|
|
|
_popup_content_only_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Object *popup, *bx, *hbx, *lbl, *btn;
|
|
|
|
Evas_Object *win = data;
|
|
|
|
|
|
|
|
popup = elm_popup_add(win);
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
2015-08-03 10:25:51 -07:00
|
|
|
|
|
|
|
bx = elm_box_add(popup);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.0);
|
|
|
|
elm_object_content_set(popup, bx);
|
|
|
|
|
|
|
|
lbl = elm_label_add(popup);
|
|
|
|
elm_object_text_set(lbl,
|
|
|
|
"<align=center>This popup contains content area only.<br>"
|
|
|
|
"The buttons below are the part of content area, not action area");
|
|
|
|
evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, 0.0);
|
|
|
|
elm_box_pack_end(bx, lbl);
|
|
|
|
evas_object_show(lbl);
|
|
|
|
|
|
|
|
hbx = elm_box_add(bx);
|
|
|
|
elm_box_horizontal_set(hbx, EINA_TRUE);
|
|
|
|
evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0.0);
|
|
|
|
elm_box_pack_end(bx, hbx);
|
|
|
|
evas_object_show(hbx);
|
|
|
|
|
|
|
|
btn = elm_button_add(hbx);
|
|
|
|
elm_object_text_set(btn, "Save");
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
|
|
|
elm_box_pack_end(hbx, btn);
|
|
|
|
evas_object_show(btn);
|
|
|
|
|
|
|
|
btn = elm_button_add(hbx);
|
|
|
|
elm_object_text_set(btn, "Discard");
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
|
|
|
elm_box_pack_end(hbx, btn);
|
|
|
|
evas_object_show(btn);
|
|
|
|
|
|
|
|
btn = elm_button_add(hbx);
|
|
|
|
elm_object_text_set(btn, "Cancel");
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
|
|
|
elm_box_pack_end(hbx, btn);
|
|
|
|
evas_object_show(btn);
|
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
|
|
|
evas_object_show(popup);
|
|
|
|
elm_object_focus_set(btn, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
2015-12-30 20:08:28 -08:00
|
|
|
static void
|
|
|
|
_popup_center_title_text_1button_hide_effect_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Object *popup;
|
|
|
|
Evas_Object *btn;
|
|
|
|
|
|
|
|
popup = elm_popup_add(data);
|
|
|
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
|
|
|
|
|
|
|
// popup text
|
|
|
|
elm_object_text_set(popup, "This Popup has title area, content area and "
|
|
|
|
"action area set, action area has one button Close");
|
|
|
|
// popup title
|
|
|
|
elm_object_part_text_set(popup, "title,text", "Title");
|
|
|
|
|
|
|
|
// popup buttons
|
|
|
|
btn = elm_button_add(popup);
|
|
|
|
elm_object_text_set(btn, "Close");
|
|
|
|
elm_object_part_content_set(popup, "button1", btn);
|
|
|
|
evas_object_smart_callback_add(popup, "dismissed", _response_cb, NULL);
|
|
|
|
evas_object_smart_callback_add(btn, "clicked", _popup_dismiss_btn_cb, popup);
|
|
|
|
|
|
|
|
// popup show should be called after adding all the contents and the buttons
|
|
|
|
// of popup to set the focus into popup's contents correctly.
|
|
|
|
evas_object_show(popup);
|
|
|
|
}
|
|
|
|
|
2014-02-25 08:52:03 -08:00
|
|
|
static void
|
|
|
|
_focus_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eina_Bool check = elm_check_state_get(obj);
|
|
|
|
elm_win_focus_highlight_enabled_set(data, check);
|
|
|
|
elm_win_focus_highlight_animate_set(data, check);
|
|
|
|
}
|
|
|
|
|
2015-08-15 08:32:33 -07:00
|
|
|
static void
|
|
|
|
_popup_scroll_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
is_popup_scroll = elm_check_state_get(obj);
|
|
|
|
}
|
|
|
|
|
2012-03-05 15:51:56 -08:00
|
|
|
void
|
2013-08-31 18:18:03 -07:00
|
|
|
test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-03-05 15:51:56 -08:00
|
|
|
{
|
2014-02-25 08:52:03 -08:00
|
|
|
Evas_Object *win, *box, *list, *check;
|
2012-03-05 15:51:56 -08:00
|
|
|
|
2012-04-01 23:20:28 -07:00
|
|
|
win = elm_win_util_standard_add("popup", "Popup");
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
|
|
|
|
2014-02-25 08:52:03 -08:00
|
|
|
box = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, box);
|
|
|
|
evas_object_show(box);
|
|
|
|
|
|
|
|
list = elm_list_add(box);
|
2012-11-14 02:49:45 -08:00
|
|
|
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2014-02-25 08:52:03 -08:00
|
|
|
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(box, list);
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_list_mode_set(list, ELM_LIST_LIMIT);
|
|
|
|
evas_object_smart_callback_add(list, "selected", _list_click, NULL);
|
|
|
|
|
|
|
|
elm_list_item_append(list, "popup-center-text", NULL, NULL,
|
|
|
|
_popup_center_text_cb, win);
|
|
|
|
elm_list_item_append(list, "popup-center-text + 1 button", NULL, NULL,
|
|
|
|
_popup_center_text_1button_cb, win);
|
|
|
|
elm_list_item_append(list, "popup-center-title + text + 1 button", NULL,
|
|
|
|
NULL, _popup_center_title_text_1button_cb, win);
|
|
|
|
|
|
|
|
elm_list_item_append(list,
|
|
|
|
"popup-center-title + text (block,clicked handling)",
|
|
|
|
NULL, NULL,
|
|
|
|
_popup_center_title_text_block_clicked_event_cb, win);
|
2013-11-24 21:05:17 -08:00
|
|
|
elm_list_item_append(list,
|
|
|
|
"popup-center-title + text (block,clicked handling with parent)",
|
|
|
|
NULL, NULL,
|
|
|
|
_popup_center_title_text_block_clicked_event_with_parent_cb, win);
|
2015-07-18 03:19:48 -07:00
|
|
|
elm_list_item_append(list, "popup-bottom-title-icon + text + 3 buttons", NULL,
|
2012-03-05 15:51:56 -08:00
|
|
|
NULL, _popup_bottom_title_text_3button_cb, win);
|
|
|
|
elm_list_item_append(list, "popup-center-title + content + 3 buttons", NULL,
|
|
|
|
NULL, _popup_center_title_content_3button_cb, win);
|
|
|
|
elm_list_item_append(list, "popup-center-title + items + 3 buttons", NULL,
|
|
|
|
NULL, _popup_center_title_item_3button_cb, win);
|
2012-03-30 02:56:22 -07:00
|
|
|
elm_list_item_append(list, "popup-center-title + text + 2 buttons (check restacking)", NULL, NULL,
|
|
|
|
_popup_center_title_text_2button_restack_cb, win);
|
2012-04-08 21:48:09 -07:00
|
|
|
elm_list_item_append(list, "popup-center-text + 1 button (check hide, show)", NULL, NULL,
|
|
|
|
_popup_center_text_1button_hide_show_cb, win);
|
2013-10-13 08:57:42 -07:00
|
|
|
elm_list_item_append(list, "popup-center-text + 3 button (check add, remove buttons)", NULL, NULL,
|
|
|
|
_popup_center_text_3button_add_remove_button_cb, win);
|
2012-09-03 02:26:57 -07:00
|
|
|
elm_list_item_append(list, "popup-transparent", NULL, NULL,
|
|
|
|
_popup_transparent_cb, win);
|
2013-12-02 04:17:06 -08:00
|
|
|
elm_list_item_append(list, "popup-transparent-align", NULL, NULL,
|
|
|
|
_popup_transparent_align_cb, win);
|
2017-07-10 23:36:06 -07:00
|
|
|
elm_list_item_append(list, "popup-center-title + list content + 2 button (with delete content)",
|
|
|
|
NULL, NULL, _popup_center_title_list_content_2button_cb,
|
2012-11-27 07:21:20 -08:00
|
|
|
win);
|
2015-03-03 02:58:40 -08:00
|
|
|
elm_list_item_append(list, "popup-center-title + genlist content + 1 button",
|
|
|
|
NULL, NULL, _popup_center_title_genlist_content_1button_cb,
|
|
|
|
win);
|
2013-12-28 00:33:10 -08:00
|
|
|
elm_list_item_append(list, "subpopup + X button",
|
|
|
|
NULL, NULL, _subpopup_cb,
|
|
|
|
win);
|
2015-08-03 10:25:51 -07:00
|
|
|
elm_list_item_append(list, "popup with content only",
|
|
|
|
NULL, NULL, _popup_content_only_cb,
|
|
|
|
win);
|
2015-12-30 20:08:28 -08:00
|
|
|
elm_list_item_append(list, "popup-center-title + text + 1 button + hide effect", NULL,
|
|
|
|
NULL, _popup_center_title_text_1button_hide_effect_cb, win);
|
2012-03-05 15:51:56 -08:00
|
|
|
elm_list_go(list);
|
|
|
|
evas_object_show(list);
|
2013-12-14 12:45:57 -08:00
|
|
|
|
2014-02-25 08:52:03 -08:00
|
|
|
check = elm_check_add(box);
|
2014-09-07 01:49:59 -07:00
|
|
|
elm_object_text_set(check, "Enable Focus Highlight");
|
2014-02-25 08:52:03 -08:00
|
|
|
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(box, check);
|
|
|
|
evas_object_show(check);
|
|
|
|
evas_object_smart_callback_add(check, "changed", _focus_changed_cb, win);
|
|
|
|
|
2015-08-15 08:32:33 -07:00
|
|
|
check = elm_check_add(box);
|
|
|
|
elm_object_text_set(check, "Enable popup scroll");
|
|
|
|
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(box, check);
|
|
|
|
evas_object_show(check);
|
|
|
|
evas_object_smart_callback_add(check, "changed", _popup_scroll_cb, NULL);
|
|
|
|
|
popup: add popup default scrollable flag config for other profiles.
Summary:
The default scrollable flag of popup can be different in each profiles.
So I added the scrollable configuration of popup.
@feature
Test Plan:
1. Before
1) elementary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, but its list is very long, only small part of popup could be shown.
2. After Patch
1) change "popup_scroller" value to 1 in base.src, then run elementary_test -to popup or ELM_POPUP_SCROLLABLE=1 elemantary_test -to popup
2) resize window to smaller
3) Click 15th item, "popup-center-title + genlist content + 1 button"
4) Then popup will show, popup's genlist will be in scroller, so entire popup can be shown.
Reviewers: jaehwan, id213sin, cedric, raster, singh.amitesh, SanghyeonLee, Hermet
Subscribers: Hermet, minkyu, herb, jpeg
Differential Revision: https://phab.enlightenment.org/D3856
2016-05-16 18:22:07 -07:00
|
|
|
if (elm_config_popup_scrollable_get())
|
|
|
|
{
|
|
|
|
elm_check_state_set(check, EINA_TRUE);
|
|
|
|
is_popup_scroll = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2013-12-14 12:45:57 -08:00
|
|
|
evas_object_resize(win, 480, 400);
|
|
|
|
evas_object_show(win);
|
2012-03-05 15:51:56 -08:00
|
|
|
}
|