# HG changeset patch # User teknolog # Date 1267113762 0 # Node ID be243543a3619ba29fc6abd5eaf5039aa1028a1e # Parent 3326ac3c89fa284124dc22fe0caf39a3ad3240b8 Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward. diff -r 3326ac3c89fa -r be243543a361 application/inc/PodcastQueueView.h --- a/application/inc/PodcastQueueView.h Thu Feb 25 15:23:53 2010 +0000 +++ b/application/inc/PodcastQueueView.h Thu Feb 25 16:02:42 2010 +0000 @@ -94,8 +94,6 @@ void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); void FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded = 0); - void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation); - private: void GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex); void UpdateToolbar(); diff -r 3326ac3c89fa -r be243543a361 application/src/PodcastListView.cpp --- a/application/src/PodcastListView.cpp Thu Feb 25 15:23:53 2010 +0000 +++ b/application/src/PodcastListView.cpp Thu Feb 25 16:02:42 2010 +0000 @@ -355,7 +355,12 @@ void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) { DP("CPodcastListView::HandleLongTapEventL BEGIN"); - if(iStylusPopupMenu) + + const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 + TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( + iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; + + if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) { iStylusPopupMenu->ShowMenu(); iStylusPopupMenu->SetPosition(aPenEventLocation); diff -r 3326ac3c89fa -r be243543a361 application/src/PodcastQueueView.cpp --- a/application/src/PodcastQueueView.cpp Thu Feb 25 15:23:53 2010 +0000 +++ b/application/src/PodcastQueueView.cpp Thu Feb 25 16:02:42 2010 +0000 @@ -575,18 +575,6 @@ toolbar->HideItem(EPodcastResumeDownloads,!iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue); } -void CPodcastQueueView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) -{ - DP("CPodcastQueueView::HandleLongTapEventL BEGIN"); - - if(iStylusPopupMenu) - { - iStylusPopupMenu->ShowMenu(); - iStylusPopupMenu->SetPosition(aPenEventLocation); - } - DP("CPodcastQueueView::HandleLongTapEventL END"); -} - void CPodcastQueueView::DownloadQueueUpdatedL(TInt /*aDownloadingShows*/, TInt /*aQueuedShows*/) { } diff -r 3326ac3c89fa -r be243543a361 application/src/PodcastShowsView.cpp --- a/application/src/PodcastShowsView.cpp Thu Feb 25 15:23:53 2010 +0000 +++ b/application/src/PodcastShowsView.cpp Thu Feb 25 16:02:42 2010 +0000 @@ -796,7 +796,11 @@ { DP("CPodcastShowsView::HandleLongTapEventL BEGIN"); - if(iStylusPopupMenu) + const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 + TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( + iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; + + if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) { TInt index = iListContainer->Listbox()->CurrentItemIndex(); if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())