popup: add subtitle text 32/89132/2
authorJinYong Park <j4939.park@samsung.com>
Thu, 22 Sep 2016 10:06:54 +0000 (19:06 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 28 Sep 2016 07:02:57 +0000 (00:02 -0700)
Change-Id: I7cd560f1e40fbba0ca1f0b1b7d3f64ae5e99f5ab
Signed-off-by: Jinyong Park <j4939.park@samsung.com>
src/lib/elc_popup.c
src/lib/elm_widget_popup.h

index fe538657da13bf77b2717babd799ab680ce99807..be0176a938593fa03e03c0f717dba24870349ead 100644 (file)
@@ -347,6 +347,9 @@ _elm_popup_evas_object_smart_del(Eo *obj, Elm_Popup_Data *sd)
    ELM_SAFE_FREE(sd->scr, evas_object_del);
    ELM_SAFE_FREE(sd->content, evas_object_del);
    ELM_SAFE_FREE(sd->title_text, eina_stringshare_del);
+   //TIZEN_ONLY(20160922): add subtitle text
+   ELM_SAFE_FREE(sd->subtitle_text, eina_stringshare_del);
+   //
 
    eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
 }
@@ -566,6 +569,13 @@ _elm_popup_elm_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
      }
    if (sd->title_icon)
      elm_layout_signal_emit(sd->main_layout, "elm,state,title,icon,visible", "elm");
+   //TIZEN_ONLY(20160922): add subtitle text
+   if (sd->subtitle_text)
+     {
+        elm_layout_text_set(sd->main_layout, "elm,text,subtitle", sd->subtitle_text);
+        elm_layout_signal_emit(sd->main_layout, "elm,state,subtitle,text,visible", "elm");
+     }
+   //
 
    _populate_theme_scroll(sd);
    if (!sd->scroll && sd->theme_scroll)
@@ -1210,6 +1220,32 @@ _title_text_set(Evas_Object *obj,
    return EINA_TRUE;
 }
 
+//TIZEN_ONLY(20160922): add subtitle text
+static Eina_Bool
+_subtitle_text_set(Evas_Object *obj,
+                const char *text)
+{
+   ELM_POPUP_DATA_GET(obj, sd);
+
+   if (sd->subtitle_text == text) return EINA_TRUE;
+
+   eina_stringshare_replace(&sd->subtitle_text, text);
+
+   //bare edje here because we're inside the hook, already
+   edje_object_part_text_escaped_set
+     (elm_layout_edje_get(sd->main_layout), "elm.text.subtitle", text);
+
+   if (sd->subtitle_text)
+     elm_object_signal_emit(sd->main_layout, "elm,state,subtitle,text,visible", "elm");
+   else
+     elm_object_signal_emit(sd->main_layout, "elm,state,subtitle,text,hidden", "elm");
+
+   edje_object_message_signal_process(elm_layout_edje_get(sd->main_layout));
+
+   return EINA_TRUE;
+}
+//
+
 static Eina_Bool
 _content_text_set(Evas_Object *obj,
                   const char *text)
@@ -1291,6 +1327,10 @@ _elm_popup_elm_layout_text_set(Eo *obj, Elm_Popup_Data *_pd, const char *part, c
      int_ret = _content_text_set(obj, label);
    else if (!strcmp(part, "title,text"))
      int_ret = _title_text_set(obj, label);
+   //TIZEN_ONLY(20160922): add subtitle text
+   else if(!strcmp(part, "subtitle,text"))
+     int_ret = _subtitle_text_set(obj, label);
+   //
    else
      int_ret = elm_layout_text_set(_pd->main_layout, part, label);
 
@@ -1306,6 +1346,14 @@ _title_text_get(const Elm_Popup_Data *sd)
    return sd->title_text;
 }
 
+//TIZEN_ONLY(20160922): add subtitle text
+static const char *
+_subtitle_text_get(const Elm_Popup_Data *sd)
+{
+   return sd->subtitle_text;
+}
+//
+
 static const char *
 _content_text_get(const Elm_Popup_Data *sd)
 {
@@ -1326,6 +1374,10 @@ _elm_popup_elm_layout_text_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *_pd, c
      text = _content_text_get(_pd);
    else if (!strcmp(part, "title,text"))
      text = _title_text_get(_pd);
+   //TIZEN_ONLY(20160922): add subtitle text
+   else if (!strcmp(part, "subtitle,text"))
+     text = _subtitle_text_get(_pd);
+   //
    else
      text = elm_layout_text_get(_pd->main_layout, part);
 
index 25f8753d4024a857aba96c4d50c3032b2b2fd60d..fabc562bce5ff0d34f1481eb4d04a7f8f4e2add4 100644 (file)
@@ -45,6 +45,9 @@ struct _Elm_Popup_Data
    Evas_Object          *parent; /**< Pointer to remove _parent_resize_cb when popup is deleted. */
    Eina_List            *items;
    const char           *title_text;
+   //TIZE_ONLY(20160922): add subtitle text code of popup
+   const char           *subtitle_text;
+   //
    Action_Area_Data     *buttons[ELM_POPUP_ACTION_BUTTON_MAX];
    Elm_Wrap_Type         content_text_wrap_type;
    unsigned int          last_button_number;