Fixed QuickPanelFrame Scroll Issue : N_SE-22617
authorJaeHwan Lee <jael.lee@samsung.com>
Tue, 12 Mar 2013 07:21:25 +0000 (16:21 +0900)
committerJaeHwan Lee <jael.lee@samsung.com>
Tue, 12 Mar 2013 07:21:25 +0000 (16:21 +0900)
Change-Id: I91527b135c7a92c8bf643f6cca8846b75ab640d4
Signed-off-by: JaeHwan Lee <jael.lee@samsung.com>
src/FShell_QuickPanelFrame.cpp
src/inc/FShell_QuickPanelFrame.h

index ebfdacd..f2082bf 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <new>
 extern "C" {
+#include <minicontrol-type.h>
 #include <minicontrol-provider.h>
 }
 #include <FGrpDimension.h>
@@ -37,10 +38,16 @@ extern "C" {
 #include "FUiAnim_RootVisualElement.h"
 #include "FUiAnim_DisplayManager.h"
 
+#include "FUiCtrl_Slider.h"
+#include "FUiCtrl_TabBar.h"
+#include "FUiCtrl_ScrollPanel.h"
+
+
 using namespace Tizen::Base;
 using namespace Tizen::Graphics;
 using namespace Tizen::Ui::Animations;
 using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
 
 namespace Tizen { namespace Shell{
 
@@ -115,6 +122,10 @@ _QuickPanelFrame::_QuickPanelFrame(void)
 {
        _UiEventManager* pEventManager = null;
 
+       // initialize flag for Scroll Issue
+       __isFreeze = false;
+       __isBubbled = false;
+
        __pQuickPanelFramePresenter = new (std::nothrow) _QuickPanelFramePresenter(*this);
        SysTryReturnVoidResult(NID_UI_CTRL, __pQuickPanelFramePresenter, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
@@ -281,6 +292,110 @@ CATCH:
        return r;
 }
 
+_UiTouchEventDelivery
+_QuickPanelFrame:: OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
+{
+       _Control* pTemp =  dynamic_cast<_Control*>(const_cast<_Control*>(&source));
+       while(pTemp!=null)
+       {
+               _ScrollPanel* pScrollPanel = dynamic_cast<_ScrollPanel*>(pTemp);
+               // ScrollPanel exist
+               if(pScrollPanel != null)
+               {
+                       __pMinicontrol = __pLayer->GetWindow();
+                       minicontrol_request(__pMinicontrol, static_cast<minicontrol_request_e>(MINICONTROL_REQ_FREEZE_SCROLL_VIEWER));
+
+                       __isFreeze = true;
+                       return _UI_TOUCH_EVENT_DELIVERY_YES; 
+               }
+               pTemp = pTemp->GetParent();
+       }
+
+       // Control is not on the ScrollPanel
+       _Slider* pSlider = dynamic_cast<_Slider*>(const_cast<_Control*>(&source));
+       _TabBar* pTabBar = dynamic_cast<_TabBar*>(const_cast<_Control*>(&source));
+
+       if(pSlider != null || pTabBar != null)
+       {
+               __pMinicontrol = __pLayer->GetWindow();
+               minicontrol_request(__pMinicontrol, static_cast<minicontrol_request_e>(MINICONTROL_REQ_FREEZE_SCROLL_VIEWER));
+
+               __isFreeze = true;
+               __isBubbled = true;
+       }
+
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+ _UiTouchEventDelivery
+ _QuickPanelFrame::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
+ {
+       if(__isFreeze == true)
+       {
+               __pMinicontrol = __pLayer->GetWindow();
+               minicontrol_request(__pMinicontrol, static_cast<minicontrol_request_e>(MINICONTROL_REQ_UNFREEZE_SCROLL_VIEWER));
+               
+               __isFreeze = false;
+       } 
+
+       if(__isBubbled == true)
+       {
+               __isBubbled = false;
+       }
+
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+ _UiTouchEventDelivery 
+_QuickPanelFrame::OnPreviewTouchMoved(const _Control & source, const _TouchInfo & touchinfo)
+{
+       return _UI_TOUCH_EVENT_DELIVERY_YES;
+}
+
+ bool
+_QuickPanelFrame::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
+ {
+ }
+
+ bool
+_QuickPanelFrame::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
+{
+}
+
+ bool
+_QuickPanelFrame::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
+{
+       if(__isBubbled == true)
+       {
+               if(__isFreeze == true)
+               {
+                       __pMinicontrol = __pLayer->GetWindow();
+                       minicontrol_request(__pMinicontrol, static_cast<minicontrol_request_e>(MINICONTROL_REQ_UNFREEZE_SCROLL_VIEWER));
+                       
+                       __isFreeze = false;
+               }
+               __isBubbled = false;
+       }
+       return true;
+}
+
+bool 
+_QuickPanelFrame::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
+{
+       if(__isFreeze == true)
+       {
+               __pMinicontrol = __pLayer->GetWindow();
+               minicontrol_request(__pMinicontrol, static_cast<minicontrol_request_e>(MINICONTROL_REQ_UNFREEZE_SCROLL_VIEWER));
+               
+               __isFreeze = false;
+       }
+       if(__isBubbled == true)
+       {
+               __isBubbled = false;
+       }
+}
+
 void
 _QuickPanelFrame::OnDraw(void)
 {
index aaa9029..d9ab7fa 100644 (file)
@@ -73,13 +73,23 @@ private:
        _QuickPanelFrame(const _QuickPanelFrame& rhs);
        _QuickPanelFrame& operator =(const _QuickPanelFrame&  rhs);
 
+       virtual Tizen::Ui::_UiTouchEventDelivery OnPreviewTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual Tizen::Ui::_UiTouchEventDelivery OnPreviewTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual Tizen::Ui::_UiTouchEventDelivery OnPreviewTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+
        virtual void OnDraw(void);
 
 private:
        _QuickPanelFramePresenter* __pQuickPanelFramePresenter;
        Tizen::Ui::_IUiEventManager* __pEventManager;
        _QuickPanelFrameLayer* __pLayer;
-       Evas_Object* pminicontrol;
+       Evas_Object* __pMinicontrol;
+       bool __isFreeze;        
+       bool __isBubbled;
 }; // _QuickPanelFrame
 
 }}// Tizen::Shell