X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;h=6b81c38f49648ac0ef9683d9a6de0e12803e3afc;hp=0fa57cd7cfadddbb88ecf8b65cceda6b3a1c05d4;hb=4a174a228d64ab906a0944f3de3dfe4324d058ff;hpb=43f0f050e5d91f86fc51c644f6343b45b4628a64 diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index 0fa57cd7..6b81c38f 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -20,7 +20,9 @@ #include "bufferviewfilter.h" -#include +#include +#include +#include #include "buffermodel.h" #include "client.h" @@ -105,6 +107,7 @@ void BufferViewFilter::configInitialized() { disconnect(config(), SIGNAL(initDone()), this, SLOT(configInitialized())); invalidate(); + emit configChanged(); } Qt::ItemFlags BufferViewFilter::flags(const QModelIndex &index) const { @@ -280,10 +283,21 @@ bool BufferViewFilter::networkLessThan(const QModelIndex &source_left, const QMo } QVariant BufferViewFilter::data(const QModelIndex &index, int role) const { - if(role == Qt::ForegroundRole) + switch(role) { + case Qt::ForegroundRole: return foreground(index); - else + case Qt::BackgroundRole: + if(index.data(NetworkModel::UserAwayRole).toBool()) { + QLinearGradient gradient(0, 0, 0, 18); + gradient.setColorAt(0.4, QApplication::palette().color(QPalette::Normal, QPalette::Base)); + gradient.setColorAt(0.5, QApplication::palette().color(QPalette::Disabled, QPalette::Base)); + gradient.setColorAt(0.6, QApplication::palette().color(QPalette::Normal, QPalette::Base)); + return QBrush(gradient); + } + // else: fallthrough to default + default: return QSortFilterProxyModel::data(index, role); + } } QVariant BufferViewFilter::foreground(const QModelIndex &index) const {