diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-05-23 18:43:08 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-06-02 04:54:53 +0200 |
commit | 4f14ed6d346a488976262e69fdbc2fd21881b659 (patch) | |
tree | b3e43401a9c11a63097d57281e51889875551126 /sfx2/source | |
parent | 916afbea4f20a72e7c3defee17676d8ec23841c1 (diff) |
sidebar: Introduce PanelLayout class.
This allows sidebars to be defined using Widget layout / .ui files.
Change-Id: I7d5daf2579d6359ba48d4df4be344bb75ce16273
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/sidebar/SidebarPanelBase.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
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 <vcl/ctrl.hxx> +#include <vcl/layout.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp> @@ -228,7 +229,14 @@ ui::LayoutSize SAL_CALL SidebarPanelBase::getHeightForWidth (const sal_Int32 nWi else { ILayoutableWindow* pLayoutableWindow = dynamic_cast<ILayoutableWindow*>(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) { |