From c60fa1f96c21a322fb84da73f21bfc938343008f Mon Sep 17 00:00:00 2001 From: Dmytro Dragan Date: Thu, 12 Nov 2015 13:06:58 +0200 Subject: [PATCH] TizenRefApp-4985 Use elm_object_item_part_content_unset() to hide custom navi-title and collapse title Change-Id: Ib1bff29213adcdbe8e5e3b829dc1929cc25b5cb0 Signed-off-by: Dmytro Dragan --- src/Common/View/inc/NaviFrameItem.h | 3 +++ src/Common/View/src/NaviFrameItem.cpp | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Common/View/inc/NaviFrameItem.h b/src/Common/View/inc/NaviFrameItem.h index 7c982f0..deaae9b 100644 --- a/src/Common/View/inc/NaviFrameItem.h +++ b/src/Common/View/inc/NaviFrameItem.h @@ -64,6 +64,9 @@ namespace Msg virtual void onViewItemCreated(); private: + void setTitleVisibility(bool visible); + + private: NaviFrameView &m_Owner; NaviBar *m_pNaviBar; }; diff --git a/src/Common/View/src/NaviFrameItem.cpp b/src/Common/View/src/NaviFrameItem.cpp index 35b74fb..e1728f0 100644 --- a/src/Common/View/src/NaviFrameItem.cpp +++ b/src/Common/View/src/NaviFrameItem.cpp @@ -77,6 +77,19 @@ const NaviFrameView &NaviFrameItem::getOwner() const return m_Owner; } +void NaviFrameItem::setTitleVisibility(bool visible) +{ + if (visible) + { + setContent(*m_pNaviBar, naviTitlePart); + evas_object_show(*m_pNaviBar); + } + else + { + evas_object_hide(elm_object_item_part_content_unset(getElmObjItem(), naviTitlePart)); + } +} + NaviFrameItem::NaviBar::NaviBar(NaviFrameItem &onwer) : m_Owner(onwer) , ButtonList() @@ -108,12 +121,9 @@ const NaviFrameItem &NaviFrameItem::NaviBar::getOwner() const return m_Owner; } -//TODO: fix show (update title part in naviframe item manually) void NaviFrameItem::NaviBar::setVisible(bool visible) { - const char *sig = visible ? "title,state,show" :"title,state,hide"; - emitSignal(sig, "*"); - elm_naviframe_item_title_visible_set(getOwner(), visible); + getOwner().setTitleVisibility(visible); } void NaviFrameItem::NaviBar::setTitle(const std::string &title) -- 2.7.4