From 6db8e2f3faaa67946aadfa8adeffef111d2482ca Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 26 Jan 2010 22:28:39 -0600 Subject: [PATCH] Mixer: Attempt to improve the behavior of single-row display mode. --- FL/Fl_Flowpack.H | 7 ++++++- Mixer/Mixer.C | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/FL/Fl_Flowpack.H b/FL/Fl_Flowpack.H index 1df200f..d283bf8 100644 --- a/FL/Fl_Flowpack.H +++ b/FL/Fl_Flowpack.H @@ -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; diff --git a/Mixer/Mixer.C b/Mixer/Mixer.C index 5e0aa33..75252c4 100644 --- a/Mixer/Mixer.C +++ b/Mixer/Mixer.C @@ -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() ) {