Added margin
authorHeeJu Kang <mobum.kang@samsung.com>
Fri, 22 Feb 2013 05:45:19 +0000 (14:45 +0900)
committerHeeJu Kang <mobum.kang@samsung.com>
Fri, 22 Feb 2013 05:45:19 +0000 (14:45 +0900)
Change-Id: I820848886f9b36d186b1d03b00c03cb77161b56c
Signed-off-by: HeeJu Kang <mobum.kang@samsung.com>
src/FShell_LiveboxPopup.cpp
src/FShell_LiveboxPopup.h
src/FShell_LiveboxPopupView.cpp
src/FShell_LiveboxPopupView.h
src/FShell_LiveboxView.cpp

index fe5b9cd..87bdc3f 100644 (file)
@@ -30,6 +30,7 @@
 #include "FUi_UiKeyEvent.h"
 #include "FUi_IUiEventManager.h"
 #include "FUi_UiEventManager.h"
+#include "FUi_ResourceManager.h"
 #include "FUiAnim_DisplayManager.h"
 #include "FUiAnim_RootVisualElement.h"
 #include "FShell_LiveboxLayer.h"
@@ -271,6 +272,29 @@ _LiveboxPopup::GetAnchorPosition(void) const
        return __pLiveboxPopupPresenter->GetAnchorPosition();
 }
 
+Rectangle
+_LiveboxPopup::GetLiveboxPopupClientBounds(void) const
+{
+       int leftMargin = 0;
+       int rightMargin = 0;
+       int topMargin = 0;
+       int bottomMargin = 0;
+       _ControlOrientation orientation = GetOrientation();
+
+       GET_SHAPE_CONFIG(LIVEBOX::POPUP_LEFT_MARGIN, orientation, leftMargin);
+       GET_SHAPE_CONFIG(LIVEBOX::POPUP_RIGHT_MARGIN, orientation, rightMargin);
+       GET_SHAPE_CONFIG(LIVEBOX::POPUP_TOP_MARGIN, orientation, topMargin);
+       GET_SHAPE_CONFIG(LIVEBOX::POPUP_BOTTOM_MARGIN, orientation, bottomMargin);
+
+       Rectangle bounds = GetBounds();
+
+       Rectangle clientBounds(bounds.x + leftMargin, bounds.y + topMargin, bounds.width - leftMargin - rightMargin, bounds.height - topMargin - bottomMargin);
+
+       SysLog(NID_UI_CTRL, "[%d %d %d %d]", clientBounds.x, clientBounds.y, clientBounds.width, clientBounds.height);
+
+       return clientBounds;
+}
+
 result
 _LiveboxPopup::SetLayerShowState(bool showState)
 {
@@ -343,6 +367,8 @@ _LiveboxPopup::OnBoundsChanged(void)
        Rectangle bounds = GetBounds();
 
        SetLayerBounds(bounds);
+
+       SetClientBounds(GetLiveboxPopupClientBounds());
 }
 
 void
index 18de23a..cfacb34 100644 (file)
@@ -66,6 +66,7 @@ public:
        Tizen::Base::String GetProviderId(void) const;
        void SetAnchorPosition(const Tizen::Graphics::FloatPoint& position);
        Tizen::Graphics::FloatPoint GetAnchorPosition(void) const;
+       Tizen::Graphics::Rectangle GetLiveboxPopupClientBounds(void) const;
 
 protected:
        _LiveboxPopup(void);
index 82bc204..01e663d 100644 (file)
@@ -214,7 +214,7 @@ _LiveboxPopupView::FireLiveboxPopupEvent(bool open)
 }
 
 void
-_LiveboxPopupView::GetTouchPostion(const Tizen::Graphics::Point& point, double& x, double& y)
+_LiveboxPopupView::GetTouchPostion(const Tizen::Graphics::Point& point, double& x, double& y) const
 {
        Rectangle bounds = GetBounds();
 
@@ -226,7 +226,7 @@ void
 _LiveboxPopupView::PlayAnimation(bool open)
 {
        const int ANIMATION1_DURATION = 100;
-       const int ANIMATION2_DURATION = 300;
+//     const int ANIMATION2_DURATION = 300;
 
        _VisualElement* pVisualElement = GetVisualElement();
        result r = GetLastResult();
index 7d09361..fe6975a 100644 (file)
@@ -84,7 +84,7 @@ private:
        void SetPopupBounds(const Tizen::Graphics::Dimension& size);
        void GetRemainingSpace(int& lower, int& upper) const;
        void FireLiveboxPopupEvent(bool open);
-       void GetTouchPostion(const Tizen::Graphics::Point& point, double& x, double& y);
+       void GetTouchPostion(const Tizen::Graphics::Point& point, double& x, double& y) const;
        void PlayAnimation(bool open);
 
        virtual result OnAttached(void);
index 34796db..8bb3fe4 100644 (file)
@@ -36,6 +36,7 @@
 #include "FShell_LiveboxViewPresenter.h"
 #include "FShell_LiveboxPopupView.h"
 #include "FShell_LiveboxViewManager.h"
+#include "FUi_ResourceManager.h"
 #include "FUiAnim_EflNode.h"
 #include "FUiAnim_VisualElementImpl.h"
 #include "FUiAnim_VisualElementSurfaceImpl.h"
@@ -196,15 +197,24 @@ _LiveboxView::OpenLiveboxPopup(void)
        Rectangle bounds = GetBounds();
        Rectangle absoluteBounds = GetAbsoluteBounds();
 
+       int leftMargin = 0;
+       int rightMargin = 0;
+       int topMargin = 0;
+       int bottomMargin = 0;
+       _ControlOrientation orientation = GetOrientation();
+
+       GET_SHAPE_CONFIG(LIVEBOX::POPUP_TOP_MARGIN, orientation, topMargin);
+       GET_SHAPE_CONFIG(LIVEBOX::POPUP_BOTTOM_MARGIN, orientation, bottomMargin);
+
        Rectangle parentClientBounds = pParent->GetClientBounds();
        int remainingSpace = parentClientBounds.height - bounds.y - bounds.height;
        if (size.height > remainingSpace)
        {
-               popupBounds.y = absoluteBounds.y - size.height;
+               popupBounds.y = absoluteBounds.y - size.height + bottomMargin;
        }
        else
        {
-               popupBounds.y = absoluteBounds.y + absoluteBounds.height;
+               popupBounds.y = absoluteBounds.y + absoluteBounds.height - topMargin;
        }
 
        SysLog(NID_UI_CTRL, "[%d %d %d %d]", parentClientBounds.height, remainingSpace, popupBounds.y, size.height);