forked from qt-creator/qt-creator
Make TODO plugin theme aware
Use the theme's colors by default and color the text rather than the background of items. Task-number: QTCREATORBUG-17532 Change-Id: I65a2d6da45ce7547b05463a2fb014f8230d0c336 Reviewed-by: Serhii Moroz <frost.asm@gmail.com> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -75,7 +75,7 @@ void OptionsDialog::addToKeywordsList(const Keyword &keyword)
|
||||
QListWidgetItem *item = new QListWidgetItem(
|
||||
icon(keyword.iconType), keyword.name);
|
||||
item->setData(Qt::UserRole, static_cast<int>(keyword.iconType));
|
||||
item->setBackgroundColor(keyword.color);
|
||||
item->setTextColor(keyword.color);
|
||||
ui->keywordsList->addItem(item);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void OptionsDialog::editKeyword(QListWidgetItem *item)
|
||||
Keyword keyword;
|
||||
keyword.name = item->text();
|
||||
keyword.iconType = static_cast<IconType>(item->data(Qt::UserRole).toInt());
|
||||
keyword.color = item->backgroundColor();
|
||||
keyword.color = item->textColor();
|
||||
|
||||
QSet<QString> keywordNamesButThis = keywordNames();
|
||||
keywordNamesButThis.remove(keyword.name);
|
||||
@@ -127,7 +127,7 @@ void OptionsDialog::editKeyword(QListWidgetItem *item)
|
||||
item->setIcon(icon(keyword.iconType));
|
||||
item->setText(keyword.name);
|
||||
item->setData(Qt::UserRole, static_cast<int>(keyword.iconType));
|
||||
item->setBackgroundColor(keyword.color);
|
||||
item->setTextColor(keyword.color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ Settings OptionsDialog::settingsFromUi()
|
||||
Keyword keyword;
|
||||
keyword.name = item->text();
|
||||
keyword.iconType = static_cast<IconType>(item->data(Qt::UserRole).toInt());
|
||||
keyword.color = item->backgroundColor();
|
||||
keyword.color = item->textColor();
|
||||
|
||||
settings.keywords << keyword;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user