From 4de60911cd944234bcefbd8184953337517fab02 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 27 Oct 2011 22:44:38 -0400 Subject: [PATCH] Fix sizing and flicker --- src/libtomahawk/widgets/BreadcrumbButton.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libtomahawk/widgets/BreadcrumbButton.cpp b/src/libtomahawk/widgets/BreadcrumbButton.cpp index 3c005732d..4a94b469a 100644 --- a/src/libtomahawk/widgets/BreadcrumbButton.cpp +++ b/src/libtomahawk/widgets/BreadcrumbButton.cpp @@ -26,6 +26,7 @@ #include #include +#include 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(); }