diff options
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/brdwin.cxx | 51 | ||||
-rw-r--r-- | vcl/source/window/notebookbarwindow.cxx | 69 | ||||
-rw-r--r-- | vcl/source/window/notebookbarwindow.hxx | 32 | ||||
-rw-r--r-- | vcl/source/window/syswin.cxx | 7 |
4 files changed, 14 insertions, 145 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index eb839d2298c8..52b0b139dc12 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -36,8 +36,6 @@ #include <vcl/metric.hxx> #include <vcl/settings.hxx> -#include "notebookbarwindow.hxx" - using namespace ::com::sun::star::uno; // useful caption height for title bar buttons @@ -1834,7 +1832,6 @@ void ImplBorderWindow::dispose() delete mpBorderView; mpBorderView = nullptr; mpMenuBarWindow.clear(); - mpNotebookBarWindow.disposeAndClear(); vcl::Window::dispose(); } @@ -1915,14 +1912,12 @@ void ImplBorderWindow::Resize() { vcl::Window* pClientWindow = ImplGetClientWindow(); - sal_Int32 nLeftBorder; - sal_Int32 nTopBorder; - sal_Int32 nRightBorder; - sal_Int32 nBottomBorder; - mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder ); - - if (mpMenuBarWindow) + if ( mpMenuBarWindow ) { + sal_Int32 nLeftBorder; + sal_Int32 nTopBorder; + sal_Int32 nRightBorder; + sal_Int32 nBottomBorder; long nMenuHeight = mpMenuBarWindow->GetSizePixel().Height(); if ( mbMenuHide ) { @@ -1935,20 +1930,13 @@ void ImplBorderWindow::Resize() if ( !nMenuHeight ) nMenuHeight = mnOrgMenuHeight; } - mpMenuBarWindow->setPosSizePixel( - nLeftBorder, nTopBorder, - aSize.Width()-nLeftBorder-nRightBorder, nMenuHeight); - - // shift the notebookbar down accordingly - nTopBorder += nMenuHeight; - } - - if (mpNotebookBarWindow) - { - long nNotebookBarHeight = mpNotebookBarWindow->GetSizePixel().Height(); - mpNotebookBarWindow->setPosSizePixel( - nLeftBorder, nTopBorder, - aSize.Width() - nLeftBorder - nRightBorder, nNotebookBarHeight); + mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder ); + mpMenuBarWindow->setPosSizePixel( nLeftBorder, + nTopBorder, + aSize.Width()-nLeftBorder-nRightBorder, + nMenuHeight, + PosSizeFlags::Pos | + PosSizeFlags::Width | PosSizeFlags::Height ); } GetBorder( pClientWindow->mpWindowImpl->mnLeftBorder, pClientWindow->mpWindowImpl->mnTopBorder, @@ -2175,23 +2163,12 @@ void ImplBorderWindow::SetMenuBarMode( bool bHide ) UpdateMenuHeight(); } -void ImplBorderWindow::SetNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame) -{ - mpNotebookBarWindow = VclPtr<NotebookBarWindow>::Create(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 diff --git a/vcl/source/window/notebookbarwindow.cxx b/vcl/source/window/notebookbarwindow.cxx deleted file mode 100644 index 09fc0677ce38..000000000000 --- a/vcl/source/window/notebookbarwindow.cxx +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "notebookbarwindow.hxx" - -#include <vcl/layout.hxx> - -NotebookBarWindow::NotebookBarWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) - : Control(pParent) -{ - SetStyle(GetStyle() | WB_DIALOGCONTROL); - m_pUIBuilder = new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID, rFrame); -} - -NotebookBarWindow::~NotebookBarWindow() -{ - disposeOnce(); -} - -void NotebookBarWindow::dispose() -{ - disposeBuilder(); - Control::dispose(); -} - -Size NotebookBarWindow::GetOptimalSize() const -{ - if (isLayoutEnabled(this)) - return VclContainer::getLayoutRequisition(*GetWindow(GetWindowType::FirstChild)); - - return Control::GetOptimalSize(); -} - -void NotebookBarWindow::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags) -{ - bool bCanHandleSmallerWidth = false; - bool bCanHandleSmallerHeight = false; - - bool bIsLayoutEnabled = isLayoutEnabled(this); - Window *pChild = GetWindow(GetWindowType::FirstChild); - - if (bIsLayoutEnabled && pChild->GetType() == WINDOW_SCROLLWINDOW) - { - WinBits nStyle = pChild->GetStyle(); - if (nStyle & (WB_AUTOHSCROLL | WB_HSCROLL)) - bCanHandleSmallerWidth = true; - if (nStyle & (WB_AUTOVSCROLL | WB_VSCROLL)) - bCanHandleSmallerHeight = true; - } - - Size aSize(GetOptimalSize()); - if (!bCanHandleSmallerWidth) - nWidth = std::max(nWidth, aSize.Width()); - if (!bCanHandleSmallerHeight) - nHeight = std::max(nHeight, aSize.Height()); - - Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags); - - if (bIsLayoutEnabled && (nFlags & PosSizeFlags::Size)) - VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight)); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/notebookbarwindow.hxx b/vcl/source/window/notebookbarwindow.hxx deleted file mode 100644 index 0fc64a6399ce..000000000000 --- a/vcl/source/window/notebookbarwindow.hxx +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX -#define VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX - -#include "menuwindow.hxx" - -#include <vcl/builder.hxx> -#include <vcl/ctrl.hxx> - -/// This implements Widget Layout-based notebook-like menu bar. -class NotebookBarWindow : public Control, public VclBuilderContainer -{ -public: - NotebookBarWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame); - virtual ~NotebookBarWindow(); - virtual void dispose() SAL_OVERRIDE; - - virtual Size GetOptimalSize() const SAL_OVERRIDE; - virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) SAL_OVERRIDE; -}; - -#endif // VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 218bcf6fcd60..e007a3182b01 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -39,8 +39,6 @@ #include <brdwin.hxx> #include <window.h> -#include "notebookbarwindow.hxx" - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -969,11 +967,6 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) } } -void SystemWindow::CreateNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame) -{ - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetNotebookBarWindow(rUIXMLDescription, rFrame); -} - void SystemWindow::SetMenuBarMode( MenuBarMode nMode ) { if ( mnMenuBarMode != nMode ) |