From 75e47997f897c4682861cec067e915765c311afb Mon Sep 17 00:00:00 2001 From: "sr.shashank" Date: Tue, 23 Apr 2013 16:02:47 +0530 Subject: [PATCH] Fix for TDIS-5476. (Resetting the divider position in case of MaximizePane). Change-Id: Iec3ddd7d5893394acdaf485d4739e1b7d33440be Signed-off-by: sr.shashank --- src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp | 36 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp b/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp index ddeaf50..c36392e 100644 --- a/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp @@ -611,7 +611,6 @@ _SplitPanelPresenter::SetPaneBounds(void) FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f); FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f); FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f); - FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f); FloatPoint panePostion(0.0f, 0.0f); _Control* pFirstPane = null; _Control* pSecondPane = null; @@ -640,11 +639,6 @@ _SplitPanelPresenter::SetPaneBounds(void) { secondPaneBounds = FloatRectangle(0.0f, clientBounds.height + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height); } - - dividerBounds = __dividerRectangle; - dividerBounds.x = clientBounds.width; - - __pSplitPanel->SetDividerVisualElementBounds(dividerBounds); } else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND)) { @@ -658,11 +652,6 @@ _SplitPanelPresenter::SetPaneBounds(void) { firstPaneBounds = FloatRectangle(0.0f, clientBounds.y -__dividerRectangle.y - __dividerRectangle.height, clientBounds.width, __dividerRectangle.y); } - - dividerBounds = __dividerRectangle; - dividerBounds.x = -__dividerRectangle.width; - - __pSplitPanel->SetDividerVisualElementBounds(dividerBounds); } else { @@ -735,6 +724,7 @@ _SplitPanelPresenter::AdjustDividerRectangle(void) float width = 0.0f; float height = 0.0f; FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f); _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT; Bitmap* pThumbBitmap = null; @@ -764,6 +754,17 @@ _SplitPanelPresenter::AdjustDividerRectangle(void) { __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height); __dividerThumbRectangle = FloatRectangle(dividerPosition, ((height - pThumbBitmap->GetHeightF()) / 2.0f), pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF()); + + dividerBounds = __dividerRectangle; + + if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST)) + { + dividerBounds.x = clientBounds.width; + } + else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND)) + { + dividerBounds.x = -__dividerRectangle.width; + } } } else @@ -774,10 +775,21 @@ _SplitPanelPresenter::AdjustDividerRectangle(void) { __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height); __dividerThumbRectangle = FloatRectangle(((width - pThumbBitmap->GetWidth()) / 2.0f), dividerPosition, pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF()); + + dividerBounds = __dividerRectangle; + + if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST)) + { + dividerBounds.y = clientBounds.height; + } + else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND)) + { + dividerBounds.y = -__dividerRectangle.height; + } } } - __pSplitPanel->SetDividerVisualElementBounds(__dividerRectangle); + __pSplitPanel->SetDividerVisualElementBounds(dividerBounds); } result -- 2.7.4