mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
* Drop PlaylistItemDelegate::Short and ::Large styles. Combined as ::Fancy.
This commit is contained in:
parent
4342257565
commit
ea085fe77c
@ -72,7 +72,7 @@ SocialPlaylistWidget::SocialPlaylistWidget ( QWidget* parent )
|
||||
|
||||
m_topForeignTracksModel = new PlaylistModel( ui->newTracksView );
|
||||
ui->newTracksView->setPlaylistModel( m_topForeignTracksModel );
|
||||
ui->newTracksView->proxyModel()->setStyle( PlayableProxyModel::Short );
|
||||
ui->newTracksView->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
ui->newTracksView->overlay()->setEnabled( false );
|
||||
|
||||
m_popularNewAlbumsModel = new PlayableModel( ui->newAlbumsView );
|
||||
|
@ -135,7 +135,7 @@ ColumnView::setTreeModel( TreeModel* model )
|
||||
|
||||
guid(); // this will set the guid on the header
|
||||
|
||||
if ( m_proxyModel->style() == PlayableProxyModel::Large )
|
||||
if ( m_proxyModel->style() == PlayableProxyModel::Fancy )
|
||||
{
|
||||
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ ContextView::ContextView( QWidget* parent, const QString& caption )
|
||||
|
||||
TrackItemDelegate* del = new TrackItemDelegate( TrackItemDelegate::LovedTracks, m_trackView, m_trackView->proxyModel() );
|
||||
m_trackView->setPlaylistItemDelegate( del );
|
||||
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Large );
|
||||
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() );
|
||||
|
||||
setLayout( new QVBoxLayout() );
|
||||
|
@ -64,7 +64,7 @@ FlexibleView::FlexibleView( QWidget* parent, QWidget* extraHeader )
|
||||
|
||||
TrackItemDelegate* del = new TrackItemDelegate( TrackItemDelegate::LovedTracks, m_trackView, m_trackView->proxyModel() );
|
||||
m_trackView->setPlaylistItemDelegate( del );
|
||||
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Large );
|
||||
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
|
||||
m_stack = new QStackedWidget();
|
||||
setLayout( new QVBoxLayout() );
|
||||
|
@ -29,7 +29,7 @@
|
||||
InboxView::InboxView( QWidget* parent ) :
|
||||
TrackView( parent )
|
||||
{
|
||||
proxyModel()->setStyle( PlayableProxyModel::Large );
|
||||
proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
setEmptyTip( tr( "No listening suggestions here." ) );
|
||||
|
||||
TrackView::setGuid( "inbox" );
|
||||
|
@ -48,7 +48,7 @@ PlayableProxyModel::PlayableProxyModel( QObject* parent )
|
||||
|
||||
PlayableProxyModel::setSourcePlayableModel( NULL );
|
||||
|
||||
m_headerStyle[ Large ] << PlayableModel::Name;
|
||||
m_headerStyle[ Fancy ] << PlayableModel::Name;
|
||||
m_headerStyle[ Detailed ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin << PlayableModel::Score;
|
||||
m_headerStyle[ Collection ] << PlayableModel::Name << PlayableModel::Composer << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin;
|
||||
}
|
||||
@ -579,8 +579,7 @@ PlayableProxyModel::columnCount( const QModelIndex& parent ) const
|
||||
|
||||
switch ( m_style )
|
||||
{
|
||||
case Short:
|
||||
case Large:
|
||||
case Fancy:
|
||||
return 1;
|
||||
break;
|
||||
|
||||
@ -642,8 +641,7 @@ PlayableProxyModel::columnWeights() const
|
||||
|
||||
switch ( m_style )
|
||||
{
|
||||
case Short:
|
||||
case Large:
|
||||
case Fancy:
|
||||
w << 1.0;
|
||||
break;
|
||||
|
||||
@ -678,7 +676,7 @@ PlayableProxyModel::updateDetailedInfo( const QModelIndex& index )
|
||||
{
|
||||
item->query()->track()->cover( QSize( 0, 0 ) );
|
||||
|
||||
if ( style() == PlayableProxyModel::Large )
|
||||
if ( style() == PlayableProxyModel::Fancy )
|
||||
{
|
||||
item->query()->track()->loadSocialActions();
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ Q_OBJECT
|
||||
|
||||
public:
|
||||
enum PlayableItemStyle
|
||||
{ Detailed = 0, Short = 1, Large = 3, Collection = 4 };
|
||||
{ Detailed = 0, Fancy = 1, Collection = 2 };
|
||||
|
||||
enum PlayableProxyModelRole
|
||||
{ StyleRole = Qt::UserRole + 1, TypeRole };
|
||||
|
@ -107,12 +107,7 @@ PlaylistItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModel
|
||||
QSize size = QStyledItemDelegate::sizeHint( option, index );
|
||||
|
||||
{
|
||||
if ( m_model->style() == PlayableProxyModel::Short )
|
||||
{
|
||||
int rowHeight = option.fontMetrics.height() + 8;
|
||||
size.setHeight( rowHeight * 2 );
|
||||
}
|
||||
else if ( m_model->style() == PlayableProxyModel::Detailed )
|
||||
if ( m_model->style() == PlayableProxyModel::Detailed )
|
||||
{
|
||||
int rowHeight = option.fontMetrics.height() * 1.6;
|
||||
size.setHeight( rowHeight );
|
||||
@ -141,10 +136,6 @@ PlaylistItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& opti
|
||||
case PlayableProxyModel::Detailed:
|
||||
paintDetailed( painter, option, index );
|
||||
break;
|
||||
|
||||
case PlayableProxyModel::Short:
|
||||
paintShort( painter, option, index );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ QueueView::QueueView( QWidget* parent )
|
||||
// setCaption( tr( "Queue Details" ) );
|
||||
|
||||
trackView()->setProxyModel( new QueueProxyModel( trackView() ) );
|
||||
trackView()->proxyModel()->setStyle( PlayableProxyModel::Large );
|
||||
trackView()->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
trackView()->setHeaderHidden( true );
|
||||
trackView()->setUniformRowHeights( false );
|
||||
|
||||
|
@ -227,8 +227,7 @@ TrackView::setPlayableModel( PlayableModel* model )
|
||||
|
||||
switch( m_proxyModel->style() )
|
||||
{
|
||||
case PlayableProxyModel::Short:
|
||||
case PlayableProxyModel::Large:
|
||||
case PlayableProxyModel::Fancy:
|
||||
setHeaderHidden( true );
|
||||
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
break;
|
||||
|
@ -134,7 +134,7 @@ TreeView::setTreeModel( TreeModel* model )
|
||||
guid(); // this will set the guid on the header
|
||||
|
||||
m_header->setDefaultColumnWeights( m_proxyModel->columnWeights() );
|
||||
if ( m_proxyModel->style() == PlayableProxyModel::Large )
|
||||
if ( m_proxyModel->style() == PlayableProxyModel::Fancy )
|
||||
{
|
||||
setHeaderHidden( true );
|
||||
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
#include "audio/AudioEngine.h"
|
||||
#include "playlist/GridItemDelegate.h"
|
||||
#include "playlist/AlbumItemDelegate.h"
|
||||
#include "playlist/PlayableModel.h"
|
||||
#include "playlist/TreeModel.h"
|
||||
#include "playlist/PlaylistModel.h"
|
||||
|
@ -50,13 +50,13 @@ SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget*
|
||||
ui->splitter->setStretchFactor( 1, 1 );
|
||||
|
||||
m_recentTracksModel = new RecentlyAddedModel( ui->recentCollectionView );
|
||||
ui->recentCollectionView->proxyModel()->setStyle( PlayableProxyModel::Short );
|
||||
ui->recentCollectionView->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
ui->recentCollectionView->setPlayableModel( m_recentTracksModel );
|
||||
ui->recentCollectionView->sortByColumn( PlayableModel::Age, Qt::DescendingOrder );
|
||||
m_recentTracksModel->setSource( source );
|
||||
|
||||
m_historyModel = new RecentlyPlayedModel( ui->historyView );
|
||||
ui->historyView->proxyModel()->setStyle( PlayableProxyModel::Short );
|
||||
ui->historyView->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
ui->historyView->setPlayableModel( m_historyModel );
|
||||
m_historyModel->setSource( source );
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "database/Database.h"
|
||||
#include "database/DatabaseCommand_NetworkCharts.h"
|
||||
#include "database/DatabaseCommand_TrendingTracks.h"
|
||||
#include "playlist/AlbumItemDelegate.h"
|
||||
#include "playlist/RecentlyLovedTracksModel.h"
|
||||
#include "playlist/TopLovedTracksModel.h"
|
||||
#include "playlist/TreeProxyModel.h"
|
||||
@ -100,7 +99,7 @@ NetworkActivityWidget::NetworkActivityWidget( QWidget* parent )
|
||||
d->ui->breadCrumbLeft->setVisible( true );
|
||||
|
||||
{
|
||||
AlbumItemDelegate* del = new AlbumItemDelegate( d->ui->tracksViewLeft, d->ui->tracksViewLeft->proxyModel(), true );
|
||||
TrackItemDelegate* del = new TrackItemDelegate( d->ui->tracksViewLeft, d->ui->tracksViewLeft->proxyModel(), true );
|
||||
d->ui->tracksViewLeft->setPlaylistItemDelegate( del );
|
||||
d->ui->tracksViewLeft->proxyModel()->setStyle( PlayableProxyModel::Short );
|
||||
d->ui->tracksViewLeft->setAutoResize( true );
|
||||
|
Loading…
x
Reference in New Issue
Block a user