diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-27 11:25:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-27 14:56:38 +0100 |
commit | f822b613c19bbabcb485097232ddaadf501e6b43 (patch) | |
tree | 85ae022c798b5a0280ac68f21edbe0f2afe65e19 /vcl/source/control/wizardmachine.cxx | |
parent | 73d3bb1c581d8a2d95fef8e082350d62f6c3a448 (diff) |
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/control/wizardmachine.cxx')
-rw-r--r-- | vcl/source/control/wizardmachine.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
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*/) |