diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-25 18:20:58 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-25 21:34:48 +0200 |
commit | 1d1d1c62caf2ee6a96946e96d782e03f3ef80439 (patch) | |
tree | ceacac5f1a69ab7d7e013b57c31836408454171e /sc | |
parent | ae71b8305cf4385643bf04a0d524443de3dada62 (diff) |
fdo#36772 Move the scrollbar and sheet tabs in a separate row.
Change-Id: I57d891d9f6e89dafb4840a577ba55baa734fdcc2
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/tabcont.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 60 |
2 files changed, 29 insertions, 34 deletions
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index df49a4263adf..3bfeb992692f 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -39,8 +39,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) : TabBar( pParent, - WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT | - WB_MULTISELECT | WB_DRAG | WB_SIZEABLE) ), + WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG ) ), DropTargetHelper( this ), DragSourceHelper( this ), pViewData( pData ), diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 02b99b94f6bc..1b2520b0db31 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -57,9 +57,6 @@ #define SPLIT_HANDLE_SIZE 5 #define SC_ICONSIZE 36 -#define SC_SCROLLBAR_MIN 30 -#define SC_TABBAR_MIN 6 - using namespace ::com::sun::star; // Corner-Button @@ -341,7 +338,12 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) aBorderPos = rOffset; aFrameSize = rSize; + const StyleSettings& rStyleSettings = pFrameWin->GetSettings().GetStyleSettings(); + + sal_Int32 nTabWidth = pFrameWin->GetFont().GetHeight() + 4; + if ( aViewData.GetHSplitMode() != SC_SPLIT_NONE ) + { if ( aViewData.GetHSplitPos() > nSizeX - SPLIT_MARGIN ) { aViewData.SetHSplitMode( SC_SPLIT_NONE ); @@ -349,7 +351,9 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) ActivatePart( SC_SPLIT_BOTTOMLEFT ); InvalidateSplit(); } + } if ( aViewData.GetVSplitMode() != SC_SPLIT_NONE ) + { if ( aViewData.GetVSplitPos() > nSizeY - SPLIT_MARGIN ) { aViewData.SetVSplitMode( SC_SPLIT_NONE ); @@ -357,12 +361,13 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) ActivatePart( SC_SPLIT_BOTTOMLEFT ); InvalidateSplit(); } + } UpdateShow(); if (bHScroll || bVScroll) // Scrollbars horizontal oder vertikal { - long nScrollBarSize = pFrameWin->GetSettings().GetStyleSettings().GetScrollBarSize(); + long nScrollBarSize = rStyleSettings.GetScrollBarSize(); if (bVScroll) { nBarX = nScrollBarSize; @@ -370,7 +375,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) } if (bHScroll) { - nBarY = nScrollBarSize; + nBarY = nScrollBarSize + nTabWidth; nSizeY -= nBarY - nOverlap; } @@ -401,7 +406,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) } nSizeRt = nSizeX - nSizeLt - nSizeSp; - long nTabSize = 0; if (bTabControl) { // pending relative tab bar width from extended document options @@ -410,39 +414,30 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) SetRelTabBarWidth( mfPendingTabBarWidth ); mfPendingTabBarWidth = -1.0; } - - nTabSize = pTabControl->GetSizePixel().Width()-nOverlap; - - if ( aViewData.GetHSplitMode() != SC_SPLIT_FIX ) // bei linkem Scrollbar - { - if (nTabSize > nSizeLt-SC_SCROLLBAR_MIN) nTabSize = nSizeLt-SC_SCROLLBAR_MIN; - if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN; - nSizeLt -= nTabSize; - } - else // bei rechtem Scrollbar - { - if (nTabSize > nSizeRt-SC_SCROLLBAR_MIN) nTabSize = nSizeRt-SC_SCROLLBAR_MIN; - if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN; - nSizeRt -= nTabSize; - } } - lcl_SetPosSize( *pTabControl, Point(nPosX-nOverlap, nPosY+nSizeY), - Size(nTabSize+nOverlap, nBarY), nTotalWidth, bLayoutRTL ); + Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY + nScrollBarSize); + Size aTabSize(nSizeX, nBarY - nScrollBarSize); + lcl_SetPosSize( *pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL ); pTabControl->SetSheetLayoutRTL( bLayoutRTL ); - lcl_SetPosSize( aHScrollLeft, Point(nPosX+nTabSize-nOverlap, nPosY+nSizeY), - Size(nSizeLt+2*nOverlap, nBarY), nTotalWidth, bLayoutRTL ); - lcl_SetPosSize( *pHSplitter, Point( nPosX+nTabSize+nSizeLt, nPosY+nSizeY ), - Size( nSizeSp, nBarY ), nTotalWidth, bLayoutRTL ); - lcl_SetPosSize( aHScrollRight, Point(nPosX+nTabSize+nSizeLt+nSizeSp-nOverlap, - nPosY+nSizeY), - Size(nSizeRt+2*nOverlap, nBarY), nTotalWidth, bLayoutRTL ); + Point aHScrollLeftPoint(nPosX - nOverlap, nPosY + nSizeY); + Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nScrollBarSize); + lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL ); + + Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY); + Size aHSplitterSize(nSizeSp, nScrollBarSize); + lcl_SetPosSize( *pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL ); + + Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY); + Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nScrollBarSize); + + lcl_SetPosSize( aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL ); // SetDragRectPixel is done below } - if (bVScroll) // Scrollbars vertikal + if (bVScroll) { long nSizeUp = 0; // upper scroll bar long nSizeSp = 0; // splitter @@ -560,7 +555,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) } nSplitPosX = aViewData.GetHSplitPos(); lcl_SetPosSize( *pHSplitter, - Point( nSplitPosX, nOutPosY ), Size( nSplitSizeX, nSplitHeight ), nTotalWidth, bLayoutRTL ); + Point(nSplitPosX, nOutPosY), + Size( nSplitSizeX, nSplitHeight - nTabWidth ), nTotalWidth, bLayoutRTL ); nLeftSize = nSplitPosX - nPosX; nSplitPosX += nSplitSizeX; nRightSize = nSizeX - nLeftSize - nSplitSizeX; |