fixed issue 30677
[apps/osp/Internet.git] / src / IntMainForm.cpp
index ac8f81c..5672b5f 100644 (file)
@@ -865,9 +865,9 @@ MainForm::InitFindWordPanel(void)
                AppLogException("There is some problem in the xml file. Please check.");
                return E_FAILURE;
        }
-       __pFindWordPanel->AddControl(*__pFindWordControl);
+       AddControl(*__pFindWordControl);
        __pFindWordControl->SetBounds(0,0, __pFindWordPanel->GetWidth(), __pFindWordPanel->GetHeight());
-       SetControlAlwaysOnTop(*__pFindWordPanel,true);
+       SetControlAlwaysOnTop(*__pFindWordControl,true);
        __pFindWordPanel->SetShowState(false);
        __pFindWordPanel->Invalidate(false);
 
@@ -2638,21 +2638,9 @@ MainForm::OnAddressCancelledClicked(const Addressbar& addBar)
 {
        result r = E_SUCCESS;
        // hiding the address bar
-       __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
        __pAddressbar->SetShowState(false);
-
-       if (__pMostVisitedListView != null && __pMostVisitedListView->GetShowState() == true)
-       {
-               AppLog("MainForm::OnAddressCancelledClicked 1");
-               if (__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
-                       __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, GetClientAreaBounds().height - __pFooterPanel->GetHeight()));
-
-               if (__pMostVisitedListView != null)
-                       __pMostVisitedListView->Invalidate(true);
-       }
-
        __pFooterPanel->SetShowState(true);
-       __pFooterPanel->Invalidate(false);
+       RelayoutControls(false);
 }
 
 void
@@ -2701,7 +2689,7 @@ MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState)
 void
 MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar)
 {
-       if (__pFindWordPanel && __pFindWordPanel->GetShowState() == true)
+       if (__pFindWordControl && __pFindWordControl->GetShowState() == true)
        {
                __pAddressbar->SetShowState(false);
        }
@@ -3037,6 +3025,7 @@ MainForm::RelayoutControls(bool showAddressbar)
 {
        __webControlPosition.y = 0;
        __webControlHeight = GetClientAreaBounds().height;
+       AppLog("Client area height: %d", __webControlHeight);
 
        AppLog("Client area height: %d", __webControlHeight);
        if(__pAddressbar != null && __pAddressbar->GetShowState() == true)
@@ -3045,11 +3034,11 @@ MainForm::RelayoutControls(bool showAddressbar)
                __webControlHeight -= __pAddressbar->GetHeight();
                __pAddressbar->SetBounds(0, 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
        }
-       else if(__pFindWordPanel != null && __pFindWordPanel->GetShowState() == true)
+       else if(__pFindWordControl != null && __pFindWordControl->GetShowState() == true)
        {
-               __webControlPosition.y += __pFindWordPanel->GetHeight();
-               __webControlHeight -= __pFindWordPanel->GetHeight();
-               __pFindWordPanel->SetBounds(0, 0, GetClientAreaBounds().width, __pFindWordPanel->GetHeight());
+               __webControlPosition.y += __pFindWordControl->GetHeight();
+               __webControlHeight -= __pFindWordControl->GetHeight();
+               __pFindWordControl->SetBounds(0, 0, GetClientAreaBounds().width, __pFindWordControl->GetHeight());
        }
 
        if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true)
@@ -3072,7 +3061,7 @@ MainForm::RelayoutControls(bool showAddressbar)
 
 void MainForm::ShowFindWordPanel(bool show , bool isTouchPressed)
 {
-       if (__pFindWordPanel == null)
+       if (__pFindWordControl == null)
        {
                return;
        }
@@ -3086,9 +3075,9 @@ void MainForm::ShowFindWordPanel(bool show , bool isTouchPressed)
        }
        else
        {
-               if(__pFindWordPanel != null)
+               if(__pFindWordControl != null)
                {
-                       __pFindWordPanel->SetShowState(false);
+                       __pFindWordControl->SetShowState(false);
                }
        }
 
@@ -3255,18 +3244,24 @@ MainForm::OnWebKeypadOpened(Tizen::Web::Controls::Web& source)
        if (__pWebViewer != null && __pFooterPanel != null)
        {
                AppLog("MainForm::OnOrientationChanged GetClientAreaBounds().height %d ", GetClientAreaBounds().height);
-
-               //              __pFooterPanel->SetShowState(false);
-               __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height));
-
-
-               //__pWebViewer->SetBounds(Rectangle(0, 82, GetClientAreaBounds().width,webControlHeight));
+               if(__pAddressbar != null)
+               {
+                       __pAddressbar->SetShowState(false);
+               }
+               if(__pFindWordControl != null)
+               {
+                       __pFindWordControl->SetShowState(false);
+               }
+               __pFooterPanel->SetShowState(false);
+               __pWebViewer->SetBounds(Rectangle(0, 0,GetClientAreaBounds().width, GetClientAreaBounds().height));
        }
+       Invalidate(true);
 }
 
 void
 MainForm::OnWebKeypadClosed(Tizen::Web::Controls::Web& source)
 {
+       __pFooterPanel->SetShowState(true);
        OnAddressBarKeypadClosed(*__pAddressbar);
 }
 
@@ -3508,9 +3503,11 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori
                }
        }
        Invalidate(true);
-       if(__pAddressbar != null)
+       
+    if (__pAddressbar != null)
        {
-               __pAddressbar->OrientationChanged();
+               int width = GetClientAreaBounds().width;
+               __pAddressbar->OrientationChanged(width);
        }
 }