vcl/source/control/wizardmachine.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
New commits: commit f822b613c19bbabcb485097232ddaadf501e6b43 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Nov 27 11:25:02 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Nov 27 14:56:38 2019 +0100 tdf#129042 factor the wizard buttons into the desired min width Change-Id: Ib89e8813c6f8e5203708952215156d3d5281ad17 Reviewed-on: https://gerrit.libreoffice.org/83893 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx index c61b46ec24e9..2fced940867e 100644 --- a/vcl/source/control/wizardmachine.cxx +++ b/vcl/source/control/wizardmachine.cxx @@ -104,19 +104,26 @@ namespace vcl void RoadmapWizard::ImplCalcSize( Size& rSize ) { - // calculate ButtonBar height + // calculate ButtonBar height and width long nMaxHeight = 0; + long nBarWidth = WIZARDDIALOG_BUTTON_DLGOFFSET_X * 2 + LogicalCoordinateToPixel(6); ImplWizButtonData* pBtnData = mpFirstBtn; - while ( pBtnData ) + while (pBtnData) { - long nBtnHeight = pBtnData->mpButton->GetSizePixel().Height(); + auto nBtnHeight = pBtnData->mpButton->GetSizePixel().Height(); + auto nBtnWidth = pBtnData->mpButton->GetSizePixel().Width(); + if (pBtnData->mpButton->IsVisible()) + { + nBarWidth += nBtnWidth; + nBarWidth += pBtnData->mnOffset; + } if ( nBtnHeight > nMaxHeight ) nMaxHeight = nBtnHeight; pBtnData = pBtnData->mpNext; } if ( nMaxHeight ) nMaxHeight += WIZARDDIALOG_BUTTON_OFFSET_Y*2; - rSize.AdjustHeight(nMaxHeight ); + rSize.AdjustHeight(nMaxHeight); // add in the view window size if ( mpViewWindow && mpViewWindow->IsVisible() ) @@ -131,6 +138,9 @@ namespace vcl else if ( meViewAlign == WindowAlign::Right ) rSize.AdjustWidth(aViewSize.Width() ); } + + if (nBarWidth > rSize.Width()) + rSize.setWidth(nBarWidth); } void RoadmapWizard::queue_resize(StateChangedType /*eReason*/) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits