From 4f14ed6d346a488976262e69fdbc2fd21881b659 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 23 May 2013 18:43:08 +0200 Subject: sidebar: Introduce PanelLayout class. This allows sidebars to be defined using Widget layout / .ui files. Change-Id: I7d5daf2579d6359ba48d4df4be344bb75ce16273 --- sfx2/source/sidebar/SidebarPanelBase.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sfx2/source/sidebar/SidebarPanelBase.cxx') diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx index 9aef9fa7f622..263e9706e924 100644 --- a/sfx2/source/sidebar/SidebarPanelBase.cxx +++ b/sfx2/source/sidebar/SidebarPanelBase.cxx @@ -21,6 +21,7 @@ #include "sfx2/sidebar/IContextChangeReceiver.hxx" #include "sfx2/imagemgr.hxx" #include +#include #include #include @@ -228,7 +229,14 @@ ui::LayoutSize SAL_CALL SidebarPanelBase::getHeightForWidth (const sal_Int32 nWi else { ILayoutableWindow* pLayoutableWindow = dynamic_cast(mpControl); - if (pLayoutableWindow != NULL) + + if (isLayoutEnabled(mpControl)) + { + // widget layout-based sidebar + Size aSize(mpControl->GetOptimalSize()); + return ui::LayoutSize(aSize.Height(), aSize.Height(), aSize.Height()); + } + else if (pLayoutableWindow != NULL) return pLayoutableWindow->GetHeightForWidth(nWidth); else if (mpControl != NULL) { -- cgit