1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 23:39:42 +01:00

Make the root icon clickable and expose a signal.

This commit is contained in:
Casey Link 2011-09-01 00:29:05 +00:00
parent c79985ad86
commit 776a2deb91
2 changed files with 9 additions and 3 deletions

View File

@ -241,12 +241,15 @@ void BreadcrumbBar::currentIndexChanged()
void BreadcrumbBar::setRootIcon(const QIcon &icon)
{
m_rootIcon = icon;
QLabel *label= new QLabel(this);
label->setPixmap(icon.pixmap(16,16));
m_layout->insertWidget(0, label);
QPushButton* button = new QPushButton(icon, "", this);
button->setFlat(true);
button->setStyleSheet( "QPushButton{ background-color: transparent; border: none; width:16px; height:16px;}" );
m_layout->insertWidget(0, button);
m_layout->insertSpacing(0,5);
m_layout->insertSpacing(2,5);
connect(button, SIGNAL(clicked()), this, SIGNAL(rootClicked()));
}
void BreadcrumbBar::setRootText(const QString &text)

View File

@ -129,6 +129,9 @@ public:
*/
void currentChangedTriggered(QModelIndex const& index);
signals:
void rootClicked();
protected:
/**
* \brief append a crumb widget