mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-30 09:56:14 -05:00
Merge pull request #596 from PhenomRetroShare/Fix_RSElidedItemDelegateTextColor
Fix RSElidedItemDelegate text color.
This commit is contained in:
commit
f2898dacdb
@ -69,7 +69,16 @@ void RSElidedItemDelegate::drawDisplay(QPainter *painter, const QStyleOptionView
|
||||
plainText = plainText.replace("\n",QChar(QChar::LineSeparator));
|
||||
plainText = plainText.replace("\r",QChar(QChar::LineSeparator));
|
||||
|
||||
if (painter) painter->setFont(option.font);
|
||||
if (painter) {
|
||||
painter->setFont(option.font);
|
||||
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
|
||||
? QPalette::Normal : QPalette::Disabled;
|
||||
if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
|
||||
cg = QPalette::Inactive;
|
||||
QColor textColor = option.palette.color(cg, QPalette::Text);
|
||||
painter->setPen(textColor);
|
||||
}
|
||||
|
||||
QTextLayout textLayout(plainText, option.font);
|
||||
QTextOption to = textLayout.textOption();
|
||||
to.setAlignment(option.displayAlignment);
|
||||
|
@ -647,20 +647,20 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h
|
||||
|
||||
if (!IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
|
||||
qf.setBold(false);
|
||||
item->setTextColor(i, textColorNotSubscribed());
|
||||
item->setForeground(i, textColorNotSubscribed());
|
||||
} else if (unread || isNew) {
|
||||
qf.setBold(true);
|
||||
item->setTextColor(i, textColorUnread());
|
||||
item->setForeground(i, textColorUnread());
|
||||
} else if (myUnreadChilddren) {
|
||||
qf.setBold(true);
|
||||
item->setTextColor(i, textColorUnreadChildren());
|
||||
item->setForeground(i, textColorUnreadChildren());
|
||||
} else {
|
||||
qf.setBold(false);
|
||||
item->setTextColor(i, textColorRead());
|
||||
item->setForeground(i, textColorRead());
|
||||
}
|
||||
if (missing) {
|
||||
/* Missing message */
|
||||
item->setTextColor(i, textColorMissing());
|
||||
item->setForeground(i, textColorMissing());
|
||||
}
|
||||
item->setFont(i, qf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user