Commit 33201317 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Update default color when we change color scheme

parent b6d7b449
......@@ -61,10 +61,7 @@ class CollectionStatisticsDelegatePrivate
drawUnreadAfterFolder( false ),
animator( 0 )
{
mSelectedUnreadColor = KColorScheme( QPalette::Active, KColorScheme::Selection )
.foreground( KColorScheme::LinkText ).color();
mDeselectedUnreadColor = KColorScheme( QPalette::Active, KColorScheme::View )
.foreground( KColorScheme::LinkText ).color();
updateColor();
}
void getCountRecursive( const QModelIndex &index, qint64 &totalCount, qint64 &unreadCount, qint64 &totalSize ) const
......@@ -86,6 +83,14 @@ class CollectionStatisticsDelegatePrivate
}
}
}
void updateColor()
{
mSelectedUnreadColor = KColorScheme( QPalette::Active, KColorScheme::Selection )
.foreground( KColorScheme::LinkText ).color();
mDeselectedUnreadColor = KColorScheme( QPalette::Active, KColorScheme::View )
.foreground( KColorScheme::LinkText ).color();
}
};
}
......@@ -340,4 +345,10 @@ void CollectionStatisticsDelegate::paint( QPainter *painter,
painter->drawText( textRect, option4.displayAlignment | Qt::AlignVCenter, text );
}
void CollectionStatisticsDelegate::updatePalette()
{
Q_D( CollectionStatisticsDelegate );
d->updateColor();
}
#include "collectionstatisticsdelegate.moc"
......@@ -88,6 +88,11 @@ class AKONADI_EXPORT CollectionStatisticsDelegate : public QStyledItemDelegate
*/
~CollectionStatisticsDelegate();
/**
* @since 4.9.1
*/
void updatePalette();
public Q_SLOTS:
/**
* Sets whether the unread count is drawn next to the folder name.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment