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