|
|
ebc4bd |
From 21c291f571daf25a7ed15f7baf551a6aac08f35f Mon Sep 17 00:00:00 2001
|
|
|
ebc4bd |
From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= <tomaz.vajngerl@collabora.com>
|
|
|
ebc4bd |
Date: Mon, 25 Aug 2014 18:20:58 +0200
|
|
|
ebc4bd |
Subject: [PATCH] fdo#36772 Move the scrollbar and sheet tabs in a separate
|
|
|
ebc4bd |
row.
|
|
|
ebc4bd |
MIME-Version: 1.0
|
|
|
ebc4bd |
Content-Type: text/plain; charset=UTF-8
|
|
|
ebc4bd |
Content-Transfer-Encoding: 8bit
|
|
|
ebc4bd |
|
|
|
ebc4bd |
Change-Id: I57d891d9f6e89dafb4840a577ba55baa734fdcc2
|
|
|
ebc4bd |
(cherry picked from commit 1d1d1c62caf2ee6a96946e96d782e03f3ef80439)
|
|
|
ebc4bd |
|
|
|
ebc4bd |
Move the scrollbar and layer tabs in a separate row in Draw
|
|
|
ebc4bd |
|
|
|
ebc4bd |
The reason for this is that the height of the scrollbar is theme-dependent
|
|
|
ebc4bd |
and makes the tabs unreadable if it's too small.
|
|
|
ebc4bd |
|
|
|
ebc4bd |
The same has already been done for Calc (fdo#36772).
|
|
|
ebc4bd |
|
|
|
ebc4bd |
Reviewed-on: https://gerrit.libreoffice.org/11480
|
|
|
ebc4bd |
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
|
ebc4bd |
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
|
ebc4bd |
(cherry picked from commit 20800ebc7ef05637134c3915798e13a272663341)
|
|
|
ebc4bd |
|
|
|
ebc4bd |
Conflicts:
|
|
|
ebc4bd |
sd/source/ui/view/grviewsh.cxx
|
|
|
ebc4bd |
|
|
|
ebc4bd |
Change-Id: Ibe22cf5e7d5863ccf276c19bfa969f5b5fc16a5a
|
|
|
ebc4bd |
---
|
|
|
ebc4bd |
sc/source/ui/view/tabcont.cxx | 3 +-
|
|
|
ebc4bd |
sc/source/ui/view/tabview.cxx | 60 ++++++++++++++++-------------------
|
|
|
ebc4bd |
sd/source/ui/dlg/LayerTabBar.cxx | 2 +-
|
|
|
ebc4bd |
sd/source/ui/inc/FrameView.hxx | 4 ---
|
|
|
ebc4bd |
sd/source/ui/inc/GraphicViewShell.hxx | 3 --
|
|
|
ebc4bd |
sd/source/ui/view/drviews5.cxx | 3 +-
|
|
|
ebc4bd |
sd/source/ui/view/frmview.cxx | 2 --
|
|
|
ebc4bd |
sd/source/ui/view/grviewsh.cxx | 55 ++++----------------------------
|
|
|
ebc4bd |
sd/source/ui/view/viewshel.cxx | 11 +++----
|
|
|
ebc4bd |
9 files changed, 42 insertions(+), 101 deletions(-)
|
|
|
ebc4bd |
|
|
|
ebc4bd |
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
|
|
|
ebc4bd |
index e609277..dbecb26 100644
|
|
|
ebc4bd |
--- a/sc/source/ui/view/tabcont.cxx
|
|
|
ebc4bd |
+++ b/sc/source/ui/view/tabcont.cxx
|
|
|
ebc4bd |
@@ -39,8 +39,7 @@
|
|
|
ebc4bd |
|
|
|
ebc4bd |
ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
|
|
|
ebc4bd |
TabBar( pParent,
|
|
|
ebc4bd |
- WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT |
|
|
|
ebc4bd |
- WB_MULTISELECT | WB_DRAG | WB_SIZEABLE) ),
|
|
|
ebc4bd |
+ WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG ) ),
|
|
|
ebc4bd |
DropTargetHelper( this ),
|
|
|
ebc4bd |
DragSourceHelper( this ),
|
|
|
ebc4bd |
pViewData( pData ),
|
|
|
ebc4bd |
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
|
|
|
ebc4bd |
index 286f1c1..a1ac0d0 100644
|
|
|
ebc4bd |
--- a/sc/source/ui/view/tabview.cxx
|
|
|
ebc4bd |
+++ b/sc/source/ui/view/tabview.cxx
|
|
|
ebc4bd |
@@ -57,9 +57,6 @@
|
|
|
ebc4bd |
#define SPLIT_HANDLE_SIZE 5
|
|
|
ebc4bd |
#define SC_ICONSIZE 36
|
|
|
ebc4bd |
|
|
|
ebc4bd |
-#define SC_SCROLLBAR_MIN 30
|
|
|
ebc4bd |
-#define SC_TABBAR_MIN 6
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
using namespace ::com::sun::star;
|
|
|
ebc4bd |
|
|
|
ebc4bd |
// Corner-Button
|
|
|
ebc4bd |
@@ -343,7 +340,12 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
|
|
|
ebc4bd |
aBorderPos = rOffset;
|
|
|
ebc4bd |
aFrameSize = rSize;
|
|
|
ebc4bd |
|
|
|
ebc4bd |
+ const StyleSettings& rStyleSettings = pFrameWin->GetSettings().GetStyleSettings();
|
|
|
ebc4bd |
+
|
|
|
ebc4bd |
+ sal_Int32 nTabWidth = pFrameWin->GetFont().GetHeight() + 4;
|
|
|
ebc4bd |
+
|
|
|
ebc4bd |
if ( aViewData.GetHSplitMode() != SC_SPLIT_NONE )
|
|
|
ebc4bd |
+ {
|
|
|
ebc4bd |
if ( aViewData.GetHSplitPos() > nSizeX - SPLIT_MARGIN )
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
aViewData.SetHSplitMode( SC_SPLIT_NONE );
|
|
|
ebc4bd |
@@ -351,7 +353,9 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
|
|
|
ebc4bd |
ActivatePart( SC_SPLIT_BOTTOMLEFT );
|
|
|
ebc4bd |
InvalidateSplit();
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
+ }
|
|
|
ebc4bd |
if ( aViewData.GetVSplitMode() != SC_SPLIT_NONE )
|
|
|
ebc4bd |
+ {
|
|
|
ebc4bd |
if ( aViewData.GetVSplitPos() > nSizeY - SPLIT_MARGIN )
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
aViewData.SetVSplitMode( SC_SPLIT_NONE );
|
|
|
ebc4bd |
@@ -359,12 +363,13 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
|
|
|
ebc4bd |
ActivatePart( SC_SPLIT_BOTTOMLEFT );
|
|
|
ebc4bd |
InvalidateSplit();
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
+ }
|
|
|
ebc4bd |
|
|
|
ebc4bd |
UpdateShow();
|
|
|
ebc4bd |
|
|
|
ebc4bd |
if (bHScroll || bVScroll) // Scrollbars horizontal oder vertikal
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
- long nScrollBarSize = pFrameWin->GetSettings().GetStyleSettings().GetScrollBarSize();
|
|
|
ebc4bd |
+ long nScrollBarSize = rStyleSettings.GetScrollBarSize();
|
|
|
ebc4bd |
if (bVScroll)
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
nBarX = nScrollBarSize;
|
|
|
ebc4bd |
@@ -372,7 +377,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
if (bHScroll)
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
- nBarY = nScrollBarSize;
|
|
|
ebc4bd |
+ nBarY = nScrollBarSize + nTabWidth;
|
|
|
ebc4bd |
nSizeY -= nBarY - nOverlap;
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
|
|
|
ebc4bd |
@@ -403,7 +408,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
nSizeRt = nSizeX - nSizeLt - nSizeSp;
|
|
|
ebc4bd |
|
|
|
ebc4bd |
- long nTabSize = 0;
|
|
|
ebc4bd |
if (bTabControl)
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
// pending relative tab bar width from extended document options
|
|
|
ebc4bd |
@@ -412,39 +416,30 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
|
|
|
ebc4bd |
SetRelTabBarWidth( mfPendingTabBarWidth );
|
|
|
ebc4bd |
mfPendingTabBarWidth = -1.0;
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- nTabSize = pTabControl->GetSizePixel().Width()-nOverlap;
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- if ( aViewData.GetHSplitMode() != SC_SPLIT_FIX ) // bei linkem Scrollbar
|
|
|
ebc4bd |
- {
|
|
|
ebc4bd |
- if (nTabSize > nSizeLt-SC_SCROLLBAR_MIN) nTabSize = nSizeLt-SC_SCROLLBAR_MIN;
|
|
|
ebc4bd |
- if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN;
|
|
|
ebc4bd |
- nSizeLt -= nTabSize;
|
|
|
ebc4bd |
- }
|
|
|
ebc4bd |
- else // bei rechtem Scrollbar
|
|
|
ebc4bd |
- {
|
|
|
ebc4bd |
- if (nTabSize > nSizeRt-SC_SCROLLBAR_MIN) nTabSize = nSizeRt-SC_SCROLLBAR_MIN;
|
|
|
ebc4bd |
- if (nTabSize < SC_TABBAR_MIN) nTabSize = SC_TABBAR_MIN;
|
|
|
ebc4bd |
- nSizeRt -= nTabSize;
|
|
|
ebc4bd |
- }
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
|
|
|
ebc4bd |
- lcl_SetPosSize( *pTabControl, Point(nPosX-nOverlap, nPosY+nSizeY),
|
|
|
ebc4bd |
- Size(nTabSize+nOverlap, nBarY), nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
+ Point aTabPoint(nPosX - nOverlap, nPosY + nSizeY + nScrollBarSize);
|
|
|
ebc4bd |
+ Size aTabSize(nSizeX, nBarY - nScrollBarSize);
|
|
|
ebc4bd |
+ lcl_SetPosSize( *pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
pTabControl->SetSheetLayoutRTL( bLayoutRTL );
|
|
|
ebc4bd |
|
|
|
ebc4bd |
- lcl_SetPosSize( aHScrollLeft, Point(nPosX+nTabSize-nOverlap, nPosY+nSizeY),
|
|
|
ebc4bd |
- Size(nSizeLt+2*nOverlap, nBarY), nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
- lcl_SetPosSize( *pHSplitter, Point( nPosX+nTabSize+nSizeLt, nPosY+nSizeY ),
|
|
|
ebc4bd |
- Size( nSizeSp, nBarY ), nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
- lcl_SetPosSize( aHScrollRight, Point(nPosX+nTabSize+nSizeLt+nSizeSp-nOverlap,
|
|
|
ebc4bd |
- nPosY+nSizeY),
|
|
|
ebc4bd |
- Size(nSizeRt+2*nOverlap, nBarY), nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
+ Point aHScrollLeftPoint(nPosX - nOverlap, nPosY + nSizeY);
|
|
|
ebc4bd |
+ Size aHScrollLeftSize(nSizeLt + 2 * nOverlap, nScrollBarSize);
|
|
|
ebc4bd |
+ lcl_SetPosSize( aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
+
|
|
|
ebc4bd |
+ Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY);
|
|
|
ebc4bd |
+ Size aHSplitterSize(nSizeSp, nScrollBarSize);
|
|
|
ebc4bd |
+ lcl_SetPosSize( *pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
+
|
|
|
ebc4bd |
+ Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp - nOverlap, nPosY + nSizeY);
|
|
|
ebc4bd |
+ Size aHScrollRightSize(nSizeRt + 2 * nOverlap, nScrollBarSize);
|
|
|
ebc4bd |
+
|
|
|
ebc4bd |
+ lcl_SetPosSize( aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
|
|
|
ebc4bd |
// SetDragRectPixel is done below
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
|
|
|
ebc4bd |
- if (bVScroll) // Scrollbars vertikal
|
|
|
ebc4bd |
+ if (bVScroll)
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
long nSizeUp = 0; // upper scroll bar
|
|
|
ebc4bd |
long nSizeSp = 0; // splitter
|
|
|
ebc4bd |
@@ -564,7 +559,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
nSplitPosX = aViewData.GetHSplitPos();
|
|
|
ebc4bd |
lcl_SetPosSize( *pHSplitter,
|
|
|
ebc4bd |
- Point( nSplitPosX, nOutPosY ), Size( nSplitSizeX, nSplitHeight ), nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
+ Point(nSplitPosX, nOutPosY),
|
|
|
ebc4bd |
+ Size( nSplitSizeX, nSplitHeight - nTabWidth ), nTotalWidth, bLayoutRTL );
|
|
|
ebc4bd |
nLeftSize = nSplitPosX - nPosX;
|
|
|
ebc4bd |
nSplitPosX += nSplitSizeX;
|
|
|
ebc4bd |
nRightSize = nSizeX - nLeftSize - nSplitSizeX;
|
|
|
ebc4bd |
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
|
|
|
ebc4bd |
index fa14066..db9a764 100644
|
|
|
ebc4bd |
--- a/sd/source/ui/dlg/LayerTabBar.cxx
|
|
|
ebc4bd |
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
|
|
|
ebc4bd |
@@ -48,7 +48,7 @@ namespace sd {
|
|
|
ebc4bd |
* default constructor
|
|
|
ebc4bd |
*/
|
|
|
ebc4bd |
LayerTabBar::LayerTabBar(DrawViewShell* pViewSh, Window* pParent)
|
|
|
ebc4bd |
- : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_SIZEABLE ) ),
|
|
|
ebc4bd |
+ : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL ) ),
|
|
|
ebc4bd |
DropTargetHelper( this ),
|
|
|
ebc4bd |
pDrViewSh(pViewSh)
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx
|
|
|
ebc4bd |
index 40bdffe..120570f 100644
|
|
|
ebc4bd |
--- a/sd/source/ui/inc/FrameView.hxx
|
|
|
ebc4bd |
+++ b/sd/source/ui/inc/FrameView.hxx
|
|
|
ebc4bd |
@@ -163,9 +163,6 @@ public:
|
|
|
ebc4bd |
void SetDrawMode(sal_uLong nNewDrawMode) { mnDrawMode = nNewDrawMode; };
|
|
|
ebc4bd |
sal_uLong GetDrawMode() const { return mnDrawMode; };
|
|
|
ebc4bd |
|
|
|
ebc4bd |
- void SetTabCtrlPercent( double nPercent ) { mnTabCtrlPercent = nPercent; }
|
|
|
ebc4bd |
- double GetTabCtrlPercent() const { return mnTabCtrlPercent; }
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
void SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes);
|
|
|
ebc4bd |
bool IsNavigatorShowingAllShapes (void) const;
|
|
|
ebc4bd |
|
|
|
ebc4bd |
@@ -200,7 +197,6 @@ private:
|
|
|
ebc4bd |
sal_uInt16 mnSlotId; ///< SlotId, which was initial mentioned
|
|
|
ebc4bd |
sal_uInt16 mnSlidesPerRow; ///< slides per row on the slide-desk
|
|
|
ebc4bd |
sal_uLong mnDrawMode; ///< draw mode for the normal window
|
|
|
ebc4bd |
- double mnTabCtrlPercent;
|
|
|
ebc4bd |
/** Remember whether the navigator shows all shapes (<TRUE/>) or only
|
|
|
ebc4bd |
the names ones (<FALSE/>). Not persistent.
|
|
|
ebc4bd |
*/
|
|
|
ebc4bd |
diff --git a/sd/source/ui/inc/GraphicViewShell.hxx b/sd/source/ui/inc/GraphicViewShell.hxx
|
|
|
ebc4bd |
index 632a31e..3f35b78 100644
|
|
|
ebc4bd |
--- a/sd/source/ui/inc/GraphicViewShell.hxx
|
|
|
ebc4bd |
+++ b/sd/source/ui/inc/GraphicViewShell.hxx
|
|
|
ebc4bd |
@@ -72,9 +72,6 @@ public:
|
|
|
ebc4bd |
protected:
|
|
|
ebc4bd |
void ConstructGraphicViewShell (void);
|
|
|
ebc4bd |
virtual void ArrangeGUIElements (void) SAL_OVERRIDE;
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
-private:
|
|
|
ebc4bd |
- DECL_LINK(TabBarSplitHandler, TabBar*);
|
|
|
ebc4bd |
};
|
|
|
ebc4bd |
|
|
|
ebc4bd |
} // end of namespace sd
|
|
|
ebc4bd |
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
|
|
|
ebc4bd |
index 2e98ec5..fbe01c1 100644
|
|
|
ebc4bd |
--- a/sd/source/ui/view/drviews5.cxx
|
|
|
ebc4bd |
+++ b/sd/source/ui/view/drviews5.cxx
|
|
|
ebc4bd |
@@ -113,8 +113,7 @@ void DrawViewShell::ArrangeGUIElements (void)
|
|
|
ebc4bd |
// Retrieve the current size (thickness) of the scroll bars. That is
|
|
|
ebc4bd |
// the width of the vertical and the height of the horizontal scroll
|
|
|
ebc4bd |
// bar.
|
|
|
ebc4bd |
- int nScrollBarSize =
|
|
|
ebc4bd |
- GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize();
|
|
|
ebc4bd |
+ int nScrollBarSize = GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize();
|
|
|
ebc4bd |
maScrBarWH = Size (nScrollBarSize, nScrollBarSize);
|
|
|
ebc4bd |
|
|
|
ebc4bd |
Point aHPos = maViewPos;
|
|
|
ebc4bd |
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
|
|
|
ebc4bd |
index 3121d64..c114d81 100644
|
|
|
ebc4bd |
--- a/sd/source/ui/view/frmview.cxx
|
|
|
ebc4bd |
+++ b/sd/source/ui/view/frmview.cxx
|
|
|
ebc4bd |
@@ -194,7 +194,6 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
|
|
|
ebc4bd |
mbClickChangeRotation = pFrameView->IsClickChangeRotation();
|
|
|
ebc4bd |
mnSlidesPerRow = pFrameView->GetSlidesPerRow();
|
|
|
ebc4bd |
mnDrawMode = pFrameView->GetDrawMode();
|
|
|
ebc4bd |
- mnTabCtrlPercent = pFrameView->GetTabCtrlPercent();
|
|
|
ebc4bd |
mbIsNavigatorShowingAllShapes = pFrameView->IsNavigatorShowingAllShapes();
|
|
|
ebc4bd |
SetPreviousViewShellType (pFrameView->GetPreviousViewShellType());
|
|
|
ebc4bd |
SetViewShellTypeOnLoad (pFrameView->GetViewShellTypeOnLoad());
|
|
|
ebc4bd |
@@ -228,7 +227,6 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
|
|
|
ebc4bd |
bool bUseContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
|
|
|
ebc4bd |
mnDrawMode = bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR;
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
- mnTabCtrlPercent = 0.0;
|
|
|
ebc4bd |
mbIsNavigatorShowingAllShapes = false;
|
|
|
ebc4bd |
SetPreviousViewShellType (ViewShell::ST_NONE);
|
|
|
ebc4bd |
SetViewShellTypeOnLoad (ViewShell::ST_IMPRESS);
|
|
|
ebc4bd |
diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx
|
|
|
ebc4bd |
index 253a6e7..01af5d6 100644
|
|
|
ebc4bd |
--- a/sd/source/ui/view/grviewsh.cxx
|
|
|
ebc4bd |
+++ b/sd/source/ui/view/grviewsh.cxx
|
|
|
ebc4bd |
@@ -30,9 +30,6 @@
|
|
|
ebc4bd |
|
|
|
ebc4bd |
namespace sd {
|
|
|
ebc4bd |
|
|
|
ebc4bd |
-static const int TABCONTROL_INITIAL_SIZE = 350;
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
GraphicViewShell::GraphicViewShell (
|
|
|
ebc4bd |
SfxViewFrame* pFrame,
|
|
|
ebc4bd |
ViewShellBase& rViewShellBase,
|
|
|
ebc4bd |
@@ -59,10 +56,9 @@ void GraphicViewShell::ConstructGraphicViewShell(void)
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
meShellType = ST_DRAW;
|
|
|
ebc4bd |
|
|
|
ebc4bd |
- mpLayerTabBar.reset (new LayerTabBar(this,GetParentWindow()));
|
|
|
ebc4bd |
- mpLayerTabBar->SetSplitHdl(LINK(this,GraphicViewShell,TabBarSplitHandler));
|
|
|
ebc4bd |
+ mpLayerTabBar.reset (new LayerTabBar(this, GetParentWindow()));
|
|
|
ebc4bd |
|
|
|
ebc4bd |
- // pb: #i67363# no layer tabbar on preview mode
|
|
|
ebc4bd |
+ // #i67363# no layer tabbar in preview mode
|
|
|
ebc4bd |
if ( !GetObjectShell()->IsPreview() )
|
|
|
ebc4bd |
mpLayerTabBar->Show();
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
@@ -88,58 +84,19 @@ void GraphicViewShell::ArrangeGUIElements (void)
|
|
|
ebc4bd |
if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible())
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
Size aSize = mpLayerTabBar->GetSizePixel();
|
|
|
ebc4bd |
- const Size aFrameSize (
|
|
|
ebc4bd |
- GetViewFrame()->GetWindow().GetOutputSizePixel());
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- if (aSize.Width() == 0)
|
|
|
ebc4bd |
- {
|
|
|
ebc4bd |
- if (mpFrameView->GetTabCtrlPercent() == 0.0)
|
|
|
ebc4bd |
- aSize.Width() = TABCONTROL_INITIAL_SIZE;
|
|
|
ebc4bd |
- else
|
|
|
ebc4bd |
- aSize.Width() = FRound(aFrameSize.Width()
|
|
|
ebc4bd |
- * mpFrameView->GetTabCtrlPercent());
|
|
|
ebc4bd |
- }
|
|
|
ebc4bd |
- aSize.Height() = GetParentWindow()->GetSettings().GetStyleSettings()
|
|
|
ebc4bd |
- .GetScrollBarSize();
|
|
|
ebc4bd |
+ const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel());
|
|
|
ebc4bd |
+
|
|
|
ebc4bd |
+ aSize.Height() = GetParentWindow()->GetFont().GetHeight() + 4;
|
|
|
ebc4bd |
+ aSize.Width() = aFrameSize.Width();
|
|
|
ebc4bd |
|
|
|
ebc4bd |
Point aPos (0, maViewSize.Height() - aSize.Height());
|
|
|
ebc4bd |
|
|
|
ebc4bd |
mpLayerTabBar->SetPosSizePixel (aPos, aSize);
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- if (aFrameSize.Width() > 0)
|
|
|
ebc4bd |
- mpFrameView->SetTabCtrlPercent (
|
|
|
ebc4bd |
- (double) maTabControl.GetSizePixel().Width()
|
|
|
ebc4bd |
- / aFrameSize.Width());
|
|
|
ebc4bd |
- else
|
|
|
ebc4bd |
- mpFrameView->SetTabCtrlPercent( 0.0 );
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
|
|
|
ebc4bd |
DrawViewShell::ArrangeGUIElements();
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
-IMPL_LINK(GraphicViewShell, TabBarSplitHandler, TabBar*, pTabBar)
|
|
|
ebc4bd |
-{
|
|
|
ebc4bd |
- const long int nMax = maViewSize.Width()
|
|
|
ebc4bd |
- - maScrBarWH.Width()
|
|
|
ebc4bd |
- - pTabBar->GetPosPixel().X();
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- Size aTabSize = pTabBar->GetSizePixel();
|
|
|
ebc4bd |
- aTabSize.Width() = std::min(pTabBar->GetSplitSize(), (long)(nMax-1));
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- pTabBar->SetSizePixel (aTabSize);
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- Point aPos = pTabBar->GetPosPixel();
|
|
|
ebc4bd |
- aPos.X() += aTabSize.Width();
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- Size aScrSize (nMax - aTabSize.Width(), maScrBarWH.Height());
|
|
|
ebc4bd |
- mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize);
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
- return 0;
|
|
|
ebc4bd |
-}
|
|
|
ebc4bd |
-
|
|
|
ebc4bd |
} // end of namespace sd
|
|
|
ebc4bd |
|
|
|
ebc4bd |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
|
|
ebc4bd |
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
|
|
|
ebc4bd |
index 28e272e..4d6804d 100644
|
|
|
ebc4bd |
--- a/sd/source/ui/view/viewshel.cxx
|
|
|
ebc4bd |
+++ b/sd/source/ui/view/viewshel.cxx
|
|
|
ebc4bd |
@@ -914,13 +914,12 @@ void ViewShell::ArrangeGUIElements (void)
|
|
|
ebc4bd |
if (mpHorizontalScrollBar.get()!=NULL
|
|
|
ebc4bd |
&& mpHorizontalScrollBar->IsVisible())
|
|
|
ebc4bd |
{
|
|
|
ebc4bd |
- int nLocalLeft = nLeft;
|
|
|
ebc4bd |
- if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible())
|
|
|
ebc4bd |
- nLocalLeft += mpLayerTabBar->GetSizePixel().Width();
|
|
|
ebc4bd |
nBottom -= maScrBarWH.Height();
|
|
|
ebc4bd |
+ if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible())
|
|
|
ebc4bd |
+ nBottom -= mpLayerTabBar->GetSizePixel().Height();
|
|
|
ebc4bd |
mpHorizontalScrollBar->SetPosSizePixel (
|
|
|
ebc4bd |
- Point(nLocalLeft,nBottom),
|
|
|
ebc4bd |
- Size(nRight-nLocalLeft-maScrBarWH.Width(),maScrBarWH.Height()));
|
|
|
ebc4bd |
+ Point(nLeft, nBottom),
|
|
|
ebc4bd |
+ Size(nRight - nLeft - maScrBarWH.Width(), maScrBarWH.Height()));
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
|
|
|
ebc4bd |
// Vertical scrollbar.
|
|
|
ebc4bd |
@@ -930,7 +929,7 @@ void ViewShell::ArrangeGUIElements (void)
|
|
|
ebc4bd |
nRight -= maScrBarWH.Width();
|
|
|
ebc4bd |
mpVerticalScrollBar->SetPosSizePixel (
|
|
|
ebc4bd |
Point(nRight,nTop),
|
|
|
ebc4bd |
- Size (maScrBarWH.Width(),nBottom-nTop));
|
|
|
ebc4bd |
+ Size (maScrBarWH.Width(), nBottom-nTop));
|
|
|
ebc4bd |
}
|
|
|
ebc4bd |
|
|
|
ebc4bd |
// Filler in the lower right corner.
|
|
|
ebc4bd |
--
|
|
|
ebc4bd |
1.9.3
|
|
|
ebc4bd |
|