Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ScriptCollection refresh support. Also new header.
- Loading branch information
Showing
9 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === | ||
* | ||
* Copyright 2013, Teo Mrnjavac <teo@kde.org> | ||
* | ||
* Tomahawk is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Tomahawk is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "ScriptCollectionHeader.h" | ||
|
||
#include "utils/ImageRegistry.h" | ||
#include "widgets/ElidedLabel.h" | ||
|
||
#include <QBoxLayout> | ||
#include <QPushButton> | ||
|
||
ScriptCollectionHeader::ScriptCollectionHeader( QWidget* parent ) | ||
: FilterHeader( parent ) | ||
{ | ||
m_refreshButton = new QPushButton( this ); | ||
m_refreshButton->setFlat( true ); | ||
QHBoxLayout* descLayout = new QHBoxLayout; | ||
m_verticalLayout->insertLayout( m_verticalLayout->indexOf( m_descriptionLabel ), | ||
descLayout ); | ||
descLayout->addWidget( m_descriptionLabel ); | ||
TomahawkUtils::unmarginLayout( descLayout ); | ||
descLayout->addSpacing( m_descriptionLabel->fontMetrics().height() / 2 ); | ||
descLayout->addWidget( m_refreshButton ); | ||
descLayout->addStretch(); | ||
|
||
m_refreshButton->setIcon( ImageRegistry::instance()->pixmap( RESPATH "images/refresh.svg", QSize( m_descriptionLabel->fontMetrics().height(), | ||
m_descriptionLabel->fontMetrics().height() ), TomahawkUtils::DropShadow ) ); | ||
m_refreshButton->setFixedSize( m_descriptionLabel->fontMetrics().height() + m_descriptionLabel->margin() * 2, | ||
m_descriptionLabel->fontMetrics().height() + m_descriptionLabel->margin() * 2 ); | ||
|
||
connect( m_refreshButton, SIGNAL( clicked() ), | ||
this, SIGNAL( refreshClicked() ) ); | ||
m_refreshButton->hide(); | ||
} | ||
|
||
|
||
void | ||
ScriptCollectionHeader::setRefreshVisible( bool visible ) | ||
{ | ||
m_refreshButton->setVisible( visible ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === | ||
* | ||
* Copyright 2013, Teo Mrnjavac <teo@kde.org> | ||
* | ||
* Tomahawk is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Tomahawk is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef SCRIPTCOLLECTIONHEADER_H | ||
#define SCRIPTCOLLECTIONHEADER_H | ||
|
||
#include "widgets/FilterHeader.h" | ||
|
||
class QPushButton; | ||
|
||
class DLLEXPORT ScriptCollectionHeader : public FilterHeader | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit ScriptCollectionHeader( QWidget* parent = 0 ); | ||
|
||
void setRefreshVisible( bool visible ); | ||
|
||
signals: | ||
void refreshClicked(); | ||
|
||
protected: | ||
QPushButton* m_refreshButton; | ||
}; | ||
|
||
#endif // SCRIPTCOLLECTIONHEADER_H |