popup: make config option to change popup scrollable 98/69698/2
authorJinyong Park <j4939.park@samsung.com>
Mon, 16 May 2016 10:40:05 +0000 (19:40 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 24 May 2016 10:27:33 +0000 (03:27 -0700)
Change-Id: I224a4e383831c081dae1567d971f3a7f7af839a6
Signed-off-by: Jinyong Park <j4939.park@samsung.com>
config/default/base.src.in
config/mobile/base.src.in
config/standard/base.src.in
src/lib/elc_popup.c
src/lib/elm_config.c
src/lib/elm_config.h
src/lib/elm_priv.h

index 41a00cc..5c2e164 100644 (file)
@@ -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 {
index 11b1704..7c25127 100644 (file)
@@ -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 {
index 6001829..83c8943 100644 (file)
@@ -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 {
index a02b677..582866d 100644 (file)
@@ -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
index fd5b058..28f3d92 100644 (file)
@@ -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)
 {
index 0354df3..66600d5 100644 (file)
@@ -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
  *
index a7d17d0..0703285 100644 (file)
@@ -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;