summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2022-07-20 17:16:12 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2022-07-24 21:33:17 +0200
commitcb2acc2ae1a45e45e5e3dd5907df63aecce0823e (patch)
treec5d20cd48e9152eb147ca10b02b85bd040c91d12 /sfx2
parent6344bb8b24d8250508f29457508f0daf479e5b4c (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) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137189 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sfx2')
-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 279b602cb2a6..12e1f1ae252e 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -123,7 +123,6 @@ SidebarController::SidebarController (
this)),
maCurrentContext(OUString(), OUString()),
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(); }),
@@ -135,6 +134,7 @@ SidebarController::SidebarController (
mpSplitWindow(nullptr),
mnWidthOnSplitterButtonDown(0)
{
+ mnMaximumSidebarWidth = officecfg::Office::UI::Sidebar::General::MaximumWidth::get() * mpTabBar->GetDPIScaleFactor();
// Decks and panel collections for this sidebar
mpResourceManager = std::make_unique<ResourceManager>();
}
@@ -1434,7 +1434,7 @@ void SidebarController::RestrictWidth (sal_Int32 nWidth)
pSplitWindow->SetItemSizeRange(
nSetId,
- Range(nRequestedWidth, getMaximumWidth()));
+ Range(nRequestedWidth, std::max(nRequestedWidth, getMaximumWidth())));
}
}