summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-05-23 18:43:08 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-06-05 10:06:49 +0100
commite6354cc0752c5de0efefb9e3bdb9b196b205a73a (patch)
treec421429936f4162d69adf308a7ec1b93fee97f4c /sfx2
parentc44e55aac0dc0685c7bf3f313f4b3e6c65aaa6c6 (diff)
sidebar: Introduce PanelLayout class.
This allows sidebars to be defined using Widget layout / .ui files. Change-Id: I7d5daf2579d6359ba48d4df4be344bb75ce16273 (cherry picked from commit 4f14ed6d346a488976262e69fdbc2fd21881b659)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarPanelBase.cxx10
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)
{