diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-01-13 13:55:01 +0100 |
---|---|---|
committer | Heiko Tietze <tietze.heiko@googlemail.com> | 2017-01-13 21:11:54 +0000 |
commit | 9157ae95d4861c545b01e1d9df67932c86a3c640 (patch) | |
tree | b0f22afd72bbcbcf87bf25f7a0f41dc9235112bb /cui | |
parent | 252f2d4978e5861cb62cca7c1553be63a7bae119 (diff) |
tdf#105259 calculate sizes of all area tab pages on construction
When we open dialog that contains the area tab, we need to
calculate the size of area tab pages (that are triggered by
clicking on a button) and set the page area to the appropriate
combined size. Otherwise we don't account for the needed space
correctly and some page will be squished or have overlapping
controls.
This change creates all pages at dialog construction, gets
all the optimal sizes and sets the size of the page container box
to the combined (minimal) size.
Change-Id: Ie04a121810b96973f6e4502a52af675b2baacf25
Reviewed-on: https://gerrit.libreoffice.org/33040
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit e6d7d737522124350a17a3cfdee055f03200a274)
Reviewed-on: https://gerrit.libreoffice.org/33048
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Heiko Tietze <tietze.heiko@googlemail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 9972ca5133c3..f2a054df2e55 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -66,6 +66,19 @@ const sal_uInt16 SvxAreaTabPage::pAreaRanges[] = 0 }; +namespace +{ + +void lclExtendSize(Size& rSize, const Size& rInputSize) +{ + if (rSize.Width() < rInputSize.Width()) + rSize.Width() = rInputSize.Width(); + if (rSize.Height() < rInputSize.Height()) + rSize.Height() = rInputSize.Height(); +} + +} // end anonymous namespace + /************************************************************************* |* |* Dialog to modify fill-attributes @@ -125,6 +138,22 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs m_pBtnPattern->SetClickHdl(aLink); SetExchangeSupport(); + + // Calculate optimal size of all pages.. + m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(m_pFillTab, &m_rXFSet)); + Size aSize = m_pFillTabPage->GetOptimalSize(); + m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(m_pFillTab, &m_rXFSet)); + lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(m_pFillTab, &m_rXFSet)); + lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(m_pFillTab, &m_rXFSet)); + lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(m_pFillTab, &m_rXFSet)); + lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + m_pFillTabPage.disposeAndClear(); + + m_pFillTab->set_width_request(aSize.Width()); + m_pFillTab->set_height_request(aSize.Height()); } SvxAreaTabPage::~SvxAreaTabPage() |