From 816f94f0093f18e6672309160b4c0b84745a33b2 Mon Sep 17 00:00:00 2001 From: Jinyong Park Date: Mon, 16 May 2016 19:40:05 +0900 Subject: [PATCH] popup: make config option to change popup scrollable Change-Id: I224a4e383831c081dae1567d971f3a7f7af839a6 Signed-off-by: Jinyong Park --- config/default/base.src.in | 1 + config/mobile/base.src.in | 1 + config/standard/base.src.in | 1 + src/lib/elc_popup.c | 3 +++ src/lib/elm_config.c | 17 +++++++++++++++++ src/lib/elm_config.h | 22 ++++++++++++++++++++++ src/lib/elm_priv.h | 1 + 7 files changed, 46 insertions(+) diff --git a/config/default/base.src.in b/config/default/base.src.in index 41a00cc..5c2e164 100644 --- a/config/default/base.src.in +++ b/config/default/base.src.in @@ -98,6 +98,7 @@ group "Elm_Config" struct { value "naviframe_prev_btn_auto_pushed" uchar: 1; value "popup_horizontal_align" double: 0.5; value "popup_vertical_align" double: 0.5; + value "popup_scrollable" uchar: 0; value "spinner_min_max_filter_enable" uchar: 0; group "color_palette" list { group "Elm_Custom_Palette" struct { diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in index 11b1704..7c25127 100644 --- a/config/mobile/base.src.in +++ b/config/mobile/base.src.in @@ -102,6 +102,7 @@ group "Elm_Config" struct { value "naviframe_prev_btn_auto_pushed" uchar: 1; value "popup_horizontal_align" double: 0.5; value "popup_vertical_align" double: 0.5; + value "popup_scrollable" uchar: 1; value "spinner_min_max_filter_enable" uchar: 1; group "color_palette" list { group "Elm_Custom_Palette" struct { diff --git a/config/standard/base.src.in b/config/standard/base.src.in index 6001829..83c8943 100644 --- a/config/standard/base.src.in +++ b/config/standard/base.src.in @@ -99,6 +99,7 @@ group "Elm_Config" struct { value "naviframe_prev_btn_auto_pushed" uchar: 1; value "popup_horizontal_align" double: 0.5; value "popup_vertical_align" double: 0.5; + value "popup_scrollable" uchar: 0; value "spinner_min_max_filter_enable" uchar: 0; group "color_palette" list { group "Elm_Custom_Palette" struct { diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c index a02b677..582866d 100644 --- a/src/lib/elc_popup.c +++ b/src/lib/elc_popup.c @@ -1747,6 +1747,9 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv) _populate_theme_scroll(priv); _visuals_set(obj); + + if (_elm_config->popup_scrollable) + elm_popup_scrollable_set(obj, _elm_config->popup_scrollable); } static void diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index fd5b058..28f3d92 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -439,6 +439,7 @@ _desc_init(void) 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_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); #undef T #undef D @@ -1474,6 +1475,8 @@ _config_load(void) _elm_config->naviframe_prev_btn_auto_pushed = EINA_TRUE; _elm_config->popup_horizontal_align = 0.5; _elm_config->popup_vertical_align = 0.5; + + _elm_config->popup_scrollable = EINA_FALSE; } static void @@ -2162,6 +2165,8 @@ _env_get(void) if (s) _elm_config->popup_horizontal_align = _elm_atof(s); s = getenv("ELM_POPUP_VERTICAL_ALIGN"); 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 @@ -3214,6 +3219,18 @@ elm_config_window_auto_focus_animate_set(Eina_Bool 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 elm_config_all_flush(void) { diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h index 0354df3..66600d5 100644 --- a/src/lib/elm_config.h +++ b/src/lib/elm_config.h @@ -1901,6 +1901,28 @@ EAPI Eina_Bool elm_config_window_auto_focus_animate_get(void); 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 * @ingroup Elementary * diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index a7d17d0..0703285 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -238,6 +238,7 @@ struct _Elm_Config Elm_Slider_Indicator_Visible_Mode slider_indicator_visible_mode; /**< this sets the slider indicator visible mode */ double popup_horizontal_align; double popup_vertical_align; + Eina_Bool popup_scrollable; int toolbar_shrink_mode; unsigned char fileselector_expand_enable; unsigned char fileselector_double_tap_navigation_enable; -- 2.7.4