forked from enlightenment/efl
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
This commit is contained in:
parent
988fe37232
commit
1b765359ee
|
@ -98,6 +98,7 @@ group "Elm_Config" struct {
|
||||||
value "naviframe_prev_btn_auto_pushed" uchar: 1;
|
value "naviframe_prev_btn_auto_pushed" uchar: 1;
|
||||||
value "popup_horizontal_align" double: 0.5;
|
value "popup_horizontal_align" double: 0.5;
|
||||||
value "popup_vertical_align" double: 0.5;
|
value "popup_vertical_align" double: 0.5;
|
||||||
|
value "popup_scrollable" uchar: 0;
|
||||||
value "spinner_min_max_filter_enable" uchar: 0;
|
value "spinner_min_max_filter_enable" uchar: 0;
|
||||||
group "color_palette" list {
|
group "color_palette" list {
|
||||||
group "Elm_Custom_Palette" struct {
|
group "Elm_Custom_Palette" struct {
|
||||||
|
|
|
@ -102,6 +102,7 @@ group "Elm_Config" struct {
|
||||||
value "naviframe_prev_btn_auto_pushed" uchar: 1;
|
value "naviframe_prev_btn_auto_pushed" uchar: 1;
|
||||||
value "popup_horizontal_align" double: 0.5;
|
value "popup_horizontal_align" double: 0.5;
|
||||||
value "popup_vertical_align" double: 0.5;
|
value "popup_vertical_align" double: 0.5;
|
||||||
|
value "popup_scrollable" uchar: 0;
|
||||||
value "spinner_min_max_filter_enable" uchar: 1;
|
value "spinner_min_max_filter_enable" uchar: 1;
|
||||||
group "color_palette" list {
|
group "color_palette" list {
|
||||||
group "Elm_Custom_Palette" struct {
|
group "Elm_Custom_Palette" struct {
|
||||||
|
|
|
@ -99,6 +99,7 @@ group "Elm_Config" struct {
|
||||||
value "naviframe_prev_btn_auto_pushed" uchar: 1;
|
value "naviframe_prev_btn_auto_pushed" uchar: 1;
|
||||||
value "popup_horizontal_align" double: 0.5;
|
value "popup_horizontal_align" double: 0.5;
|
||||||
value "popup_vertical_align" double: 0.5;
|
value "popup_vertical_align" double: 0.5;
|
||||||
|
value "popup_scrollable" uchar: 0;
|
||||||
value "spinner_min_max_filter_enable" uchar: 0;
|
value "spinner_min_max_filter_enable" uchar: 0;
|
||||||
group "color_palette" list {
|
group "color_palette" list {
|
||||||
group "Elm_Custom_Palette" struct {
|
group "Elm_Custom_Palette" struct {
|
||||||
|
|
|
@ -306,7 +306,6 @@ _popup_center_title_content_3button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
|
|
||||||
// popup title
|
// popup title
|
||||||
|
@ -368,7 +367,6 @@ _popup_center_title_item_3button_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
Evas_Object *popup, *icon1, *btn1, *btn2, *btn3;
|
Evas_Object *popup, *icon1, *btn1, *btn2, *btn3;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
|
|
||||||
// popup title
|
// popup title
|
||||||
|
@ -441,7 +439,6 @@ _popup_center_title_text_2button_restack_cb(void *data, Evas_Object *obj EINA_UN
|
||||||
Evas_Object *btn, *btn2;
|
Evas_Object *btn, *btn2;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
evas_object_smart_callback_add(popup, "block,clicked",
|
evas_object_smart_callback_add(popup, "block,clicked",
|
||||||
_restack_block_clicked_cb, NULL);
|
_restack_block_clicked_cb, NULL);
|
||||||
|
@ -486,7 +483,6 @@ _popup_center_text_1button_hide_show_cb(void *data, Evas_Object *obj EINA_UNUSED
|
||||||
}
|
}
|
||||||
|
|
||||||
g_popup = elm_popup_add(data);
|
g_popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(g_popup, is_popup_scroll);
|
elm_popup_scrollable_set(g_popup, is_popup_scroll);
|
||||||
elm_object_text_set(g_popup, "Hide this popup by using the button."
|
elm_object_text_set(g_popup, "Hide this popup by using the button."
|
||||||
"When you click list item again, you can see this popup.");
|
"When you click list item again, you can see this popup.");
|
||||||
|
@ -535,7 +531,6 @@ _popup_center_text_3button_add_remove_button_cb(void *data,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
|
|
||||||
// popup title
|
// popup title
|
||||||
|
@ -571,7 +566,6 @@ _popup_transparent_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
Evas_Object *btn;
|
Evas_Object *btn;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
elm_object_style_set(popup, "transparent");
|
elm_object_style_set(popup, "transparent");
|
||||||
elm_object_text_set(popup, "This Popup has transparent background");
|
elm_object_text_set(popup, "This Popup has transparent background");
|
||||||
|
@ -595,7 +589,6 @@ _popup_transparent_align_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
Evas_Object *btn, *btn1;
|
Evas_Object *btn, *btn1;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
elm_object_style_set(popup, "transparent");
|
elm_object_style_set(popup, "transparent");
|
||||||
elm_object_text_set(popup, "This Popup has transparent background");
|
elm_object_text_set(popup, "This Popup has transparent background");
|
||||||
|
@ -638,7 +631,6 @@ _popup_center_title_list_content_1button_cb(void *data, Evas_Object *obj EINA_UN
|
||||||
Evas_Object *btn;
|
Evas_Object *btn;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
elm_object_part_text_set(popup, "title,text", "Title");
|
elm_object_part_text_set(popup, "title,text", "Title");
|
||||||
|
|
||||||
|
@ -670,7 +662,6 @@ _popup_center_title_genlist_content_1button_cb(void *data, Evas_Object *obj EINA
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
elm_object_part_text_set(popup, "title,text", "Title");
|
elm_object_part_text_set(popup, "title,text", "Title");
|
||||||
|
|
||||||
|
@ -683,7 +674,7 @@ _popup_center_title_genlist_content_1button_cb(void *data, Evas_Object *obj EINA
|
||||||
|
|
||||||
// genlist as a popup content
|
// genlist as a popup content
|
||||||
genlist = elm_genlist_add(popup);
|
genlist = elm_genlist_add(popup);
|
||||||
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
|
elm_genlist_mode_set(genlist, ELM_LIST_EXPAND);
|
||||||
elm_scroller_content_min_limit(genlist, EINA_FALSE, EINA_TRUE);
|
elm_scroller_content_min_limit(genlist, EINA_FALSE, EINA_TRUE);
|
||||||
|
|
||||||
for (i = 0; i < 10; i++)
|
for (i = 0; i < 10; i++)
|
||||||
|
@ -718,7 +709,6 @@ _subpopup_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
Evas_Object *btn, *btnclose;
|
Evas_Object *btn, *btnclose;
|
||||||
|
|
||||||
popup = elm_popup_add(data);
|
popup = elm_popup_add(data);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
elm_object_style_set(popup, "subpopup");
|
elm_object_style_set(popup, "subpopup");
|
||||||
elm_object_part_text_set(popup, "title,text", "Title");
|
elm_object_part_text_set(popup, "title,text", "Title");
|
||||||
|
@ -754,7 +744,6 @@ _popup_content_only_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
Evas_Object *win = data;
|
Evas_Object *win = data;
|
||||||
|
|
||||||
popup = elm_popup_add(win);
|
popup = elm_popup_add(win);
|
||||||
if (is_popup_scroll)
|
|
||||||
elm_popup_scrollable_set(popup, is_popup_scroll);
|
elm_popup_scrollable_set(popup, is_popup_scroll);
|
||||||
|
|
||||||
bx = elm_box_add(popup);
|
bx = elm_box_add(popup);
|
||||||
|
@ -929,6 +918,12 @@ test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
evas_object_show(check);
|
evas_object_show(check);
|
||||||
evas_object_smart_callback_add(check, "changed", _popup_scroll_cb, NULL);
|
evas_object_smart_callback_add(check, "changed", _popup_scroll_cb, NULL);
|
||||||
|
|
||||||
|
if (elm_config_popup_scrollable_get())
|
||||||
|
{
|
||||||
|
elm_check_state_set(check, EINA_TRUE);
|
||||||
|
is_popup_scroll = EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
evas_object_resize(win, 480, 400);
|
evas_object_resize(win, 480, 400);
|
||||||
evas_object_show(win);
|
evas_object_show(win);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1552,6 +1552,9 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
|
||||||
_populate_theme_scroll(priv);
|
_populate_theme_scroll(priv);
|
||||||
|
|
||||||
_visuals_set(obj);
|
_visuals_set(obj);
|
||||||
|
|
||||||
|
if (_elm_config->popup_scrollable)
|
||||||
|
elm_popup_scrollable_set(obj, _elm_config->popup_scrollable);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -499,6 +499,7 @@ _desc_init(void)
|
||||||
ELM_CONFIG_VAL(D, T, naviframe_prev_btn_auto_pushed, T_UCHAR);
|
ELM_CONFIG_VAL(D, T, naviframe_prev_btn_auto_pushed, T_UCHAR);
|
||||||
ELM_CONFIG_VAL(D, T, popup_horizontal_align, T_DOUBLE);
|
ELM_CONFIG_VAL(D, T, popup_horizontal_align, T_DOUBLE);
|
||||||
ELM_CONFIG_VAL(D, T, popup_vertical_align, T_DOUBLE);
|
ELM_CONFIG_VAL(D, T, popup_vertical_align, T_DOUBLE);
|
||||||
|
ELM_CONFIG_VAL(D, T, popup_scrollable, T_UCHAR);
|
||||||
ELM_CONFIG_VAL(D, T, spinner_min_max_filter_enable, T_UCHAR);
|
ELM_CONFIG_VAL(D, T, spinner_min_max_filter_enable, T_UCHAR);
|
||||||
ELM_CONFIG_VAL(D, T, icon_theme, T_STRING);
|
ELM_CONFIG_VAL(D, T, icon_theme, T_STRING);
|
||||||
#undef T
|
#undef T
|
||||||
|
@ -1826,6 +1827,7 @@ _config_load(void)
|
||||||
_elm_config->popup_horizontal_align = 0.5;
|
_elm_config->popup_horizontal_align = 0.5;
|
||||||
_elm_config->popup_vertical_align = 0.5;
|
_elm_config->popup_vertical_align = 0.5;
|
||||||
_elm_config->icon_theme = eina_stringshare_add(ELM_CONFIG_ICON_THEME_ELEMENTARY);
|
_elm_config->icon_theme = eina_stringshare_add(ELM_CONFIG_ICON_THEME_ELEMENTARY);
|
||||||
|
_elm_config->popup_scrollable = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2539,6 +2541,8 @@ _env_get(void)
|
||||||
if (s) _elm_config->popup_horizontal_align = _elm_atof(s);
|
if (s) _elm_config->popup_horizontal_align = _elm_atof(s);
|
||||||
s = getenv("ELM_POPUP_VERTICAL_ALIGN");
|
s = getenv("ELM_POPUP_VERTICAL_ALIGN");
|
||||||
if (s) _elm_config->popup_vertical_align = _elm_atof(s);
|
if (s) _elm_config->popup_vertical_align = _elm_atof(s);
|
||||||
|
s = getenv("ELM_POPUP_SCROLLABLE");
|
||||||
|
if (s) _elm_config->popup_scrollable = atoi(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3670,6 +3674,18 @@ elm_config_window_auto_focus_animate_set(Eina_Bool enable)
|
||||||
_elm_config->win_auto_focus_animate = enable;
|
_elm_config->win_auto_focus_animate = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI Eina_Bool
|
||||||
|
elm_config_popup_scrollable_get(void)
|
||||||
|
{
|
||||||
|
return _elm_config->popup_scrollable;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_config_popup_scrollable_set(Eina_Bool scrollable)
|
||||||
|
{
|
||||||
|
_elm_config->popup_scrollable = scrollable;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_config_all_flush(void)
|
elm_config_all_flush(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2033,6 +2033,28 @@ EAPI Eina_Bool elm_config_window_auto_focus_animate_get(void);
|
||||||
*/
|
*/
|
||||||
EAPI void elm_config_window_auto_focus_animate_set(Eina_Bool enable);
|
EAPI void elm_config_window_auto_focus_animate_set(Eina_Bool enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the popup scrollable flag
|
||||||
|
*
|
||||||
|
* If scrollable is true, popup's contents is wrapped in a scroller container
|
||||||
|
* in order to popup shouldn't be larger than its parent.
|
||||||
|
*
|
||||||
|
* @return The enabled state for popup scroll
|
||||||
|
* @since 1.18
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool elm_config_popup_scrollable_get(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the popup scrollable flag
|
||||||
|
*
|
||||||
|
* If scrollable is true, popup's contents is wrapped in a scroller container
|
||||||
|
* in order to popup shouldn't be larger than its parent.
|
||||||
|
*
|
||||||
|
* @param enable the popup scroll
|
||||||
|
* @since 1.18
|
||||||
|
*/
|
||||||
|
EAPI void elm_config_popup_scrollable_set(Eina_Bool scrollable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup ATSPI AT-SPI2 Accessibility
|
* @defgroup ATSPI AT-SPI2 Accessibility
|
||||||
* @ingroup Elementary
|
* @ingroup Elementary
|
||||||
|
|
|
@ -247,6 +247,7 @@ struct _Elm_Config
|
||||||
Elm_Slider_Indicator_Visible_Mode slider_indicator_visible_mode; /**< this sets the slider indicator visible mode */
|
Elm_Slider_Indicator_Visible_Mode slider_indicator_visible_mode; /**< this sets the slider indicator visible mode */
|
||||||
double popup_horizontal_align;
|
double popup_horizontal_align;
|
||||||
double popup_vertical_align;
|
double popup_vertical_align;
|
||||||
|
Eina_Bool popup_scrollable;
|
||||||
int toolbar_shrink_mode;
|
int toolbar_shrink_mode;
|
||||||
unsigned char fileselector_expand_enable;
|
unsigned char fileselector_expand_enable;
|
||||||
unsigned char fileselector_double_tap_navigation_enable;
|
unsigned char fileselector_double_tap_navigation_enable;
|
||||||
|
|
Loading…
Reference in New Issue