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

* Some more cleanups.

This commit is contained in:
Christian Muehlhaeuser 2011-09-04 08:58:09 +02:00
parent 5b8f35294b
commit 58362883b3
7 changed files with 14 additions and 11 deletions

View File

@ -36,9 +36,6 @@ RelatedArtistsContext::RelatedArtistsContext()
m_relatedModel->setColumnStyle( TreeModel::TrackOnly );
m_relatedView->setTreeModel( m_relatedModel );
m_relatedView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_relatedView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_relatedView->header()->setVisible( false );
m_relatedView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
QPalette pal = m_relatedView->palette();
pal.setColor( QPalette::Window, QColor( 0, 0, 0, 0 ) );

View File

@ -36,8 +36,6 @@ TopTracksContext::TopTracksContext()
m_topHitsModel->setStyle( TrackModel::Short );
m_topHitsView->setPlaylistModel( m_topHitsModel );
m_topHitsView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_topHitsView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_topHitsView->setHeaderHidden( true );
QPalette pal = m_topHitsView->palette();
pal.setColor( QPalette::Window, QColor( 0, 0, 0, 0 ) );

View File

@ -129,6 +129,17 @@ ArtistView::setTreeModel( TreeModel* model )
connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ) );
setAcceptDrops( false );
if ( model->columnStyle() == TreeModel::TrackOnly )
{
setHeaderHidden( true );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
}
else
{
setHeaderHidden( false );
setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
}
}

View File

@ -142,7 +142,7 @@ TrackView::setTrackModel( TrackModel* model )
setAcceptDrops( true );
if ( model->style() == TrackModel::Short )
if ( model->style() == TrackModel::Short || model->style() == TrackModel::ShortWithAvatars )
{
setHeaderHidden( true );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
@ -520,7 +520,7 @@ TrackView::mousePressEvent( QMouseEvent* event )
{
QTreeView::mousePressEvent( event );
if ( m_model->style() == TrackModel::Short || m_model->style() == TrackModel::ShortWithAvatars )
if ( m_model->style() != TrackModel::Detailed )
return;
QModelIndex idx = indexAt( event->pos() );

View File

@ -91,6 +91,7 @@ public:
void getCover( const QModelIndex& index );
ColumnStyle columnStyle() const { return m_columnStyle; }
void setColumnStyle( ColumnStyle style );
virtual QString title() const { return m_title; }

View File

@ -59,8 +59,6 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
m_relatedModel = new TreeModel( ui->relatedArtists );
m_relatedModel->setColumnStyle( TreeModel::TrackOnly );
ui->relatedArtists->setTreeModel( m_relatedModel );
ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
ui->relatedArtists->header()->setVisible( false );
m_topHitsModel = new PlaylistModel( ui->topHits );
m_topHitsModel->setStyle( TrackModel::Short );

View File

@ -81,8 +81,6 @@ WelcomeWidget::WelcomeWidget( QWidget* parent )
m_tracksModel->setStyle( TrackModel::ShortWithAvatars );
ui->tracksView->overlay()->setEnabled( false );
ui->tracksView->setPlaylistModel( m_tracksModel );
ui->tracksView->setHeaderHidden( true );
ui->tracksView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_recentAlbumsModel = new AlbumModel( ui->additionsView );
ui->additionsView->setAlbumModel( m_recentAlbumsModel );