1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "GraphicViewShell.hxx"
21 #include "LayerTabBar.hxx"
22 #include "FrameView.hxx"
23 #include <sfx2/objsh.hxx>
24 #include <sfx2/viewfrm.hxx>
25 #include <vcl/scrbar.hxx>
26 #include <vcl/settings.hxx>
28 #include <tools/helpers.hxx>
32 GraphicViewShell::GraphicViewShell (
34 ViewShellBase
& rViewShellBase
,
35 vcl::Window
* pParentWindow
,
36 FrameView
* pFrameView
)
44 ConstructGraphicViewShell();
47 GraphicViewShell::~GraphicViewShell()
51 void GraphicViewShell::ConstructGraphicViewShell()
53 meShellType
= ST_DRAW
;
55 mpLayerTabBar
.reset (VclPtr
<LayerTabBar
>::Create(this, GetParentWindow()));
57 // #i67363# no layer tabbar in preview mode
58 if ( !GetObjectShell()->IsPreview() )
59 mpLayerTabBar
->Show();
62 void GraphicViewShell::ChangeEditMode (
66 // There is no page tab that could be shown instead of the layer tab.
67 // Therefore we have it always visible regardless of what the caller
68 // said. (We have to change the callers behaviour, of course.)
69 DrawViewShell::ChangeEditMode (eMode
, true);
72 void GraphicViewShell::ArrangeGUIElements()
74 if (mpLayerTabBar
.get()!=NULL
&& mpLayerTabBar
->IsVisible())
76 Size aSize
= mpLayerTabBar
->GetSizePixel();
77 const Size
aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel());
79 aSize
.Height() = GetParentWindow()->GetFont().GetHeight() + 4;
80 aSize
.Width() = aFrameSize
.Width();
82 Point
aPos (0, maViewSize
.Height() - aSize
.Height());
84 mpLayerTabBar
->SetPosSizePixel (aPos
, aSize
);
87 DrawViewShell::ArrangeGUIElements();
90 } // end of namespace sd
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */