diff --git a/src/libtomahawk/widgets/siblingcrumbbutton.cpp b/src/libtomahawk/widgets/siblingcrumbbutton.cpp index ebc607ac5..d0c3fe375 100644 --- a/src/libtomahawk/widgets/siblingcrumbbutton.cpp +++ b/src/libtomahawk/widgets/siblingcrumbbutton.cpp @@ -71,7 +71,8 @@ bool SiblingCrumbButton::isActive() const QSize SiblingCrumbButton::sizeHint() const { // our width = width of combo + 20px for right-arrow and spacing - return m_combo->sizeHint() + QSize(20,0); + const int padding = hasChildren() ? 20 : 5; + return m_combo->sizeHint() + QSize(padding,0); } void SiblingCrumbButton::paintEvent(QPaintEvent *event) @@ -85,6 +86,9 @@ void SiblingCrumbButton::paintEvent(QPaintEvent *event) StyleHelper::horizontalHeader(&p, r); // draw the background + if( !hasChildren() ) + return; + bool reverse = opt.direction == Qt::RightToLeft; int menuButtonWidth = 12; int rightSpacing = 10; @@ -147,3 +151,8 @@ void SiblingCrumbButton::activateSelf() { comboboxActivated(m_index.row()); } + +bool SiblingCrumbButton::hasChildren() const +{ + return m_index.model()->hasChildren(m_index); +} diff --git a/src/libtomahawk/widgets/siblingcrumbbutton.h b/src/libtomahawk/widgets/siblingcrumbbutton.h index 598a6ba53..d7d89a7e8 100644 --- a/src/libtomahawk/widgets/siblingcrumbbutton.h +++ b/src/libtomahawk/widgets/siblingcrumbbutton.h @@ -71,6 +71,8 @@ private slots: void activateSelf(); private: + bool hasChildren() const; + QModelIndex m_index; /*!< our current index */ ComboBox *m_combo; /*!< our combobox! */ diff --git a/src/libtomahawk/widgets/whatshotwidget.cpp b/src/libtomahawk/widgets/whatshotwidget.cpp index 521ab80d8..5f530a83b 100644 --- a/src/libtomahawk/widgets/whatshotwidget.cpp +++ b/src/libtomahawk/widgets/whatshotwidget.cpp @@ -55,6 +55,8 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent ) TomahawkUtils::unmarginLayout( layout() ); TomahawkUtils::unmarginLayout( ui->verticalLayout->layout() ); TomahawkUtils::unmarginLayout( ui->verticalLayout_2->layout() ); + TomahawkUtils::unmarginLayout( ui->breadCrumbLeft->layout() ); + TomahawkUtils::unmarginLayout( ui->breadCrumbRight->layout() ); //set crumb widgets