mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
Fix sizing and flicker
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -35,6 +36,11 @@ BreadcrumbButton::BreadcrumbButton( Breadcrumb* parent, QAbstractItemModel* mode
|
|||||||
, m_model( model )
|
, m_model( model )
|
||||||
, m_combo( new ComboBox( this ) )
|
, m_combo( new ComboBox( this ) )
|
||||||
{
|
{
|
||||||
|
setLayout( new QHBoxLayout );
|
||||||
|
layout()->setContentsMargins( 0, 0, 0, 0 );
|
||||||
|
layout()->setSpacing( 0 );
|
||||||
|
layout()->addWidget( m_combo );
|
||||||
|
|
||||||
setFixedHeight( TomahawkUtils::headerHeight() );
|
setFixedHeight( TomahawkUtils::headerHeight() );
|
||||||
m_combo->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
m_combo->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
||||||
|
|
||||||
@@ -131,6 +137,7 @@ BreadcrumbButton::setParentIndex( const QModelIndex& idx )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_combo->hide();
|
||||||
m_combo->clear();
|
m_combo->clear();
|
||||||
m_combo->addItems( list );
|
m_combo->addItems( list );
|
||||||
|
|
||||||
@@ -140,6 +147,8 @@ BreadcrumbButton::setParentIndex( const QModelIndex& idx )
|
|||||||
m_combo->setCurrentIndex( defaultIndex );
|
m_combo->setCurrentIndex( defaultIndex );
|
||||||
|
|
||||||
m_curIndex = m_model->index( m_combo->currentIndex(), 0, m_parentIndex );
|
m_curIndex = m_model->index( m_combo->currentIndex(), 0, m_parentIndex );
|
||||||
|
|
||||||
|
m_combo->show();
|
||||||
m_combo->adjustSize();
|
m_combo->adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user