diff --git a/ChangeLog b/ChangeLog index 5ffd4335d..b99dd762e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2008-05-18 Tobias Doerffel + * include/bb_track.h: + * src/gui/widgets/combobox.cpp: + * src/gui/widgets/name_label.cpp: + * src/tracks/bb_track.cpp: + * src/tracks/pattern.cpp: + * data/themes/default/track_op_grip.png: + improved overall appearence + + * src/core/track.cpp: + - disabled flipped painting of track-view-BG + - optimized changePosition()-method for much faster drawing + * src/gui/fx_mixer_view.cpp: do not destroy FX-mixer-view when closing diff --git a/data/themes/default/track_op_grip.png b/data/themes/default/track_op_grip.png index 83e29ef76..00d5a9f4f 100644 Binary files a/data/themes/default/track_op_grip.png and b/data/themes/default/track_op_grip.png differ diff --git a/include/bb_track.h b/include/bb_track.h index 109f10d5a..ab078e600 100644 --- a/include/bb_track.h +++ b/include/bb_track.h @@ -173,6 +173,11 @@ public: virtual bool close( void ); + const bbTrack * getBBTrack( void ) const + { + return( m_bbTrack ); + } + public slots: void clickedTrackLabel( void ); diff --git a/src/gui/widgets/combobox.cpp b/src/gui/widgets/combobox.cpp index bec206e7d..11891dfcd 100644 --- a/src/gui/widgets/combobox.cpp +++ b/src/gui/widgets/combobox.cpp @@ -172,8 +172,8 @@ void comboBox::paintEvent( QPaintEvent * _pe ) QColor shadow = palette().shadow().color(); QColor highlight = palette().highlight().color(); - shadow.setAlpha(124); - highlight.setAlpha(124); + shadow.setAlpha( 124 ); + highlight.setAlpha( 124 ); // button-separator p.setPen( shadow ); @@ -215,10 +215,10 @@ void comboBox::paintEvent( QPaintEvent * _pe ) tx += pm.width() + 2; } p.setPen( QColor( 64, 64, 64 ) ); - p.drawText( tx+1, p.fontMetrics().height()-1, + p.drawText( tx+1, p.fontMetrics().height()-2, model()->currentText() ); p.setPen( QColor( 224, 224, 224 ) ); - p.drawText( tx, p.fontMetrics().height()-2, + p.drawText( tx, p.fontMetrics().height()-3, model()->currentText() ); } } diff --git a/src/gui/widgets/name_label.cpp b/src/gui/widgets/name_label.cpp index c3f4a6296..218934f98 100644 --- a/src/gui/widgets/name_label.cpp +++ b/src/gui/widgets/name_label.cpp @@ -33,7 +33,7 @@ #include "name_label.h" #include "rename_dialog.h" -#include "bb_editor.h" +#include "bb_track_container.h" #include "bb_track.h" #include "gui_templates.h" #include "config_mgr.h" @@ -173,7 +173,6 @@ void nameLabel::mousePressEvent( QMouseEvent * _me ) else { emit clicked(); - QLabel::mousePressEvent( _me ); } } @@ -200,8 +199,9 @@ void nameLabel::mouseDoubleClickEvent( QMouseEvent * _me ) void nameLabel::paintEvent( QPaintEvent * ) { QPainter p( this ); - p.fillRect( rect(), palette().color( backgroundRole() ) ); - p.setFont( pointSize<8>( p.font() ) ); + p.fillRect( rect(), + parentWidget()->palette().color( backgroundRole() ) ); + p.setFont( pointSize<9>( p.font() ) ); int x = 4; if( m_pixmap.isNull() == FALSE ) @@ -216,19 +216,18 @@ void nameLabel::paintEvent( QPaintEvent * ) x += 4 + pm.width(); } - p.setPen( QColor( 16, 16, 16 ) ); - p.drawText( x+1, height() / 2 + p.fontMetrics().height() / 2 - 3, - text() ); - - p.setPen( QColor( 0, 224, 0 ) ); -#warning: TODO -/* bbTrack * bbt = bbTrack::findBBTrack( + p.setPen( QColor( 160, 160, 160 ) ); + bbTrack * bbt = bbTrack::findBBTrack( engine::getBBTrackContainer()->currentBB() ); - if( bbt != NULL && bbt->getTrackSettingsWidget() == - dynamic_cast( parentWidget() ) ) + trackSettingsWidget * w = dynamic_cast( parentWidget() ); + if( bbt != NULL && w != NULL ) { - p.setPen( QColor( 255, 255, 255 ) ); - }*/ + bbTrackView * bbtv = dynamic_cast( w->parentWidget() ); + if( bbtv != NULL && bbtv->getBBTrack() == bbt ) + { + p.setPen( QColor( 255, 255, 255 ) ); + } + } p.drawText( x, height() / 2 + p.fontMetrics().height() / 2 - 4, text() ); diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index 55c539c95..013310053 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -597,6 +597,12 @@ void bbTrackView::clickedTrackLabel( void ) engine::getBBTrackContainer()->setCurrentBB( bbTrack::numOfBBTrack( m_bbTrack ) ); engine::getBBEditor()->show(); + foreach( bbTrackView * tv, + getTrackContainerView()->findChildren() ) + { + tv->m_trackLabel->update(); + } + } diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 3c2cd7ee1..03a14ff1f 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -940,7 +940,7 @@ void patternView::mousePressEvent( QMouseEvent * _me ) { if( _me->button() == Qt::LeftButton && m_pat->m_patternType == pattern::BeatPattern && - ( fixedTCOs() || pixelsPerTact() >= 192 || + ( fixedTCOs() || pixelsPerTact() >= 96 || m_pat->m_steps != DEFAULT_STEPS_PER_TACT ) && _me->y() > height() - s_stepBtnOff->height() ) { @@ -1067,17 +1067,11 @@ void patternView::paintEvent( QPaintEvent * ) lingrad.setColorAt( 0, c ); lingrad.setColorAt( 0.5, Qt::black ); lingrad.setColorAt( 1, c ); - p.fillRect( QRect( 1, 1, width() - 2, height() - 2 ), lingrad ); - - p.setPen( QColor( 57, 69, 74 ) ); - p.drawLine( 0, 0, width(), 0 ); - p.drawLine( 0, 0, 0, height() ); - p.setPen( QColor( 120, 130, 140 ) ); - p.drawLine( 0, height() - 1, width() - 1, height() - 1 ); - p.drawLine( width() - 1, 0, width() - 1, height() - 1 ); - + p.setBrush( lingrad ); p.setPen( QColor( 0, 0, 0 ) ); - p.drawRect( 1, 1, width() - 2, height() - 2 ); + //p.drawRect( 0, 0, width() - 1, height() - 1 ); + p.drawRect( QRect( 0, 0, width() - 1, height() - 1 ) ); + const float ppt = fixedTCOs() ? ( parentWidget()->width() - 2 * TCO_BORDER_WIDTH ) @@ -1230,7 +1224,12 @@ void patternView::paintEvent( QPaintEvent * ) { p.setPen( QColor( 32, 240, 32 ) ); } - p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() ); + + if( m_pat->name() != m_pat->getInstrumentTrack()->name() ) + { + p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() ); + } + if( m_pat->muted() ) { p.drawPixmap( 3, p.fontMetrics().height() + 1,