Mixer: Attempt to improve the behavior of single-row display mode.

This commit is contained in:
Jonathan Moore Liles 2010-01-26 22:28:39 -06:00
parent 26afb520f2
commit 6db8e2f3fa
2 changed files with 12 additions and 1 deletions

View File

@ -26,6 +26,7 @@ class Fl_Flowpack : public Fl_Group
int _hspacing; int _hspacing;
int _vspacing; int _vspacing;
int _max_width; int _max_width;
bool _flow;
public: public:
@ -34,6 +35,7 @@ public:
{ {
resizable( 0 ); resizable( 0 );
_max_width = _hspacing = _vspacing = 0; _max_width = _hspacing = _vspacing = 0;
_flow = 0;
} }
virtual ~Fl_Flowpack ( ) virtual ~Fl_Flowpack ( )
@ -48,6 +50,9 @@ public:
void hspacing ( int h ) { _hspacing = h; } void hspacing ( int h ) { _hspacing = h; }
int hspacing ( void ) const { return _hspacing; }; int hspacing ( void ) const { return _hspacing; };
bool flow ( void ) const { return _flow; }
void flow ( bool v ) { _flow = v; }
void void
add ( Fl_Widget *w ) add ( Fl_Widget *w )
{ {
@ -100,7 +105,7 @@ public:
H = o->h() > H ? o->h() : H; H = o->h() > H ? o->h() : H;
if ( X + o->w() >= W ) if ( _flow && X + o->w() >= W )
{ {
Y += H + _vspacing; Y += H + _vspacing;

View File

@ -367,9 +367,15 @@ Mixer::rows ( int n )
int sh; int sh;
if ( n > 1 ) if ( n > 1 )
{
sh = (scroll->h() / n) - (mixer_strips->vspacing() * (n - 1)); sh = (scroll->h() / n) - (mixer_strips->vspacing() * (n - 1));
mixer_strips->flow( true );
}
else else
{
sh = (scroll->h() - 18) / n; sh = (scroll->h() - 18) / n;
mixer_strips->flow( false );
}
if ( sh < Mixer_Strip::min_h() ) if ( sh < Mixer_Strip::min_h() )
{ {