mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
TWK-477: Restore code that was lost during file split, and add a proper license header
This commit is contained in:
parent
47c515caa4
commit
0cea650181
@ -1,3 +1,23 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||
* Copyright 2011, Michael Zanetti <mzanetti@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 "sourcedelegate.h"
|
||||
|
||||
#include "items/sourcetreeitem.h"
|
||||
@ -276,6 +296,24 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
else
|
||||
{
|
||||
QStyledItemDelegate::paint( painter, o, index );
|
||||
if ( type == SourcesModel::TemporaryPage )
|
||||
{
|
||||
TemporaryPageItem* gpi = qobject_cast< TemporaryPageItem* >( item );
|
||||
Q_ASSERT( gpi );
|
||||
|
||||
if ( gpi && o3.state & QStyle::State_MouseOver )
|
||||
{
|
||||
// draw close icon
|
||||
int padding = 3;
|
||||
m_iconHeight = ( o3.rect.height() - 2*padding );
|
||||
QPixmap p( RESPATH "images/list-remove.png" );
|
||||
p = p.scaledToHeight( m_iconHeight, Qt::SmoothTransformation );
|
||||
|
||||
QRect r ( o3.rect.right() - padding - m_iconHeight, padding + o3.rect.y(), m_iconHeight, m_iconHeight );
|
||||
painter->drawPixmap( r, p );
|
||||
}
|
||||
}
|
||||
|
||||
/*QStyleOptionViewItemV4 opt = o;
|
||||
initStyleOption( &opt, index );
|
||||
|
||||
|
@ -1,3 +1,23 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||
* Copyright 2011, Michael Zanetti <mzanetti@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 SOURCEDELEGATE_H
|
||||
#define SOURCEDELEGATE_H
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user