mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
AdBlockTreeWidget: Fix restoring item font and color for normal rules
This commit is contained in:
parent
7463c692f7
commit
8c99f22240
|
@ -192,14 +192,14 @@ void AdBlockTreeWidget::subscriptionError(const QString &message)
|
||||||
void AdBlockTreeWidget::adjustItemFeatures(QTreeWidgetItem* item, const AdBlockRule* rule)
|
void AdBlockTreeWidget::adjustItemFeatures(QTreeWidgetItem* item, const AdBlockRule* rule)
|
||||||
{
|
{
|
||||||
if (!rule->isEnabled()) {
|
if (!rule->isEnabled()) {
|
||||||
QFont font;
|
|
||||||
font.setItalic(true);
|
|
||||||
item->setForeground(0, QColor(Qt::gray));
|
item->setForeground(0, QColor(Qt::gray));
|
||||||
|
|
||||||
if (!rule->isComment()) {
|
if (!rule->isComment()) {
|
||||||
|
QFont f = font();
|
||||||
|
f.setItalic(true);
|
||||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||||
item->setCheckState(0, Qt::Unchecked);
|
item->setCheckState(0, Qt::Unchecked);
|
||||||
item->setFont(0, font);
|
item->setFont(0, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -207,6 +207,8 @@ void AdBlockTreeWidget::adjustItemFeatures(QTreeWidgetItem* item, const AdBlockR
|
||||||
|
|
||||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||||
item->setCheckState(0, Qt::Checked);
|
item->setCheckState(0, Qt::Checked);
|
||||||
|
item->setForeground(0, palette().foreground());
|
||||||
|
item->setFont(0, font());
|
||||||
|
|
||||||
if (rule->isException()) {
|
if (rule->isException()) {
|
||||||
item->setForeground(0, QColor(Qt::darkGreen));
|
item->setForeground(0, QColor(Qt::darkGreen));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user