mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-19 12:21:52 +02:00
* Don't paint OverlayWidget if's not enabled.
* Disable OverlayWidgets in a few cases (WelcomeWidget, SourceInfoWidget, HistoryWidgets, ...).
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
#include "database/databasecommand_alltracks.h"
|
#include "database/databasecommand_alltracks.h"
|
||||||
#include "database/databasecommand_allalbums.h"
|
#include "database/databasecommand_allalbums.h"
|
||||||
|
|
||||||
|
#include "widgets/overlaywidget.h"
|
||||||
|
|
||||||
|
|
||||||
SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget* parent )
|
SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
@@ -19,6 +21,7 @@ SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget*
|
|||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
|
|
||||||
ui->sourceLabel->setText( source->friendlyName() );
|
ui->sourceLabel->setText( source->friendlyName() );
|
||||||
|
ui->historyView->overlay()->setEnabled( false );
|
||||||
|
|
||||||
m_recentCollectionModel = new CollectionFlatModel( ui->recentCollectionView );
|
m_recentCollectionModel = new CollectionFlatModel( ui->recentCollectionView );
|
||||||
ui->recentCollectionView->setModel( m_recentCollectionModel );
|
ui->recentCollectionView->setModel( m_recentCollectionModel );
|
||||||
|
@@ -9,6 +9,8 @@
|
|||||||
#include "playlist/playlistmanager.h"
|
#include "playlist/playlistmanager.h"
|
||||||
#include "playlist/playlistmodel.h"
|
#include "playlist/playlistmodel.h"
|
||||||
|
|
||||||
|
#include "widgets/overlaywidget.h"
|
||||||
|
|
||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
#include "utils/xspfloader.h"
|
#include "utils/xspfloader.h"
|
||||||
|
|
||||||
@@ -36,6 +38,7 @@ NewPlaylistWidget::NewPlaylistWidget( QWidget* parent )
|
|||||||
|
|
||||||
m_suggestionsModel = new PlaylistModel( ui->suggestionsView );
|
m_suggestionsModel = new PlaylistModel( ui->suggestionsView );
|
||||||
ui->suggestionsView->setModel( m_suggestionsModel );
|
ui->suggestionsView->setModel( m_suggestionsModel );
|
||||||
|
ui->suggestionsView->overlay()->setEnabled( false );
|
||||||
|
|
||||||
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( updateSuggestions() ) );
|
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( updateSuggestions() ) );
|
||||||
}
|
}
|
||||||
|
@@ -46,6 +46,9 @@ OverlayWidget::pixmap()
|
|||||||
void
|
void
|
||||||
OverlayWidget::paint( QPainter* painter )
|
OverlayWidget::paint( QPainter* painter )
|
||||||
{
|
{
|
||||||
|
if ( !isEnabled() )
|
||||||
|
return;
|
||||||
|
|
||||||
pixmap(); // cache the image
|
pixmap(); // cache the image
|
||||||
|
|
||||||
QRect center( QPoint( ( painter->viewport().width() - m_pixmap.width() ) / 2,
|
QRect center( QPoint( ( painter->viewport().width() - m_pixmap.width() ) / 2,
|
||||||
|
@@ -6,6 +6,8 @@
|
|||||||
#include "playlist/playlistmanager.h"
|
#include "playlist/playlistmanager.h"
|
||||||
#include "playlist/playlistmodel.h"
|
#include "playlist/playlistmodel.h"
|
||||||
|
|
||||||
|
#include "widgets/overlaywidget.h"
|
||||||
|
|
||||||
#include "sourcelist.h"
|
#include "sourcelist.h"
|
||||||
#include "tomahawksettings.h"
|
#include "tomahawksettings.h"
|
||||||
|
|
||||||
@@ -19,7 +21,9 @@ WelcomeWidget::WelcomeWidget( QWidget* parent )
|
|||||||
, ui( new Ui::WelcomeWidget )
|
, ui( new Ui::WelcomeWidget )
|
||||||
{
|
{
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
|
|
||||||
ui->playlistWidget->setItemDelegate( new PlaylistDelegate() );
|
ui->playlistWidget->setItemDelegate( new PlaylistDelegate() );
|
||||||
|
ui->tracksView->overlay()->setEnabled( false );
|
||||||
|
|
||||||
m_tracksModel = new PlaylistModel( ui->tracksView );
|
m_tracksModel = new PlaylistModel( ui->tracksView );
|
||||||
ui->tracksView->setModel( m_tracksModel );
|
ui->tracksView->setModel( m_tracksModel );
|
||||||
|
Reference in New Issue
Block a user