diff options
author | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-16 23:15:40 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2014-09-17 16:21:47 +0000 |
commit | 20800ebc7ef05637134c3915798e13a272663341 (patch) | |
tree | 5b98b04c6ebdd4776142515d4fa3a5b4e1890990 | |
parent | ffeac200b21a2f6b83cea2311562149554f87500 (diff) |
Move the scrollbar and layer tabs in a separate row in Draw
The reason for this is that the height of the scrollbar is theme-dependent
and makes the tabs unreadable if it's too small.
The same has already been done for Calc (fdo#36772).
Change-Id: Ibe22cf5e7d5863ccf276c19bfa969f5b5fc16a5a
Reviewed-on: https://gerrit.libreoffice.org/11480
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | sd/source/ui/dlg/LayerTabBar.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/FrameView.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/inc/GraphicViewShell.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/drviews5.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/frmview.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/grviewsh.cxx | 51 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 11 |
7 files changed, 13 insertions, 63 deletions
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 82eaf93f7fc9..c12ff2a4bed8 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -45,7 +45,7 @@ namespace sd { * default constructor */ LayerTabBar::LayerTabBar(DrawViewShell* pViewSh, Window* pParent) - : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_SIZEABLE ) ), + : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL ) ), DropTargetHelper( this ), pDrViewSh(pViewSh) { diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx index c9c2c839b4bc..b0a1c02d9de2 100644 --- a/sd/source/ui/inc/FrameView.hxx +++ b/sd/source/ui/inc/FrameView.hxx @@ -163,9 +163,6 @@ public: void SetDrawMode(sal_uLong nNewDrawMode) { mnDrawMode = nNewDrawMode; }; sal_uLong GetDrawMode() const { return mnDrawMode; }; - void SetTabCtrlPercent( double nPercent ) { mnTabCtrlPercent = nPercent; } - double GetTabCtrlPercent() const { return mnTabCtrlPercent; } - void SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes); bool IsNavigatorShowingAllShapes (void) const { return mbIsNavigatorShowingAllShapes;} @@ -200,7 +197,6 @@ private: sal_uInt16 mnSlotId; ///< SlotId, which was initial mentioned sal_uInt16 mnSlidesPerRow; ///< slides per row on the slide-desk sal_uLong mnDrawMode; ///< draw mode for the normal window - double mnTabCtrlPercent; /** Remember whether the navigator shows all shapes (<TRUE/>) or only the names ones (<FALSE/>). Not persistent. */ diff --git a/sd/source/ui/inc/GraphicViewShell.hxx b/sd/source/ui/inc/GraphicViewShell.hxx index 632a31e6f4b0..3f35b7843297 100644 --- a/sd/source/ui/inc/GraphicViewShell.hxx +++ b/sd/source/ui/inc/GraphicViewShell.hxx @@ -72,9 +72,6 @@ public: protected: void ConstructGraphicViewShell (void); virtual void ArrangeGUIElements (void) SAL_OVERRIDE; - -private: - DECL_LINK(TabBarSplitHandler, TabBar*); }; } // end of namespace sd diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 118e2f56c80b..8401254133e0 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -106,8 +106,7 @@ void DrawViewShell::ArrangeGUIElements (void) // Retrieve the current size (thickness) of the scroll bars. That is // the width of the vertical and the height of the horizontal scroll // bar. - int nScrollBarSize = - GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize(); + int nScrollBarSize = GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize(); maScrBarWH = Size (nScrollBarSize, nScrollBarSize); Point aHPos = maViewPos; diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 39aaadbd609a..8ce1f57dad2b 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -192,7 +192,6 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * mbClickChangeRotation = pFrameView->IsClickChangeRotation(); mnSlidesPerRow = pFrameView->GetSlidesPerRow(); mnDrawMode = pFrameView->GetDrawMode(); - mnTabCtrlPercent = pFrameView->GetTabCtrlPercent(); mbIsNavigatorShowingAllShapes = pFrameView->IsNavigatorShowingAllShapes(); SetPreviousViewShellType (pFrameView->GetPreviousViewShellType()); SetViewShellTypeOnLoad (pFrameView->GetViewShellTypeOnLoad()); @@ -226,7 +225,6 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * bool bUseContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); mnDrawMode = bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR; } - mnTabCtrlPercent = 0.0; mbIsNavigatorShowingAllShapes = false; SetPreviousViewShellType (ViewShell::ST_NONE); SetViewShellTypeOnLoad (ViewShell::ST_IMPRESS); diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx index 1156dfa000e4..fcdc1da0522a 100644 --- a/sd/source/ui/view/grviewsh.cxx +++ b/sd/source/ui/view/grviewsh.cxx @@ -29,8 +29,6 @@ namespace sd { -static const int TABCONTROL_INITIAL_SIZE = 350; - GraphicViewShell::GraphicViewShell ( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, @@ -54,10 +52,9 @@ void GraphicViewShell::ConstructGraphicViewShell(void) { meShellType = ST_DRAW; - mpLayerTabBar.reset (new LayerTabBar(this,GetParentWindow())); - mpLayerTabBar->SetSplitHdl(LINK(this,GraphicViewShell,TabBarSplitHandler)); + mpLayerTabBar.reset (new LayerTabBar(this, GetParentWindow())); - // pb: #i67363# no layer tabbar on preview mode + // #i67363# no layer tabbar in preview mode if ( !GetObjectShell()->IsPreview() ) mpLayerTabBar->Show(); } @@ -77,55 +74,19 @@ void GraphicViewShell::ArrangeGUIElements (void) if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) { Size aSize = mpLayerTabBar->GetSizePixel(); - const Size aFrameSize ( - GetViewFrame()->GetWindow().GetOutputSizePixel()); - - if (aSize.Width() == 0) - { - if (mpFrameView->GetTabCtrlPercent() == 0.0) - aSize.Width() = TABCONTROL_INITIAL_SIZE; - else - aSize.Width() = FRound(aFrameSize.Width() - * mpFrameView->GetTabCtrlPercent()); - } - aSize.Height() = GetParentWindow()->GetSettings().GetStyleSettings() - .GetScrollBarSize(); + const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel()); + + aSize.Height() = GetParentWindow()->GetFont().GetHeight() + 4; + aSize.Width() = aFrameSize.Width(); Point aPos (0, maViewSize.Height() - aSize.Height()); mpLayerTabBar->SetPosSizePixel (aPos, aSize); - - if (aFrameSize.Width() > 0) - mpFrameView->SetTabCtrlPercent ( - (double) maTabControl.GetSizePixel().Width() - / aFrameSize.Width()); - else - mpFrameView->SetTabCtrlPercent( 0.0 ); } DrawViewShell::ArrangeGUIElements(); } -IMPL_LINK(GraphicViewShell, TabBarSplitHandler, TabBar*, pTabBar) -{ - const long int nMax = maViewSize.Width() - - maScrBarWH.Width() - - pTabBar->GetPosPixel().X(); - - Size aTabSize = pTabBar->GetSizePixel(); - aTabSize.Width() = std::min(pTabBar->GetSplitSize(), (long)(nMax-1)); - - pTabBar->SetSizePixel (aTabSize); - - Point aPos = pTabBar->GetPosPixel(); - aPos.X() += aTabSize.Width(); - - Size aScrSize (nMax - aTabSize.Width(), maScrBarWH.Height()); - mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize); - - return 0; -} - } // end of namespace sd /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index e0a1800deaff..9cc670bb992e 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -873,13 +873,12 @@ void ViewShell::ArrangeGUIElements (void) if (mpHorizontalScrollBar.get()!=NULL && mpHorizontalScrollBar->IsVisible()) { - int nLocalLeft = nLeft; - if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) - nLocalLeft += mpLayerTabBar->GetSizePixel().Width(); nBottom -= maScrBarWH.Height(); + if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) + nBottom -= mpLayerTabBar->GetSizePixel().Height(); mpHorizontalScrollBar->SetPosSizePixel ( - Point(nLocalLeft,nBottom), - Size(nRight-nLocalLeft-maScrBarWH.Width(),maScrBarWH.Height())); + Point(nLeft, nBottom), + Size(nRight - nLeft - maScrBarWH.Width(), maScrBarWH.Height())); } // Vertical scrollbar. @@ -889,7 +888,7 @@ void ViewShell::ArrangeGUIElements (void) nRight -= maScrBarWH.Width(); mpVerticalScrollBar->SetPosSizePixel ( Point(nRight,nTop), - Size (maScrBarWH.Width(),nBottom-nTop)); + Size (maScrBarWH.Width(), nBottom-nTop)); } // Filler in the lower right corner. |