mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
* Removed header from ColumnView.
This commit is contained in:
@@ -50,7 +50,6 @@ using namespace Tomahawk;
|
|||||||
|
|
||||||
ColumnView::ColumnView( QWidget* parent )
|
ColumnView::ColumnView( QWidget* parent )
|
||||||
: QColumnView( parent )
|
: QColumnView( parent )
|
||||||
, m_header( new ViewHeader( this ) )
|
|
||||||
, m_overlay( new OverlayWidget( this ) )
|
, m_overlay( new OverlayWidget( this ) )
|
||||||
, m_model( 0 )
|
, m_model( 0 )
|
||||||
, m_proxyModel( 0 )
|
, m_proxyModel( 0 )
|
||||||
@@ -133,7 +132,6 @@ ColumnView::setTreeModel( TreeModel* model )
|
|||||||
|
|
||||||
guid(); // this will set the guid on the header
|
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::Large )
|
||||||
{
|
{
|
||||||
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
@@ -154,7 +152,7 @@ ColumnView::setTreeModel( TreeModel* model )
|
|||||||
sortByColumn( PlayableModel::Artist, Qt::AscendingOrder );*/
|
sortByColumn( PlayableModel::Artist, Qt::AscendingOrder );*/
|
||||||
|
|
||||||
QList< int > widths;
|
QList< int > widths;
|
||||||
widths << 320;
|
widths << m_previewWidget->minimumSize().width() + 32;
|
||||||
setColumnWidths( widths );
|
setColumnWidths( widths );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,15 +271,6 @@ void
|
|||||||
ColumnView::resizeEvent( QResizeEvent* event )
|
ColumnView::resizeEvent( QResizeEvent* event )
|
||||||
{
|
{
|
||||||
QColumnView::resizeEvent( event );
|
QColumnView::resizeEvent( event );
|
||||||
m_header->checkState();
|
|
||||||
|
|
||||||
if ( !model() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( model()->columnCount( QModelIndex() ) == 1 )
|
|
||||||
{
|
|
||||||
m_header->resizeSection( 0, event->size().width() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -450,7 +439,6 @@ ColumnView::guid() const
|
|||||||
if ( m_guid.isEmpty() )
|
if ( m_guid.isEmpty() )
|
||||||
{
|
{
|
||||||
m_guid = QString( "columnview/%1" ).arg( m_model->columnCount( QModelIndex() ) );
|
m_guid = QString( "columnview/%1" ).arg( m_model->columnCount( QModelIndex() ) );
|
||||||
m_header->setGuid( m_guid );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_guid;
|
return m_guid;
|
||||||
@@ -467,7 +455,7 @@ ColumnView::onUpdatePreviewWidget( const QModelIndex& index )
|
|||||||
QList< int > finalWidths;
|
QList< int > finalWidths;
|
||||||
foreach ( int w, widths )
|
foreach ( int w, widths )
|
||||||
{
|
{
|
||||||
finalWidths << qMax( 320, w );
|
finalWidths << qMax( m_previewWidget->minimumSize().width() + 32, w );
|
||||||
}
|
}
|
||||||
setColumnWidths( finalWidths );
|
setColumnWidths( finalWidths );
|
||||||
|
|
||||||
|
@@ -98,7 +98,6 @@ private slots:
|
|||||||
void onMenuTriggered( int action );
|
void onMenuTriggered( int action );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ViewHeader* m_header;
|
|
||||||
OverlayWidget* m_overlay;
|
OverlayWidget* m_overlay;
|
||||||
TreeModel* m_model;
|
TreeModel* m_model;
|
||||||
TreeProxyModel* m_proxyModel;
|
TreeProxyModel* m_proxyModel;
|
||||||
|
Reference in New Issue
Block a user