diff options
Diffstat (limited to 'sfx2/source/sidebar/SidebarChildWindow.cxx')
-rw-r--r-- | sfx2/source/sidebar/SidebarChildWindow.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx index f02b37c54b40..cb001ceaf4c5 100644 --- a/sfx2/source/sidebar/SidebarChildWindow.cxx +++ b/sfx2/source/sidebar/SidebarChildWindow.cxx @@ -15,6 +15,8 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include "TabBar.hxx" #include "sfx2/sidebar/SidebarChildWindow.hxx" #include "SidebarDockingWindow.hxx" #include "sfx2/sfxsids.hrc" @@ -44,9 +46,9 @@ SidebarChildWindow::SidebarChildWindow ( eChildAlignment = SFX_ALIGN_RIGHT; this->pWindow->SetHelpId(HID_SIDEBAR_WINDOW); - this->pWindow->SetOutputSizePixel(Size(300, 450)); + this->pWindow->SetOutputSizePixel(Size(GetDefaultWidth(this->pWindow), 450)); - SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(pParentWindow); + SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(this->pWindow); if (pDockingParent != NULL) pDockingParent->Initialize(pInfo); SetHideNotDelete(sal_True); @@ -55,4 +57,21 @@ SidebarChildWindow::SidebarChildWindow ( } + + +sal_Int32 SidebarChildWindow::GetDefaultWidth (Window* pWindow) +{ + if (pWindow != NULL) + { + // Width of the paragraph panel. + const static sal_Int32 nMaxPropertyPageWidth (115); + + return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MAP_APPFONT).X() + + TabBar::GetDefaultWidth(); + } + else + return 0; +} + + } } // end of namespace sfx2::sidebar |