[Libreoffice-commits] core.git: vcl/source
Jan Holesovsky
kendy at collabora.com
Wed Sep 17 00:53:52 PDT 2014
vcl/source/window/menu.cxx | 9 +++++----
vcl/source/window/menubarwindow.cxx | 5 +++++
vcl/source/window/menubarwindow.hxx | 1 +
vcl/source/window/menuwindow.hxx | 1 +
4 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit df9145abe89ae698287facdeb41c0dd3b7758190
Author: Jan Holesovsky <kendy at collabora.com>
Date: Wed Sep 17 09:42:11 2014 +0200
vcl menu: Add the height setting to the IMenuBarWindow interface.
Change-Id: I7b5f6e1b79f9972e2f23ed50c8da53874ad8b55e
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 28fb6fa..043d2d3 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2481,15 +2481,16 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
pMenu->pStartedFrom = 0;
pMenu->pWindow = pWindow;
pMenuBarWindow->SetMenu(pMenu);
- long nHeight = pMenu->ImplCalcSize( pWindow ).Height();
+ long nHeight = pMenu->ImplCalcSize(pWindow).Height();
// depending on the native implementation or the displayable flag
// the menubar windows is suppressed (ie, height=0)
- if( !((MenuBar*) pMenu)->IsDisplayable() ||
- ( pMenu->ImplGetSalMenu() && pMenu->ImplGetSalMenu()->VisibleMenuBar() ) )
+ if (!pMenu->IsDisplayable() || (pMenu->ImplGetSalMenu() && pMenu->ImplGetSalMenu()->VisibleMenuBar()))
+ {
nHeight = 0;
+ }
- pWindow->setPosSizePixel( 0, 0, 0, nHeight, WINDOW_POSSIZE_HEIGHT );
+ pMenuBarWindow->SetHeight(nHeight);
return pWindow;
}
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 4645df4..d5998d8 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -194,6 +194,11 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
}
}
+void MenuBarWindow::SetHeight(long nHeight)
+{
+ setPosSizePixel(0, 0, 0, nHeight, WINDOW_POSSIZE_HEIGHT);
+}
+
void MenuBarWindow::ShowButtons( bool bClose, bool bFloat, bool bHide )
{
aCloseBtn.ShowItem(IID_DOCUMENTCLOSE, bClose);
diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx
index 52d0820..ad3c336 100644
--- a/vcl/source/window/menubarwindow.hxx
+++ b/vcl/source/window/menubarwindow.hxx
@@ -123,6 +123,7 @@ public:
virtual sal_uLong GetFocusId() const SAL_OVERRIDE { return nSaveFocusId; }
virtual void SetMenu(MenuBar* pMenu) SAL_OVERRIDE;
+ virtual void SetHeight(long nHeight) SAL_OVERRIDE;
virtual void KillActivePopup() SAL_OVERRIDE;
virtual void PopupClosed(Menu* pMenu) SAL_OVERRIDE;
virtual sal_uInt16 GetHighlightedItem() const SAL_OVERRIDE { return nHighlightedItem; }
diff --git a/vcl/source/window/menuwindow.hxx b/vcl/source/window/menuwindow.hxx
index 73c99df..880b3f1 100644
--- a/vcl/source/window/menuwindow.hxx
+++ b/vcl/source/window/menuwindow.hxx
@@ -80,6 +80,7 @@ public:
virtual void SetAutoPopup(bool bAuto) = 0;
virtual void SetMenu(MenuBar* pMenu) = 0;
+ virtual void SetHeight(long nHeight) = 0;
virtual void KillActivePopup() = 0;
/// Add an arbitrary button to the menubar that will appear next to the close button.
More information about the Libreoffice-commits
mailing list