mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-02 11:26:31 -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("\n",QChar(QChar::LineSeparator));
|
||||||
plainText = plainText.replace("\r",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);
|
QTextLayout textLayout(plainText, option.font);
|
||||||
QTextOption to = textLayout.textOption();
|
QTextOption to = textLayout.textOption();
|
||||||
to.setAlignment(option.displayAlignment);
|
to.setAlignment(option.displayAlignment);
|
||||||
|
@ -647,20 +647,20 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h
|
|||||||
|
|
||||||
if (!IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
|
if (!IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
|
||||||
qf.setBold(false);
|
qf.setBold(false);
|
||||||
item->setTextColor(i, textColorNotSubscribed());
|
item->setForeground(i, textColorNotSubscribed());
|
||||||
} else if (unread || isNew) {
|
} else if (unread || isNew) {
|
||||||
qf.setBold(true);
|
qf.setBold(true);
|
||||||
item->setTextColor(i, textColorUnread());
|
item->setForeground(i, textColorUnread());
|
||||||
} else if (myUnreadChilddren) {
|
} else if (myUnreadChilddren) {
|
||||||
qf.setBold(true);
|
qf.setBold(true);
|
||||||
item->setTextColor(i, textColorUnreadChildren());
|
item->setForeground(i, textColorUnreadChildren());
|
||||||
} else {
|
} else {
|
||||||
qf.setBold(false);
|
qf.setBold(false);
|
||||||
item->setTextColor(i, textColorRead());
|
item->setForeground(i, textColorRead());
|
||||||
}
|
}
|
||||||
if (missing) {
|
if (missing) {
|
||||||
/* Missing message */
|
/* Missing message */
|
||||||
item->setTextColor(i, textColorMissing());
|
item->setForeground(i, textColorMissing());
|
||||||
}
|
}
|
||||||
item->setFont(i, qf);
|
item->setFont(i, qf);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user