diff --git a/ChangeLog b/ChangeLog index d5190262e..bc0fc051c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-01-04 Tobias Doerffel + + * include/group_box.h: + * src/widgets/group_box.cpp: + removed animation-functionality as it's useless + + * src/core/arp_and_chords_tab_widget.cpp: + * src/core/envelope_tab_widget.cpp: + fixed boolModel-initializations - makes filter, arpeggio and chords + work again + 2008-01-03 Danny McRae * plugins/stk/mallets/mallets.h: diff --git a/include/group_box.h b/include/group_box.h index 54fed76bd..cc3534105 100644 --- a/include/group_box.h +++ b/include/group_box.h @@ -45,14 +45,9 @@ public: virtual void modelChanged( void ); -public slots: -// void setState( bool _on, bool _anim = FALSE ); - void animate( void ); - - protected: - virtual void resizeEvent( QResizeEvent * _re ); virtual void mousePressEvent( QMouseEvent * _me ); + virtual void resizeEvent( QResizeEvent * _re ); private: @@ -63,9 +58,6 @@ private: pixmapButton * m_led; QString m_caption; - int m_origHeight; - bool m_animating; - } ; diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index b4a3fca04..519993a1f 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -181,11 +181,11 @@ const int ARP_GROUPBOX_HEIGHT = 240 - ARP_GROUPBOX_Y; arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_track ) : QWidget( _instrument_track->tabWidgetParent() ), - m_chordsEnabledModel( new boolModel( /* this */ ) ), + m_chordsEnabledModel( new boolModel( FALSE, FALSE, TRUE, 1 /* this */ ) ), m_chordsModel( new comboBoxModel( /* this */ ) ), m_chordRangeModel( new floatModel( 1.0f, 1.0f, 9.0f, 1.0f /* this */ ) ), - m_arpEnabledModel( new boolModel( /* this */ ) ), + m_arpEnabledModel( new boolModel( FALSE, FALSE, TRUE, 1/* this */ ) ), m_arpModel( new comboBoxModel( /* this */ ) ), m_arpRangeModel( new floatModel( 1.0f, 1.0f, 9.0f, 1.0f /* this */ ) ), diff --git a/src/core/envelope_tab_widget.cpp b/src/core/envelope_tab_widget.cpp index 8444baa60..bf973a8cf 100644 --- a/src/core/envelope_tab_widget.cpp +++ b/src/core/envelope_tab_widget.cpp @@ -74,7 +74,7 @@ static const QString targetNames[envelopeTabWidget::TARGET_COUNT][2] = envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) : QWidget( _instrument_track->tabWidgetParent() ), m_instrumentTrack( _instrument_track ), - m_filterEnabledModel( new boolModel( /* this */ ) ), + m_filterEnabledModel( new boolModel( FALSE, FALSE, TRUE, 1 /* this */ ) ), m_filterModel( new comboBoxModel( /* this */ ) ), m_filterCutModel( new floatModel( /* this */ ) ), m_filterResModel( new floatModel( /* this */ ) ) diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index 472849d1b..55e44d0bd 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -50,9 +50,7 @@ QPixmap * groupBox::s_ledBg = NULL; groupBox::groupBox( const QString & _caption, QWidget * _parent ) : QWidget( _parent ), autoModelView(), - m_caption( _caption ), - m_origHeight( height() ), - m_animating( FALSE ) + m_caption( _caption ) { if( s_ledBg == NULL ) { @@ -68,9 +66,9 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent ) : m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) ); m_led->setInactiveGraphic( embed::getIconPixmap( "led_off" ) ); - setModel( new autoModel( FALSE, FALSE, TRUE, 1, NULL, FALSE ) ); + setModel( new autoModel( FALSE, FALSE, TRUE, + autoModel::defaultRelStep(), NULL, FALSE ) ); setAutoFillBackground( TRUE ); - } @@ -90,93 +88,23 @@ void groupBox::modelChanged( void ) -void groupBox::resizeEvent( QResizeEvent * ) -{ - updatePixmap(); - if( m_animating == FALSE ) - { - m_origHeight = height(); - } -} - - - void groupBox::mousePressEvent( QMouseEvent * _me ) { if( _me->y() > 1 && _me->y() < 13 ) { - //setState( !isActive(), TRUE ); - if( ( model()->value() == TRUE && height() < m_origHeight ) && - m_animating == FALSE ) - { - m_animating = TRUE; - animate(); - } + model()->setValue( !model()->value() ); } } -/* -void groupBox::setState( bool _on, bool _anim ) + +void groupBox::resizeEvent( QResizeEvent * _ev ) { - m_led->setChecked( _on ); - emit( toggled( _on ) ); + updatePixmap(); + QWidget::resizeEvent( _ev ); } -*/ - - - -void groupBox::animate( void ) -{ - float state = (float)( m_origHeight - height() ) / - (float)( m_origHeight - 19 ); - int dy = static_cast( 3 - 2 * cosf( state * 2 * M_PI ) ); - if( model()->value() && height() < m_origHeight ) - { - } - else if( !model()->value() && height() > 19 ) - { - dy = -dy; - } - else - { - m_animating = FALSE; - return; - } - resize( width(), height() + dy ); - QTimer::singleShot( 10, this, SLOT( animate() ) ); - QObjectList ch = parent()->children(); - for( int i = 0; i < ch.count(); ++i ) - { - QWidget * w = dynamic_cast( ch.at( i ) ); - if( w == NULL || w->y() < y() + height() ) - { - continue; - } - w->move( w->x(), w->y() + dy ); - } - ch = children(); - for( int i = 0; i < ch.count(); ++i ) - { - QWidget * w = dynamic_cast( ch.at( i ) ); - if( w == NULL || w == m_led ) - { - continue; - } - w->move( w->x(), w->y() + dy ); - if( w->y() < 14) - { - w->hide(); - } - else if( w->isHidden() == TRUE ) - { - w->show(); - } - } -} -