Fl_Flowpack: Set width appropriately in non-flow mode. Fixes #17.

This commit is contained in:
Jonathan Moore Liles 2013-03-18 22:28:01 -07:00
parent 7d5a0e13f6
commit b1586811f9
1 changed files with 19 additions and 9 deletions

View File

@ -73,9 +73,14 @@ public:
} }
void void
resize ( int X, int Y, int W, int ) resize ( int X, int Y, int W, int H )
{ {
Fl_Group::resize( X, Y, W, layout( W ) ); int NW = W;
int NH = H;
layout( NW, NH );
Fl_Group::resize( X, Y, NW, NH );
} }
void void
@ -87,20 +92,24 @@ public:
void dolayout ( void ) void dolayout ( void )
{ {
int new_h = layout( w() ); int H = h();
int W = w();
if ( new_h != h() ) layout( W, H );
size( w(), new_h );
if ( H != h() || W != w() )
size( W, H );
} }
int void
layout ( int W ) layout ( int &W, int &H )
{ {
resizable( 0 ); resizable( 0 );
int X = 0; int X = 0;
int Y = 0; int Y = 0;
int H = 0; H = 0;
/* int H = 0; */
_max_width = 0; _max_width = 0;
@ -173,6 +182,7 @@ public:
_max_width = X; _max_width = X;
} }
return Y + H; if ( ! _flow )
W = X;
} }
}; };