diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-22 16:17:11 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-25 16:19:13 +0100 |
commit | a58391b1f61db702a5246c5a33717cbba68c5252 (patch) | |
tree | 6f11643c3de1c2688829f125a9a063fce5930528 /sfx2 | |
parent | cc83ef83b041cb9b69a97b871694dc5f7cfe2729 (diff) |
Related tdf#124263 Make sure sidebar is wide enough for content
If panel's requested minimal size is smaller than current sidebar width,
enlarge the sidebar to fit the content.
Change-Id: I9baa4ef6c01d5563951d4df0d939883fce02e87b
Reviewed-on: https://gerrit.libreoffice.org/69561
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index e4bd01b03d1e..f2fa554fb52c 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -1216,9 +1216,16 @@ void SidebarController::RestrictWidth (sal_Int32 nWidth) { const sal_uInt16 nId (pSplitWindow->GetItemId(mpParentWindow.get())); const sal_uInt16 nSetId (pSplitWindow->GetSet(nId)); + const sal_Int32 nRequestedWidth + = (TabBar::GetDefaultWidth() + nWidth) * mpTabBar->GetDPIScaleFactor(); + + // Make sure the sidebar is wide enough to fit the requested content + if (pSplitWindow->GetSizePixel().Width() < nRequestedWidth) + SetChildWindowWidth(nRequestedWidth); + pSplitWindow->SetItemSizeRange( nSetId, - Range(TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor() + nWidth, + Range(nRequestedWidth, getMaximumWidth() * mpTabBar->GetDPIScaleFactor())); } } |