From 40637ba556b292008ef82179bd0492c83ec799e5 Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Mon, 24 Oct 2016 11:50:31 +0300 Subject: [PATCH] TSAM-9262 Thread list screen display abnormal after change delete mode Change-Id: Iba9be4b97ba48744ee32a15fad39362581a6bd06 Signed-off-by: Denis Dolzhenko --- res/edje/thread_genlist_theme.edc | 7 +++++++ src/Common/View/src/ListView.cpp | 8 -------- src/Conversation/ConvList/Controller/src/ConvList.cpp | 13 ++++++++----- src/Conversation/ConvList/View/inc/ConvListViewItem.h | 1 + src/Conversation/ConvList/View/src/ConvListViewItem.cpp | 8 ++++++++ src/MsgThread/Controller/src/ThreadList.cpp | 1 + src/MsgThread/View/inc/ThreadListViewItem.h | 1 + src/MsgThread/View/src/ThreadListViewItem.cpp | 8 ++++++++ 8 files changed, 34 insertions(+), 13 deletions(-) diff --git a/res/edje/thread_genlist_theme.edc b/res/edje/thread_genlist_theme.edc index d9ca60a..e0de0c1 100755 --- a/res/edje/thread_genlist_theme.edc +++ b/res/edje/thread_genlist_theme.edc @@ -526,6 +526,13 @@ collections { set_int(sub_end_text_visible, 0); } } + program { name: "reset_check"; + signal: "elm,state,reset_check"; + source: "elm"; + script { + set_state(PART:"elm.padding.D.C", "default", 0.0); + } + } program { name: "pressed"; signal: "elm,state,selected"; source: "elm"; diff --git a/src/Common/View/src/ListView.cpp b/src/Common/View/src/ListView.cpp index 43bac5c..4c1be95 100644 --- a/src/Common/View/src/ListView.cpp +++ b/src/Common/View/src/ListView.cpp @@ -261,14 +261,6 @@ void ListView::notifyListener(void *data, Evas_Object *obj, void *event_info, Li void ListView::setCheckMode(bool check) { m_CheckMode = check; - if (!check) - { - // Restore "default" state: - for(ListItem *item: getRealizedItems()) - { - item->emitSignal("elm,state,default", "elm"); - } - } } bool ListView::getCheckMode() const diff --git a/src/Conversation/ConvList/Controller/src/ConvList.cpp b/src/Conversation/ConvList/Controller/src/ConvList.cpp index 8b14992..fce0b7f 100644 --- a/src/Conversation/ConvList/Controller/src/ConvList.cpp +++ b/src/Conversation/ConvList/Controller/src/ConvList.cpp @@ -62,16 +62,19 @@ void ConvList::setListener(IConvListListener *l) void ConvList::setMode(ConvList::Mode mode) { m_Mode = mode; - bool isSelectMode = (m_Mode == ConvList::SelectMode); - MSG_LOG("isSelectMode: ",isSelectMode); + bool isCheckMode = (m_Mode == ConvList::SelectMode); - showSelectAllMode(isSelectMode); - m_pList->setCheckMode(isSelectMode); - if(isSelectMode) + showSelectAllMode(isCheckMode); + m_pList->setCheckMode(isCheckMode); + if(isCheckMode) { selectListItems(false); m_pSelectAll->setCheckState(false); } + else + { + ConvListViewItem::resetCheckMode(*m_pList); + } m_pList->updateRealizedItems(); } diff --git a/src/Conversation/ConvList/View/inc/ConvListViewItem.h b/src/Conversation/ConvList/View/inc/ConvListViewItem.h index dbeeaaf..7841d04 100644 --- a/src/Conversation/ConvList/View/inc/ConvListViewItem.h +++ b/src/Conversation/ConvList/View/inc/ConvListViewItem.h @@ -37,6 +37,7 @@ namespace Msg ConvListViewItem(ConvItemType type); virtual ~ConvListViewItem(); + static void resetCheckMode(ListView &listView); protected: virtual Evas_Object *getBubbleContent() = 0; diff --git a/src/Conversation/ConvList/View/src/ConvListViewItem.cpp b/src/Conversation/ConvList/View/src/ConvListViewItem.cpp index 1fd7299..c3552f0 100644 --- a/src/Conversation/ConvList/View/src/ConvListViewItem.cpp +++ b/src/Conversation/ConvList/View/src/ConvListViewItem.cpp @@ -202,3 +202,11 @@ void ConvListViewItem::updateItemType(ConvItemType type) break; } } + +void ConvListViewItem::resetCheckMode(ListView &listView) +{ + for(ListItem *item: listView.getRealizedItems()) + { + item->emitSignal("elm,state,default", "elm"); + } +} diff --git a/src/MsgThread/Controller/src/ThreadList.cpp b/src/MsgThread/Controller/src/ThreadList.cpp index 5e65fd4..00a26ce 100644 --- a/src/MsgThread/Controller/src/ThreadList.cpp +++ b/src/MsgThread/Controller/src/ThreadList.cpp @@ -70,6 +70,7 @@ void ThreadList::setDeleteMode(bool value) { m_DeleteMode = value; setCheckMode(value); + ThreadListViewItem::resetCheckMode(*this); checkAllItems(false, true); showSelectAllItem(value); } diff --git a/src/MsgThread/View/inc/ThreadListViewItem.h b/src/MsgThread/View/inc/ThreadListViewItem.h index 38e8491..53a1b3d 100644 --- a/src/MsgThread/View/inc/ThreadListViewItem.h +++ b/src/MsgThread/View/inc/ThreadListViewItem.h @@ -40,6 +40,7 @@ namespace Msg void setState(State state, bool updateUi); State getState() const; + static void resetCheckMode(ListView &listView); protected: virtual std::string getName() = 0; diff --git a/src/MsgThread/View/src/ThreadListViewItem.cpp b/src/MsgThread/View/src/ThreadListViewItem.cpp index d9deb94..b4a67f3 100644 --- a/src/MsgThread/View/src/ThreadListViewItem.cpp +++ b/src/MsgThread/View/src/ThreadListViewItem.cpp @@ -170,3 +170,11 @@ std::string ThreadListViewItem::decorateDraftText(const std::string &text) const { return TextDecorator::make(text, draftTextStyle); } + +void ThreadListViewItem::resetCheckMode(ListView &listView) +{ + for(ListItem *item: listView.getRealizedItems()) + { + item->emitSignal("elm,state,reset_check", "elm"); + } +} -- 2.7.4