diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-09-17 09:42:11 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-09-17 09:52:05 +0200 |
commit | df9145abe89ae698287facdeb41c0dd3b7758190 (patch) | |
tree | 844c28f6c7a4aa5a52e2b1caffd5ed589bdd2a70 | |
parent | e71bc82224418f6dbd266697cf255013a22adbb4 (diff) |
vcl menu: Add the height setting to the IMenuBarWindow interface.
Change-Id: I7b5f6e1b79f9972e2f23ed50c8da53874ad8b55e
-rw-r--r-- | vcl/source/window/menu.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/menuwindow.hxx | 1 |
4 files changed, 12 insertions, 4 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 28fb6fa687ff..043d2d308d56 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 4645df4fafb4..d5998d803798 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 52d082076993..ad3c336280fd 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 73c99df8828e..880b3f14f7d9 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. |