diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-22 08:06:25 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-22 11:41:23 +0100 |
commit | 2a41c31a0627bf752a625f23a64eaf4d3fe82fb9 (patch) | |
tree | 717d81dc537c784025b6c31f37ff94f1ea0f7aa4 /svx | |
parent | ad7e2af4ed0c11f8571374fbb40d38b38c27959c (diff) |
tdf#124255 Make maximum sidebar width configurable
Also change the default max width to 500px (instead of 400px).
Change-Id: Idece5aadaf4c4165cc873b4605d2c0f026c89c6e
Reviewed-on: https://gerrit.libreoffice.org/69545
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/PanelLayout.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx index e68ef416724b..a0b1362a341e 100644 --- a/svx/source/sidebar/PanelLayout.cxx +++ b/svx/source/sidebar/PanelLayout.cxx @@ -20,6 +20,7 @@ using namespace sfx2::sidebar; PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) : Control(pParent) , m_bInClose(false) + , mxFrame(rFrame) { SetStyle(GetStyle() | WB_DIALOGCONTROL); m_aPanelLayoutIdle.SetPriority(TaskPriority::RESIZE); @@ -50,8 +51,16 @@ Size PanelLayout::GetOptimalSize() const if (isLayoutEnabled(this)) { Size aSize = VclContainer::getLayoutRequisition(*GetWindow(GetWindowType::FirstChild)); - aSize.setWidth( std::min<long>(aSize.Width(), - (SidebarController::gnMaximumSidebarWidth - TabBar::GetDefaultWidth()) * GetDPIScaleFactor()) ); + if (mxFrame) + { + SidebarController* pController + = SidebarController::GetSidebarControllerForFrame(mxFrame); + if (pController) + aSize.setWidth(std::min<long>( + aSize.Width(), (pController->getMaximumWidth() - TabBar::GetDefaultWidth()) + * GetDPIScaleFactor())); + } + return aSize; } |