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 /sd/source/ui/view/grviewsh.cxx | |
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>
Diffstat (limited to 'sd/source/ui/view/grviewsh.cxx')
-rw-r--r-- | sd/source/ui/view/grviewsh.cxx | 51 |
1 files changed, 6 insertions, 45 deletions
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: */ |