summaryrefslogtreecommitdiff
path: root/vcl/source/window/brdwin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/brdwin.cxx')
-rw-r--r--vcl/source/window/brdwin.cxx53
1 files changed, 39 insertions, 14 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 773aaa7bf827..c5fd0be3132c 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -36,6 +36,8 @@
#include <vcl/metric.hxx>
#include <vcl/settings.hxx>
+#include "notebookbarwindow.hxx"
+
using namespace ::com::sun::star::uno;
// useful caption height for title bar buttons
@@ -1832,6 +1834,7 @@ void ImplBorderWindow::dispose()
delete mpBorderView;
mpBorderView = NULL;
mpMenuBarWindow.clear();
+ mpNotebookBarWindow.disposeAndClear();
vcl::Window::dispose();
}
@@ -1912,12 +1915,14 @@ void ImplBorderWindow::Resize()
{
vcl::Window* pClientWindow = ImplGetClientWindow();
- if ( mpMenuBarWindow )
+ sal_Int32 nLeftBorder;
+ sal_Int32 nTopBorder;
+ sal_Int32 nRightBorder;
+ sal_Int32 nBottomBorder;
+ mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
+
+ if (mpMenuBarWindow)
{
- sal_Int32 nLeftBorder;
- sal_Int32 nTopBorder;
- sal_Int32 nRightBorder;
- sal_Int32 nBottomBorder;
long nMenuHeight = mpMenuBarWindow->GetSizePixel().Height();
if ( mbMenuHide )
{
@@ -1930,13 +1935,22 @@ void ImplBorderWindow::Resize()
if ( !nMenuHeight )
nMenuHeight = mnOrgMenuHeight;
}
- mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
- mpMenuBarWindow->setPosSizePixel( nLeftBorder,
- nTopBorder,
- aSize.Width()-nLeftBorder-nRightBorder,
- nMenuHeight,
- PosSizeFlags::Pos |
- PosSizeFlags::Width | PosSizeFlags::Height );
+ mpMenuBarWindow->setPosSizePixel(
+ nLeftBorder, nTopBorder,
+ aSize.Width()-nLeftBorder-nRightBorder, nMenuHeight,
+ PosSizeFlags::Pos | PosSizeFlags::Width | PosSizeFlags::Height);
+
+ // shift the notebookbar down accordingly
+ nTopBorder += nMenuHeight;
+ }
+
+ if (mpNotebookBarWindow)
+ {
+ long nNotebookBarHeight = mpNotebookBarWindow->GetSizePixel().Height();
+ mpNotebookBarWindow->setPosSizePixel(
+ nLeftBorder, nTopBorder,
+ aSize.Width() - nLeftBorder - nRightBorder, nNotebookBarHeight,
+ PosSizeFlags::Pos | PosSizeFlags::Width | PosSizeFlags::Height);
}
GetBorder( pClientWindow->mpWindowImpl->mnLeftBorder, pClientWindow->mpWindowImpl->mnTopBorder,
@@ -2163,12 +2177,23 @@ void ImplBorderWindow::SetMenuBarMode( bool bHide )
UpdateMenuHeight();
}
+void ImplBorderWindow::SetNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
+{
+ mpNotebookBarWindow.reset(new NotebookBarWindow(this, "NotebookBar", rUIXMLDescription, rFrame));
+ Resize();
+ mpNotebookBarWindow->Show();
+}
+
void ImplBorderWindow::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
{
- mpBorderView->GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder );
- if ( mpMenuBarWindow && !mbMenuHide )
+ mpBorderView->GetBorder(rLeftBorder, rTopBorder, rRightBorder, rBottomBorder);
+
+ if (mpMenuBarWindow && !mbMenuHide)
rTopBorder += mpMenuBarWindow->GetSizePixel().Height();
+
+ if (mpNotebookBarWindow)
+ rTopBorder += mpNotebookBarWindow->GetSizePixel().Height();
}
long ImplBorderWindow::CalcTitleWidth() const