improved visual appearence of timeline

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1634 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-09-19 15:22:17 +00:00
parent 7b42e2df54
commit c128bd727e
10 changed files with 38 additions and 33 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

After

Width:  |  Height:  |  Size: 208 B

View File

@@ -132,6 +132,10 @@ fxMixerView QPushButton, effectRackView QPushButton, controllerRackView QPushBut
font-size: 10px;
}
timeLine {
font-size: 8px;
}
/* Plugins */
tripleOscillatorView knob {

View File

@@ -46,7 +46,6 @@
QPixmap * timeLine::s_timeLinePixmap = NULL;
QPixmap * timeLine::s_posMarkerPixmap = NULL;
QPixmap * timeLine::s_loopPointPixmap = NULL;
QPixmap * timeLine::s_loopPointDisabledPixmap = NULL;
timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt,
@@ -86,12 +85,6 @@ timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt,
"loop_point" ) );
}
if( s_loopPointDisabledPixmap == NULL )
{
s_loopPointDisabledPixmap = new QPixmap( embed::getIconPixmap(
"loop_point_disabled" ) );
}
move( 0, _yoff );
setFixedHeight( s_timeLinePixmap->height() );
@@ -231,18 +224,23 @@ void timeLine::paintEvent( QPaintEvent * )
{
QPainter p( this );
for( int x = 0; x < width(); x += s_timeLinePixmap->width() )
{
p.drawPixmap( x, 0, *s_timeLinePixmap );
}
QColor bg_color = QApplication::palette().color( QPalette::Active,
QPalette::Background );
QLinearGradient g( 0, 0, 0, height() );
// g.setColorAt( 0, bg_color.darker( 250 ) );
g.setColorAt( 0, bg_color.lighter( 150 ) );
g.setColorAt( 1, bg_color.darker( 150 ) );
p.fillRect( 0, 0, width(), height(), g );
p.setClipRect( m_xOffset, 0, width() - m_xOffset, height() );
p.setPen( QColor( 0, 0, 0 ) );
const QPixmap & lpoint = loopPointsEnabled() ?
*s_loopPointPixmap :
*s_loopPointDisabledPixmap;
p.drawPixmap( markerX( loopBegin() ), 4, lpoint );
p.drawPixmap( markerX( loopEnd() ), 4, lpoint );
const QPixmap & lpoint = *s_loopPointPixmap;
p.setOpacity( loopPointsEnabled() ? 0.9 : 0.2 );
p.drawPixmap( markerX( loopBegin() )+2, 2, lpoint );
p.drawPixmap( markerX( loopEnd() )+2, 2, lpoint );
p.setOpacity( 1.0 );
tact tact_num = m_begin.getTact();
@@ -251,24 +249,26 @@ void timeLine::paintEvent( QPaintEvent * )
midiTime::ticksPerTact() ) %
static_cast<int>( m_ppt ) );
p.setPen( QColor( 192, 192, 192 ) );
for( int i = 0; x + i * m_ppt < width(); ++i )
{
const int cx = x + qRound( i * m_ppt );
p.drawLine( cx, 5, cx, height() - 6 );
++tact_num;
if( ( tact_num - 1 ) %
tMax( 1, static_cast<int>(
(float) midiTime::ticksPerTact() /
tMax( 1, qRound( 1.0f / 3.0f * midiTime::ticksPerTact() /
m_ppt ) ) == 0 )
{
p.setPen( QColor( 224, 224, 224 ) );
p.drawText( x + static_cast<int>( i * m_ppt ) + 1, 15,
QString::number( tact_num ) );
p.setPen( QColor( 0, 0, 0 ) );
p.drawText( x + static_cast<int>( i * m_ppt ), 14,
QString::number( tact_num ) );
const QString s = QString::number( tact_num );
p.drawText( cx + qRound( ( m_ppt - p.fontMetrics().
width( s ) ) / 2 ),
height() - p.fontMetrics().height() / 2, s );
}
}
p.drawPixmap( m_posMarkerX, 4, *s_posMarkerPixmap );
p.setOpacity( 0.75 );
p.drawImage( m_posMarkerX, height() - s_posMarkerPixmap->height(),
s_posMarkerPixmap->toImage() );
}

View File

@@ -1150,9 +1150,10 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
backgrnd = QPixmap( w * 2, height() );
QPainter pmp( &backgrnd );
//pmp.setRenderHint( QPainter::Antialiasing );
QLinearGradient grad( 0,1, 0,h-2 );
pmp.fillRect( 0, 0, w, h, QColor(128, 128, 128) );
QLinearGradient grad( 0, 1, 0, h-2 );
pmp.fillRect( 0, 0, 1, h, QColor( 96, 96, 96 ) );
pmp.fillRect( 1, 0, w+1, h, QColor( 128, 128, 128 ) );
grad.setColorAt( 0.0, QColor( 64, 64, 64 ) );
grad.setColorAt( 0.3, QColor( 128, 128, 128 ) );
grad.setColorAt( 0.5, QColor( 128, 128, 128 ) );
@@ -1162,7 +1163,7 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
pmp.fillRect( 0, 1, w, h-2, grad );
QLinearGradient grad2( 0,1, 0, h-2 );
pmp.fillRect( w, 0, w , h, QColor(96, 96, 96) );
pmp.fillRect( w+1, 0, w , h, QColor( 96, 96, 96 ) );
grad2.setColorAt( 0.0, QColor( 48, 48, 48 ) );
grad2.setColorAt( 0.3, QColor( 96, 96, 96 ) );
grad2.setColorAt( 0.5, QColor( 96, 96, 96 ) );
@@ -1170,10 +1171,10 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
//grad2.setColorAt( 1.0, QColor( 96, 96, 96 ) );
//grad2.setColorAt( 1.0, QColor( 48, 48, 48 ) );
pmp.fillRect( w, 1, w , h-2, grad2 );
// draw vertical lines
//pmp.setPen( QPen( QBrush( QColor( 80, 84, 96, 192 ) ), 1 ) );
pmp.setPen( QPen( QColor( 0,0,0, 112 ), 1 ) );
pmp.setPen( QPen( QColor( 0, 0, 0, 112 ), 1 ) );
for( float x = 0.5; x < w * 2; x += ppt )
{
pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) );
@@ -1181,7 +1182,7 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
//pmp.setPen( QPen( QColor( 255,0,0, 128 ), 1 ) );
pmp.drawLine( 0, 1, w*2, 1 );
pmp.setPen( QPen( QColor( 255,255,255, 32 ), 1 ) );
pmp.setPen( QPen( QColor( 255, 255, 255, 32 ), 1 ) );
for( float x = 1.5; x < w * 2; x += ppt )
{
pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) );
@@ -1193,7 +1194,7 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
last_geometry = ppt*h;
}
// Don't draw background on BB-Editor
if( m_trackView->getTrackContainerView() != engine::getBBEditor() )
{