diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-08-05 08:41:08 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-09-30 21:51:06 +0200 |
commit | 93761933f912c692cd1397742deccc4f2f977021 (patch) | |
tree | 03d9ce40f2b4a8440ae667dbe8c9677a0b92b7e9 /sfx2 | |
parent | 5a76cbb3570437f2eea4549b97dc6e08068d7a59 (diff) |
Smaller-width animations pane on mobile
Change-Id: I2c3a2a703c7e9fa776e7a6c88cdca5414ce2c2c1
Reviewed-on: https://gerrit.libreoffice.org/79871
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 28 |
1 files changed, 24 insertions, 4 deletions
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()); } } |