[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 27 13:58:16 UTC 2019


 vcl/source/control/wizardmachine.cxx |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit f822b613c19bbabcb485097232ddaadf501e6b43
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 27 11:25:02 2019 +0000
Commit:     Caolán McNamara <caolanm at 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 <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at 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*/)


More information about the Libreoffice-commits mailing list