1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Added PlayableCover::setShowText( bool ) which allows to enable / disable the text overlay.

This commit is contained in:
Christian Muehlhaeuser 2012-12-18 14:03:56 +01:00
parent f014b5a3f2
commit 74b9f2594e
2 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,7 @@
PlayableCover::PlayableCover( QWidget* parent )
: QLabel( parent )
, m_showText( false )
{
setMouseTracking( true );
@ -80,6 +81,8 @@ void
PlayableCover::paintEvent( QPaintEvent* event )
{
QLabel::paintEvent( event );
if ( !m_showText )
return;
QRect r = contentsRect().adjusted( margin(), margin(), -margin(), -margin() );
QPixmap buffer( r.size() );

View File

@ -40,6 +40,9 @@ public:
PlayableCover( QWidget* parent = 0 );
virtual ~PlayableCover();
bool showText() const { return m_showText; }
void setShowText( bool b ) { m_showText = b; }
public slots:
virtual void setArtist( const Tomahawk::artist_ptr& artist );
virtual void setAlbum( const Tomahawk::album_ptr& album );
@ -62,6 +65,8 @@ private:
Tomahawk::artist_ptr m_artist;
Tomahawk::album_ptr m_album;
Tomahawk::query_ptr m_query;
bool m_showText;
};
#endif