[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 30 19:51:50 UTC 2019


 sfx2/source/sidebar/Deck.cxx |   28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

New commits:
commit 93761933f912c692cd1397742deccc4f2f977021
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Aug 5 08:41:08 2019 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Sep 30 21:51:06 2019 +0200

    Smaller-width animations pane on mobile
    
    Change-Id: I2c3a2a703c7e9fa776e7a6c88cdca5414ce2c2c1
    Reviewed-on: https://gerrit.libreoffice.org/79871
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index bb24b719a5fd..62eaf1ecf026 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -258,11 +258,31 @@ void Deck::RequestLayoutInternal()
 void Deck::RequestLayout()
 {
     RequestLayoutInternal();
-    if (comphelper::LibreOfficeKit::isActive() && mnMinimalHeight > 0)
+
+    if (comphelper::LibreOfficeKit::isActive())
     {
-        const Size aParentSize(GetParent()->GetSizePixel().Width(), mnMinimalHeight);
-        GetParent()->SetSizePixel(aParentSize);
-        setPosSizePixel(0, 0, aParentSize.Width(), aParentSize.Height());
+        bool bChangeNeeded = false;
+        Size aParentSize = GetParent()->GetSizePixel();
+
+        if (mnMinimalHeight > 0 && (mnMinimalHeight != aParentSize.Height() || GetSizePixel().Height() != mnMinimalHeight))
+        {
+            aParentSize.setHeight(mnMinimalHeight);
+            bChangeNeeded = true;
+        }
+        if (mnMinimalWidth > 0 && (mnMinimalWidth != aParentSize.Width() || GetSizePixel().Width() != mnMinimalWidth)
+                && comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+        {
+            aParentSize.setWidth(mnMinimalWidth);
+            bChangeNeeded = true;
+        }
+
+        if (bChangeNeeded)
+        {
+            GetParent()->SetSizePixel(aParentSize);
+            setPosSizePixel(0, 0, aParentSize.Width(), aParentSize.Height());
+        }
+        else if (aParentSize != GetSizePixel()) //Sync parent & child sizes
+            setPosSizePixel(0, 0, aParentSize.Width(), aParentSize.Height());
     }
 }
 


More information about the Libreoffice-commits mailing list