Kaydet (Commit) 20800ebc authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt Kaydeden (comit) Tomaž Vajngerl

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/11480Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
Tested-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst ffeac200
......@@ -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)
{
......
......@@ -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.
*/
......
......@@ -72,9 +72,6 @@ public:
protected:
void ConstructGraphicViewShell (void);
virtual void ArrangeGUIElements (void) SAL_OVERRIDE;
private:
DECL_LINK(TabBarSplitHandler, TabBar*);
};
} // end of namespace sd
......
......@@ -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;
......
......@@ -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);
......
......@@ -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: */
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment