summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2022-07-20 17:16:12 +0200
committerAron Budea <aron.budea@collabora.com>2022-07-21 11:48:08 +0200
commit895411f598f3361b3d3badc521c9b6a57b9dc121 (patch)
tree8148b25f0e2d914ca57d9350d08f1a053d2c1f59
parentbbc4139793af90ff37b117874863c2d47793df4c (diff)
tdf#141294 Use DPI scale factor for sidebar width limit in config
And don't lock up if the calculated minimum exceeds the maximum (sidebar remains unresizable in that case, however). Change-Id: Ibe96a43ad5d6a3fe4132a9fb64fe244ab022668d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137267 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Aron Budea <aron.budea@collabora.com> (cherry picked from commit f319363b0e07010eea806c723254f17dacdf1b06)
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 3ca7ca9655f1..67fe91bd6c36 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -124,7 +124,6 @@ SidebarController::SidebarController (
maCurrentContext(OUString(), OUString()),
maRequestedContext(),
mnRequestedForceFlags(SwitchFlag_NoForce),
- mnMaximumSidebarWidth(officecfg::Office::UI::Sidebar::General::MaximumWidth::get()),
mbMinimumSidebarWidth(officecfg::Office::UI::Sidebar::General::MinimumWidth::get()),
msCurrentDeckId(gsDefaultDeckId),
maPropertyChangeForwarder([this](){ return this->BroadcastPropertyChange(); }),
@@ -140,6 +139,7 @@ SidebarController::SidebarController (
mnWidthOnSplitterButtonDown(0),
mpResourceManager()
{
+ mnMaximumSidebarWidth = officecfg::Office::UI::Sidebar::General::MaximumWidth::get() * mpTabBar->GetDPIScaleFactor();
// Decks and panel collections for this sidebar
mpResourceManager = std::make_unique<ResourceManager>();
}
@@ -1433,7 +1433,7 @@ void SidebarController::RestrictWidth (sal_Int32 nWidth)
pSplitWindow->SetItemSizeRange(
nSetId,
- Range(nRequestedWidth, getMaximumWidth()));
+ Range(nRequestedWidth, std::max(nRequestedWidth, getMaximumWidth())));
}
}