-void BufferViewDelegate::initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const {
- QStyledItemDelegate::initStyleOption(option, index);
-
- BufferInfo::ActivityLevel activity = (BufferInfo::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
-
- QColor fgColor = _FgColorNoActivity;
- if(activity & BufferInfo::Highlight) {
- fgColor = _FgColorHighlightActivity;
- } else if(activity & BufferInfo::NewMessage) {
- fgColor = _FgColorNewMessageActivity;
- } else if(activity & BufferInfo::OtherActivity) {
- fgColor = _FgColorOtherActivity;
- } else if(!index.data(NetworkModel::ItemActiveRole).toBool() || index.data(NetworkModel::UserAwayRole).toBool()) {
- fgColor = _FgColorInactiveActivity;
- }
-
- option->palette.setColor(QPalette::Text, fgColor);
-}
-
-