mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
* Added PlayableCover::setShowText( bool ) which allows to enable / disable the text overlay.
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
PlayableCover::PlayableCover( QWidget* parent )
|
PlayableCover::PlayableCover( QWidget* parent )
|
||||||
: QLabel( parent )
|
: QLabel( parent )
|
||||||
|
, m_showText( false )
|
||||||
{
|
{
|
||||||
setMouseTracking( true );
|
setMouseTracking( true );
|
||||||
|
|
||||||
@@ -80,6 +81,8 @@ void
|
|||||||
PlayableCover::paintEvent( QPaintEvent* event )
|
PlayableCover::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
QLabel::paintEvent( event );
|
QLabel::paintEvent( event );
|
||||||
|
if ( !m_showText )
|
||||||
|
return;
|
||||||
|
|
||||||
QRect r = contentsRect().adjusted( margin(), margin(), -margin(), -margin() );
|
QRect r = contentsRect().adjusted( margin(), margin(), -margin(), -margin() );
|
||||||
QPixmap buffer( r.size() );
|
QPixmap buffer( r.size() );
|
||||||
|
@@ -40,6 +40,9 @@ public:
|
|||||||
PlayableCover( QWidget* parent = 0 );
|
PlayableCover( QWidget* parent = 0 );
|
||||||
virtual ~PlayableCover();
|
virtual ~PlayableCover();
|
||||||
|
|
||||||
|
bool showText() const { return m_showText; }
|
||||||
|
void setShowText( bool b ) { m_showText = b; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void setArtist( const Tomahawk::artist_ptr& artist );
|
virtual void setArtist( const Tomahawk::artist_ptr& artist );
|
||||||
virtual void setAlbum( const Tomahawk::album_ptr& album );
|
virtual void setAlbum( const Tomahawk::album_ptr& album );
|
||||||
@@ -62,6 +65,8 @@ private:
|
|||||||
Tomahawk::artist_ptr m_artist;
|
Tomahawk::artist_ptr m_artist;
|
||||||
Tomahawk::album_ptr m_album;
|
Tomahawk::album_ptr m_album;
|
||||||
Tomahawk::query_ptr m_query;
|
Tomahawk::query_ptr m_query;
|
||||||
|
|
||||||
|
bool m_showText;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user