[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/multimedia/amarok/src/analyzers
From: Mark Kretschmann <markey () web ! de>
Date: 2007-05-05 8:12:14
Message-ID: 1178352734.249709.19471.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 661332 by markey:
Actually initialize the gradient bars.
M +14 -1 baranalyzer.cpp
--- trunk/extragear/multimedia/amarok/src/analyzers/baranalyzer.cpp #661331:661332
@@ -79,8 +79,21 @@
m_lvlMapper[x] = static_cast<uint>( ( F * log10( static_cast<float>(x+1) ) ) );
}
- m_pixBarGradient.resize( height()*COLUMN_WIDTH, height() );
+ m_pixBarGradient = QPixmap( height()*COLUMN_WIDTH, height() );
+ QPainter p( &m_pixBarGradient );
+ for ( int x=0, r=0x40, g=0x30, b=0xff, r2=255-r; x < height(); ++x )
+ {
+ for ( int y = x; y > 0; --y )
+ {
+ const double fraction = (double)y / height();
+
+// p.setPen( QColor( r + (int)(r2 * fraction), g, b - (int)(255 * fraction) ) );
+ p.setPen( QColor( r + (int)(r2 * fraction), g, b ) );
+ p.drawLine( x*COLUMN_WIDTH, height() - y, (x+1)*COLUMN_WIDTH, height() - y );
+ }
+ }
+
setMinimumSize( QSize( BAND_COUNT * COLUMN_WIDTH, 10 ) );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic