sfx2/source/sidebar/SidebarController.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 085579ecad6ca7892e9edd0b84e3c28f4a1b8330
Author:     Aron Budea <aron.bu...@collabora.com>
AuthorDate: Wed Jul 20 17:16:12 2022 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sat Jul 23 14:09:30 2022 +0200

    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.k...@collabora.com>
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>
    (cherry picked from commit d2584db4e0f9295aee5b9e5f8218af382f007637)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137188
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 088384641efd..0bd71db0240d 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -121,7 +121,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(); }),
@@ -133,6 +132,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>();
 }
@@ -1433,7 +1433,7 @@ void SidebarController::RestrictWidth (sal_Int32 nWidth)
 
         pSplitWindow->SetItemSizeRange(
             nSetId,
-            Range(nRequestedWidth, getMaximumWidth()));
+            Range(nRequestedWidth, std::max(nRequestedWidth, 
getMaximumWidth())));
     }
 }
 

Reply via email to