X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2Fui%2F11_VBox.js;h=14febc5b92d83e764138cc3cff07d362fae5597c;hb=2621070c032954702155d4a315535b8b1aafd616;hp=35b574a6fe3accb25ced456c34c53df25d016198;hpb=4e5a06c9c610f8d3777f9d2eef71ec1365ffff1b;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/ui/11_VBox.js b/0.6.x/js/ui/11_VBox.js index 35b574a..14febc5 100644 --- a/0.6.x/js/ui/11_VBox.js +++ b/0.6.x/js/ui/11_VBox.js @@ -18,9 +18,11 @@ X.UI.Layout.Vertical = X.UI.Layout.create( { }, calculate : function( data, isNeedsDetection, x, y, w, h ){ - var attrs = data.attrObject || data.attrClass.prototype, + var ret = isNeedsDetection, + attrs = data.attrObject || data.attrClass.prototype, uinodes = data.uinodes, - l = uinodes && uinodes.length, + l = uinodes && uinodes.length, + minFlag = false, childW, childH, gapY, i, _x, _y, _w, node, contentW, contentH, autoW, autoH, detectionPhase; @@ -38,6 +40,8 @@ X.UI.Layout.Vertical = X.UI.Layout.create( { _x = data.contentL; _y = data.contentT; + if( !detectionPhase ) ret = false; + if( l ){ _w = 0; for( i = 0; i < l; ++i ){ @@ -46,10 +50,15 @@ X.UI.Layout.Vertical = X.UI.Layout.create( { _y += node.boxHeight + gapY; // 概算のみ if( autoW ){ - w = node.boxWidth !== X.UI.Attr.AUTO ? - node.boxWidth : - node.minBoxWidth !== X.UI.Attr.AUTO ? - node.minBoxWidth : 0; + if( node.boxWidth !== X.UI.Attr.AUTO ){ + w = node.boxWidth; + } else + if( node.minBoxWidth !== X.UI.Attr.AUTO ){ + w = node.minBoxWidth; + minFlag = true; + } else { + w = 0; + }; if( _w < w ) _w = w; }; }; @@ -61,12 +70,18 @@ X.UI.Layout.Vertical = X.UI.Layout.create( { if( detectionPhase ){ if( autoW ) data.contentWidth = _w; if( autoH ) data.contentHeight = _y; + _y = data.contentT; + for( i = 0; i < l; ++i ){ + node = uinodes[ i ]; + node.calculate( false, _x, _y, data.contentWidth, data.contentHeight ); + _y += node.boxHeight + gapY; + }; data.postMesure(); - } else { - //data.postMesure(); }; !isNeedsDetection && data.updateLayout( x + data.boxX, y + data.boxY ); + + return !ret; } });