@@ -349,12 +349,6 @@ void StdGridLayoutImpl::setHint(const std::string& name,
349349 << "WGridLayout: unrecognized hint '" << name << "'" ;
350350}
351351
352- int StdGridLayoutImpl ::additionalVerticalPadding (bool fitWidth , bool fitHeight )
353- const
354- {
355- return 0 ;
356- }
357-
358352DomElement * StdGridLayoutImpl ::createDomElement (bool fitWidth , bool fitHeight ,
359353 WApplication * app )
360354{
@@ -502,9 +496,19 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
502496 || (totalRowStretch == 0 );
503497
504498 for (int i = 0 ; i < item .rowSpan_ ; ++ i ) {
499+ // FIXME: if we span multiple rows, it is not clear what we should
500+ // do ?
501+ //
502+ // if stretch == -1 or >0, then we should fit height
503+ // if stretch == 0, then we should not fit height if no row
504+ // stretch is set (in which case JavaScript will actively take
505+ // over anyway)
505506 if (grid_ .rows_ [row + i ].stretch_ )
506507 itemFitHeight = true;
508+ else if (!stretch )
509+ itemFitHeight = false;
507510 for (int j = 0 ; j < item .colSpan_ ; ++ j ) {
511+ // there is no special meaning for column stretches
508512 if (grid_ .columns_ [col + j ].stretch_ )
509513 itemFitWidth = true;
510514 if (i + j > 0 )
@@ -518,9 +522,7 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
518522 // if we do, this makes the row no longer react to reductions
519523 // in height... Which is worse? I think the former?
520524 //
521- // Changed now: use stretch = -1 to force fitting height
522- //
523- // itemFitHeight = true;
525+ // Solved now: use stretch = -1 to force fitting height
524526
525527 AlignmentFlag hAlign = item .alignment_ & AlignHorizontalMask ;
526528 AlignmentFlag vAlign = item .alignment_ & AlignVerticalMask ;
@@ -563,13 +565,9 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
563565 if (!jsHeights )
564566 td -> setAttribute ("class" , "Wt-grtd" );
565567
566- int additionalVerticalPadding = 0 ;
567-
568568 if (item .item_ ) {
569569 DomElement * c = getImpl (item .item_ )
570570 -> createDomElement (itemFitWidth , itemFitHeight , app );
571- additionalVerticalPadding = getImpl (item .item_ )
572- -> additionalVerticalPadding (itemFitWidth , itemFitHeight );
573571
574572 if (hAlign == 0 )
575573 hAlign = AlignJustify ;
@@ -619,7 +617,7 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
619617
620618 //style2 += "overflow:auto;";
621619
622- int padding2 = padding [2 ] + additionalVerticalPadding ;
620+ int padding2 = padding [2 ];
623621
624622 if (padding [0 ] == padding [1 ] && padding [0 ] == padding2
625623 && padding [0 ] == padding [3 ]) {
0 commit comments