diff options
| author | 2018-12-02 20:06:26 +0000 | |
|---|---|---|
| committer | 2019-01-16 21:40:14 +0100 | |
| commit | 2c9ba26432856b65883aa6dea98f73009f20bb3a (patch) | |
| tree | 0f3f2296cc285d3d68e0ba619c7f5bafd6154abd /src/modules | |
| parent | KviOptions.h: Add getMircColor (diff) | |
| download | KVIrc-2c9ba26432856b65883aa6dea98f73009f20bb3a.tar.gz KVIrc-2c9ba26432856b65883aa6dea98f73009f20bb3a.tar.bz2 KVIrc-2c9ba26432856b65883aa6dea98f73009f20bb3a.zip | |
Replace KVI_OPTION_MIRCCOLOR usage with getMircColor
- Replace occurrences in IRC-related views, and message type
references
- Don't replace occurrences dealing with the color picker or the
configurable low (0-15) colors
- Also replace hard-coded references to the maximum color
index (15/16) with KVI_EXTCOLOR_MAX
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/options/OptionsWidget_message.cpp | 16 | ||||
| -rw-r--r-- | src/modules/url/libkviurl.cpp | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/options/OptionsWidget_message.cpp b/src/modules/options/OptionsWidget_message.cpp index 47ff68796..2755bedfe 100644 --- a/src/modules/options/OptionsWidget_message.cpp +++ b/src/modules/options/OptionsWidget_message.cpp @@ -279,15 +279,15 @@ void MessageListWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewIt p->drawPixmap(pt, *(g_pIconManager->getSmallIcon(it->msgType()->pixId()))); pt.setX(pt.x() + 18); // draw the background - if(it->msgType()->back() < 16) + if(it->msgType()->back() <= KVI_EXTCOLOR_MAX) { - QColor bColor = KVI_OPTION_MIRCCOLOR(it->msgType()->back()); + QColor bColor = getMircColor(it->msgType()->back()); p->fillRect(pt.x(), pt.y(), opt.rect.width() - pt.x(), opt.rect.height(), bColor); } unsigned char ucFore = it->msgType()->fore(); - if(ucFore > 15) + if(ucFore > KVI_EXTCOLOR_MAX) ucFore = 0; - p->setPen(QPen(KVI_OPTION_MIRCCOLOR(ucFore))); + p->setPen(QPen(getMircColor(ucFore))); pt.setX(pt.x() + 2); p->drawText(pt.x(), pt.y(), opt.rect.width() - pt.x(), opt.rect.height(), Qt::AlignLeft | Qt::AlignVCenter, szText); @@ -312,14 +312,14 @@ MessageColorListWidgetItem::MessageColorListWidgetItem(KviTalListWidget * b, int { m_iClrIdx = idx; - if((idx < 0) || (idx > 15)) + if((idx < 0) || (idx > KVI_EXTCOLOR_MAX)) { setText(__tr2qs_ctx("Transparent", "options")); setBackground(listWidget()->isEnabled() ? Qt::transparent : Qt::gray); } else { - setBackground(QColor(KVI_OPTION_MIRCCOLOR(m_iClrIdx))); + setBackground(QColor(getMircColor(m_iClrIdx))); setText(" "); } } @@ -336,9 +336,9 @@ void MessageColorListWidgetItemDelegate::paint(QPainter * p, const QStyleOptionV const KviTalListWidget * lb = (const KviTalListWidget *)parent(); MessageColorListWidgetItem * it = static_cast<MessageColorListWidgetItem *>(index.internalPointer()); - if((it->clrIdx() >= 0) && (it->clrIdx() <= 15)) + if((it->clrIdx() >= 0) && (it->clrIdx() <= KVI_EXTCOLOR_MAX)) { - clr = KVI_OPTION_MIRCCOLOR(it->clrIdx()); + clr = getMircColor(it->clrIdx()); } else { diff --git a/src/modules/url/libkviurl.cpp b/src/modules/url/libkviurl.cpp index 81144088b..a10d5171c 100644 --- a/src/modules/url/libkviurl.cpp +++ b/src/modules/url/libkviurl.cpp @@ -288,10 +288,10 @@ void UrlDialog::addUrl(QString url, QString window, QString count, QString times UrlItem->setText(2, count); UrlItem->setText(3, timestamp); - UrlItem->setForeground(0, KVI_OPTION_MIRCCOLOR(KVI_OPTION_MSGTYPE(KVI_OUT_URL).fore())); - UrlItem->setForeground(1, KVI_OPTION_MIRCCOLOR(KVI_OPTION_MSGTYPE(KVI_OUT_NONE).fore())); - UrlItem->setForeground(2, KVI_OPTION_MIRCCOLOR(KVI_OPTION_MSGTYPE(KVI_OUT_NONE).fore())); - UrlItem->setForeground(3, KVI_OPTION_MIRCCOLOR(KVI_OPTION_MSGTYPE(KVI_OUT_NONE).fore())); + UrlItem->setForeground(0, getMircColor(KVI_OPTION_MSGTYPE(KVI_OUT_URL).fore())); + UrlItem->setForeground(1, getMircColor(KVI_OPTION_MSGTYPE(KVI_OUT_NONE).fore())); + UrlItem->setForeground(2, getMircColor(KVI_OPTION_MSGTYPE(KVI_OUT_NONE).fore())); + UrlItem->setForeground(3, getMircColor(KVI_OPTION_MSGTYPE(KVI_OUT_NONE).fore())); m_pUrlList->resizeColumnToContents(0); m_pUrlList->resizeColumnToContents(3); |
