From 0c895f643be278684c3c8cb094c9387e5c49849b Mon Sep 17 00:00:00 2001 From: Woochan Lee Date: Fri, 19 Feb 2016 14:41:02 +0900 Subject: [PATCH] viewmgr: Called deactivate method when view count is 1. Change-Id: I9d05e190b15c17d565624a0c5f92e4a10344fbef --- src/efl/ui_view.h | 2 ++ src/efl/ui_viewmgr.cpp | 9 +++++---- src/interface/ui_viewmgr_base.cpp | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/efl/ui_view.h b/src/efl/ui_view.h index b3d87b4..df0fd13 100644 --- a/src/efl/ui_view.h +++ b/src/efl/ui_view.h @@ -29,6 +29,8 @@ class ui_controller; class ui_view: public ui_view_base { + friend class ui_viewmgr; + public: ui_view(ui_controller *controller, const char *name = NULL); virtual ~ui_view(); diff --git a/src/efl/ui_viewmgr.cpp b/src/efl/ui_viewmgr.cpp index 87ed7d7..67ff19d 100644 --- a/src/efl/ui_viewmgr.cpp +++ b/src/efl/ui_viewmgr.cpp @@ -167,6 +167,7 @@ bool ui_viewmgr::activate() } this->set_indicator(view->get_indicator()); + view->active(); evas_object_show(this->win); @@ -180,6 +181,8 @@ bool ui_viewmgr::deactivate() //FIXME: based on the profile, we should app to go behind or terminate. if (true) { + ui_view *view = dynamic_cast(this->get_last_view()); + if (view) view->inactive(); evas_object_lower(this->win); } else @@ -193,10 +196,8 @@ bool ui_viewmgr::deactivate() bool ui_viewmgr::pop_view() { - if (!ui_viewmgr_base::pop_view()) - { - return false; - } + if (this->get_view_count() == 1) this->deactivate(); + else if(!ui_viewmgr_base::pop_view()) return false; ui_view *view = dynamic_cast(this->get_last_view()); diff --git a/src/interface/ui_viewmgr_base.cpp b/src/interface/ui_viewmgr_base.cpp index ac8e29c..afc835d 100644 --- a/src/interface/ui_viewmgr_base.cpp +++ b/src/interface/ui_viewmgr_base.cpp @@ -161,7 +161,9 @@ bool ui_viewmgr_base::pop_view() view->inactive(); view->unload(); view->destroy(); - return true; + delete(view); + + return false; } //last page to be popped. -- 2.7.4