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

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

View File

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