summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-03-22 16:17:11 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-03-25 16:19:13 +0100
commita58391b1f61db702a5246c5a33717cbba68c5252 (patch)
tree6f11643c3de1c2688829f125a9a063fce5930528 /sfx2/source/sidebar
parentcc83ef83b041cb9b69a97b871694dc5f7cfe2729 (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/source/sidebar')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx9
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()));
}
}