mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-14 10:05:32 +02:00
If the current crumb doesn't have any children, do not show the arrow.
This commit is contained in:
@@ -71,7 +71,8 @@ bool SiblingCrumbButton::isActive() const
|
|||||||
QSize SiblingCrumbButton::sizeHint() const
|
QSize SiblingCrumbButton::sizeHint() const
|
||||||
{
|
{
|
||||||
// our width = width of combo + 20px for right-arrow and spacing
|
// 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)
|
void SiblingCrumbButton::paintEvent(QPaintEvent *event)
|
||||||
@@ -85,6 +86,9 @@ void SiblingCrumbButton::paintEvent(QPaintEvent *event)
|
|||||||
|
|
||||||
StyleHelper::horizontalHeader(&p, r); // draw the background
|
StyleHelper::horizontalHeader(&p, r); // draw the background
|
||||||
|
|
||||||
|
if( !hasChildren() )
|
||||||
|
return;
|
||||||
|
|
||||||
bool reverse = opt.direction == Qt::RightToLeft;
|
bool reverse = opt.direction == Qt::RightToLeft;
|
||||||
int menuButtonWidth = 12;
|
int menuButtonWidth = 12;
|
||||||
int rightSpacing = 10;
|
int rightSpacing = 10;
|
||||||
@@ -147,3 +151,8 @@ void SiblingCrumbButton::activateSelf()
|
|||||||
{
|
{
|
||||||
comboboxActivated(m_index.row());
|
comboboxActivated(m_index.row());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SiblingCrumbButton::hasChildren() const
|
||||||
|
{
|
||||||
|
return m_index.model()->hasChildren(m_index);
|
||||||
|
}
|
||||||
|
@@ -71,6 +71,8 @@ private slots:
|
|||||||
void activateSelf();
|
void activateSelf();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool hasChildren() const;
|
||||||
|
|
||||||
QModelIndex m_index; /*!< our current index */
|
QModelIndex m_index; /*!< our current index */
|
||||||
ComboBox *m_combo; /*!< our combobox! */
|
ComboBox *m_combo; /*!< our combobox! */
|
||||||
|
|
||||||
|
@@ -55,6 +55,8 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
|||||||
TomahawkUtils::unmarginLayout( layout() );
|
TomahawkUtils::unmarginLayout( layout() );
|
||||||
TomahawkUtils::unmarginLayout( ui->verticalLayout->layout() );
|
TomahawkUtils::unmarginLayout( ui->verticalLayout->layout() );
|
||||||
TomahawkUtils::unmarginLayout( ui->verticalLayout_2->layout() );
|
TomahawkUtils::unmarginLayout( ui->verticalLayout_2->layout() );
|
||||||
|
TomahawkUtils::unmarginLayout( ui->breadCrumbLeft->layout() );
|
||||||
|
TomahawkUtils::unmarginLayout( ui->breadCrumbRight->layout() );
|
||||||
|
|
||||||
|
|
||||||
//set crumb widgets
|
//set crumb widgets
|
||||||
|
Reference in New Issue
Block a user