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

* TrackView should restore externally set alternating-row-color setting.

This commit is contained in:
Christian Muehlhaeuser 2013-06-07 08:56:30 +02:00
parent 162610bae5
commit 096331016e
2 changed files with 15 additions and 3 deletions

View File

@ -57,6 +57,7 @@ TrackView::TrackView( QWidget* parent )
, m_resizing( false )
, m_dragging( false )
, m_updateContextView( true )
, m_alternatingRowColors( true )
, m_contextMenu( new ContextMenu( this ) )
{
setFrameShape( QFrame::NoFrame );
@ -233,7 +234,7 @@ TrackView::setEmptyTip( const QString& tip )
void
TrackView::onModelFilling()
{
setAlternatingRowColors( true );
QTreeView::setAlternatingRowColors( m_alternatingRowColors );
}
@ -241,7 +242,7 @@ void
TrackView::onModelEmptyCheck()
{
if ( !m_proxyModel->rowCount( QModelIndex() ) )
setAlternatingRowColors( false );
QTreeView::setAlternatingRowColors( false );
}
@ -429,7 +430,7 @@ TrackView::resizeEvent( QResizeEvent* event )
int sortSection = m_header->sortIndicatorSection();
Qt::SortOrder sortOrder = m_header->sortIndicatorOrder();
tDebug() << Q_FUNC_INFO << width();
// tDebug() << Q_FUNC_INFO << width();
if ( m_header->checkState() && sortSection >= 0 )
{
@ -795,3 +796,11 @@ TrackView::setAutoResize( bool b )
if ( m_autoResize )
setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
}
void
TrackView::setAlternatingRowColors( bool enable )
{
m_alternatingRowColors = enable;
QTreeView::setAlternatingRowColors( enable );
}

View File

@ -84,6 +84,8 @@ public:
bool autoResize() const { return m_autoResize; }
void setAutoResize( bool b );
void setAlternatingRowColors( bool enable );
// Starts playing from the beginning if resolved, or waits until a track is playable
void startPlayingFromStart();
@ -150,6 +152,7 @@ private:
bool m_updateContextView;
bool m_autoResize;
bool m_alternatingRowColors;
QModelIndex m_contextMenuIndex;