mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Make the root icon clickable and expose a signal.
This commit is contained in:
@@ -241,12 +241,15 @@ void BreadcrumbBar::currentIndexChanged()
|
|||||||
|
|
||||||
void BreadcrumbBar::setRootIcon(const QIcon &icon)
|
void BreadcrumbBar::setRootIcon(const QIcon &icon)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_rootIcon = icon;
|
m_rootIcon = icon;
|
||||||
QLabel *label= new QLabel(this);
|
QPushButton* button = new QPushButton(icon, "", this);
|
||||||
label->setPixmap(icon.pixmap(16,16));
|
button->setFlat(true);
|
||||||
m_layout->insertWidget(0, label);
|
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(0,5);
|
||||||
m_layout->insertSpacing(2,5);
|
m_layout->insertSpacing(2,5);
|
||||||
|
connect(button, SIGNAL(clicked()), this, SIGNAL(rootClicked()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreadcrumbBar::setRootText(const QString &text)
|
void BreadcrumbBar::setRootText(const QString &text)
|
||||||
|
@@ -129,6 +129,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
void currentChangedTriggered(QModelIndex const& index);
|
void currentChangedTriggered(QModelIndex const& index);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void rootClicked();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* \brief append a crumb widget
|
* \brief append a crumb widget
|
||||||
|
Reference in New Issue
Block a user