diff --git a/src/libtomahawk/widgets/PlayableCover.cpp b/src/libtomahawk/widgets/PlayableCover.cpp index 670c38c8a..a1a07c69a 100644 --- a/src/libtomahawk/widgets/PlayableCover.cpp +++ b/src/libtomahawk/widgets/PlayableCover.cpp @@ -38,6 +38,7 @@ using namespace Tomahawk; PlayableCover::PlayableCover( QWidget* parent ) : QLabel( parent ) , m_showText( false ) + , m_showControls( true ) { setMouseTracking( true ); @@ -67,7 +68,8 @@ PlayableCover::enterEvent( QEvent* event ) { QLabel::enterEvent( event ); - m_button->show(); + if ( m_showControls ) + m_button->show(); } @@ -204,7 +206,7 @@ PlayableCover::contextMenuEvent( QContextMenuEvent* event ) void PlayableCover::setPixmap( const QPixmap& pixmap ) { - m_pixmap = TomahawkUtils::createRoundedImage( pixmap, size() ); + m_pixmap = pixmap; // TomahawkUtils::createRoundedImage( pixmap, size() ); repaint(); } @@ -386,3 +388,10 @@ void PlayableCover::setShowText( bool b ) m_showText = b; repaint(); } + + +void PlayableCover::setShowControls( bool b ) +{ + m_showControls = b; + repaint(); +} diff --git a/src/libtomahawk/widgets/PlayableCover.h b/src/libtomahawk/widgets/PlayableCover.h index b09c7b78c..b3f6381a4 100644 --- a/src/libtomahawk/widgets/PlayableCover.h +++ b/src/libtomahawk/widgets/PlayableCover.h @@ -47,7 +47,6 @@ public: virtual ~PlayableCover(); bool showText() const { return m_showText; } - void setShowText( bool b ); QPixmap pixmap() const { return m_pixmap; } @@ -56,6 +55,8 @@ public slots: virtual void setAlbum( const Tomahawk::album_ptr& album ); virtual void setQuery( const Tomahawk::query_ptr& query ); + void setShowText( bool b ); + void setShowControls( bool b ); void setPixmap( const QPixmap& pixmap ); protected: @@ -67,7 +68,7 @@ protected: virtual void mouseReleaseEvent( QMouseEvent* event ); virtual void contextMenuEvent( QContextMenuEvent* event ); - + void leaveEvent( QEvent* event ); void enterEvent( QEvent* event ); @@ -90,6 +91,7 @@ private: QRect m_hoveredRect; bool m_showText; + bool m_showControls; }; #endif