-
-
-// ****************************************
-// NickViewDelgate
-// ****************************************
-NickViewDelegate::NickViewDelegate(QObject *parent)
- : QStyledItemDelegate(parent)
-{
- UiSettings s("QtUiStyle/Colors");
- _FgOnlineStatus = s.value("onlineStatusFG", QVariant(QColor(Qt::black))).value<QColor>();
- _FgAwayStatus = s.value("awayStatusFG", QVariant(QColor(Qt::gray))).value<QColor>();
-}
-
-void NickViewDelegate::initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const {
- QStyledItemDelegate::initStyleOption(option, index);
-
- if(!index.isValid())
- return;
-
- QColor fgColor = _FgOnlineStatus;
- if(!index.data(NetworkModel::ItemActiveRole).toBool())
- fgColor = _FgAwayStatus;
-
- option->palette.setColor(QPalette::Text, fgColor);
-}