Skip to content

Commit 05c9e01

Browse files
committedSep 14, 2018
[Plugin manager][needs-docs] Deprecated plugins are listed gray. Fixes #19125
1 parent 8b07b4e commit 05c9e01

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed
 

‎src/app/pluginmanager/qgspluginitemdelegate.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ void QgsPluginItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
7777
{
7878
painter->setPen( option.palette.highlightedText().color() );
7979
}
80+
else if ( index.data( PLUGIN_ISDEPRECATED_ROLE ).toString() == QLatin1String( "true" ) )
81+
{
82+
painter->setPen( option.palette.color( QPalette::Disabled, QPalette::Text ) );
83+
}
8084
else
8185
{
8286
painter->setPen( option.palette.text().color() );

‎src/app/pluginmanager/qgspluginmanager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ void QgsPluginManager::reloadModelData()
539539
mypDetailItem->setData( it->value( QStringLiteral( "downloads" ) ).rightJustified( 10, '0' ), PLUGIN_DOWNLOADS_ROLE );
540540
mypDetailItem->setData( it->value( QStringLiteral( "zip_repository" ) ), PLUGIN_REPOSITORY_ROLE );
541541
mypDetailItem->setData( it->value( QStringLiteral( "average_vote" ) ), PLUGIN_VOTE_ROLE );
542+
mypDetailItem->setData( it->value( QStringLiteral( "deprecated" ) ), PLUGIN_ISDEPRECATED_ROLE );
542543

543544
if ( QFileInfo( iconPath ).isFile() )
544545
{

‎src/app/pluginmanager/qgspluginsortfilterproxymodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const int PLUGIN_STATUS_ROLE = Qt::UserRole + 6; // for filtering and sort
3030
const int PLUGIN_DOWNLOADS_ROLE = Qt::UserRole + 7; // for sorting
3131
const int PLUGIN_VOTE_ROLE = Qt::UserRole + 8; // for sorting
3232
const int PLUGIN_REPOSITORY_ROLE = Qt::UserRole + 9; // for sorting
33+
const int PLUGIN_ISDEPRECATED_ROLE = Qt::UserRole + 10; // for styling
3334
const int SPACER_ROLE = Qt::UserRole + 20; // for sorting
3435

3536

0 commit comments

Comments
 (0)
Please sign in to comment.