[Libreoffice-commits] core.git: sfx2/source

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 30 14:49:55 UTC 2019


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

New commits:
commit ff158502e14fab264b5cd544a7a8f550626c95db
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Aug 5 08:41:08 2019 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Aug 30 16:49:08 2019 +0200

    Smaller-width animations pane on mobile
    
    Change-Id: I2c3a2a703c7e9fa776e7a6c88cdca5414ce2c2c1
    Reviewed-on: https://gerrit.libreoffice.org/78300
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 8f57dba36b4a..d00a214e0fed 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -269,11 +269,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