TizenRefApp-6425 Extended Names Cut when Hiding Extended Name Fields 08/73008/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Fri, 3 Jun 2016 13:03:09 +0000 (16:03 +0300)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Fri, 3 Jun 2016 13:03:41 +0000 (16:03 +0300)
[Implementation] Ensured that compound field is updated after child fields are saved.

Change-Id: I92080d1792041479ecc1672cb64193bdf2227044
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
lib-contacts/inc/Contacts/Input/ContactCompoundFieldItem.h
lib-contacts/src/Contacts/Input/ContactCompoundFieldItem.cpp

index a9825b0..c4c186e 100644 (file)
@@ -54,7 +54,7 @@ namespace Contacts
 
                private:
                        Evas_Object *createExpandButton(Evas_Object *parent);
-                       Evas_Object *getExpandIcon() const;
+                       void updateExpandIcon(bool isExpanded) const;
                        void onExpandPressed(Evas_Object *button, void *eventInfo);
                };
        }
index 63d1364..549fb6f 100644 (file)
@@ -55,12 +55,11 @@ Evas_Object *ContactCompoundFieldItem::getContent(Evas_Object *parent, const cha
 void ContactCompoundFieldItem::onExpanded(bool isExpanded)
 {
        auto control = static_cast<ContactCompoundFieldControl *>(getFieldControl());
-       control->setCompoundMode(!isExpanded);
-
-       elm_image_file_set(getExpandIcon(), layoutPath.c_str(),
-                       isExpanded ? GROUP_ICON_CONTRACT : GROUP_ICON_EXPAND);
+       control->save();
 
        GenlistGroupItem::onExpanded(isExpanded);
+       updateExpandIcon(isExpanded);
+       control->setCompoundMode(!isExpanded);
 
        if (elm_object_focus_get(control->getEntry())) {
                control->updateReturnKey();
@@ -86,10 +85,12 @@ Evas_Object *ContactCompoundFieldItem::createExpandButton(Evas_Object *parent)
        return button;
 }
 
-Evas_Object *ContactCompoundFieldItem::getExpandIcon() const
+void ContactCompoundFieldItem::updateExpandIcon(bool isExpanded) const
 {
        Evas_Object *button = elm_object_item_part_content_get(getObjectItem(), PART_RIGHT);
-       return elm_object_part_content_get(button, "elm.swallow.content");
+       Evas_Object *icon = elm_object_part_content_get(button, "elm.swallow.content");
+       elm_image_file_set(icon, layoutPath.c_str(),
+                       isExpanded ? GROUP_ICON_CONTRACT : GROUP_ICON_EXPAND);
 }
 
 void ContactCompoundFieldItem::onExpandPressed(Evas_Object *button, void *eventInfo)