summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-08-05 08:41:08 +0300
committerMiklos Vajna <vmiklos@collabora.com>2019-08-30 16:49:08 +0200
commitff158502e14fab264b5cd544a7a8f550626c95db (patch)
tree98f8008308c6d34408cd3c648419749d707ef298 /sfx2
parent5b97e75589523b3769ec87e27854e2c841d0d79f (diff)
Smaller-width animations pane on mobile
Change-Id: I2c3a2a703c7e9fa776e7a6c88cdca5414ce2c2c1 Reviewed-on: https://gerrit.libreoffice.org/78300 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/Deck.cxx28
1 files changed, 24 insertions, 4 deletions
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());
}
}