mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-07 00:15:34 +00:00
Use icon to show files with problem (Fixes #2268)
Launcher now indicates files with problem using an icon. Using red text for files with load order issue removed because it doesn't work well with dark themes.
This commit is contained in:
parent
458b82c308
commit
e95b513cfc
1 changed files with 5 additions and 9 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
#include "components/esm/esmreader.hpp"
|
#include "components/esm/esmreader.hpp"
|
||||||
|
|
||||||
|
@ -177,14 +178,9 @@ QVariant ContentSelectorModel::ContentModel::data(const QModelIndex &index, int
|
||||||
|
|
||||||
switch (role)
|
switch (role)
|
||||||
{
|
{
|
||||||
case Qt::ForegroundRole:
|
case Qt::DecorationRole:
|
||||||
{
|
{
|
||||||
if (isLoadOrderError(file))
|
return isLoadOrderError(file) ? QIcon::fromTheme("edit-delete") : QVariant();
|
||||||
{
|
|
||||||
QBrush redBackground(Qt::red, Qt::SolidPattern);
|
|
||||||
return redBackground;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case Qt::EditRole:
|
case Qt::EditRole:
|
||||||
|
@ -618,7 +614,7 @@ QString ContentSelectorModel::ContentModel::toolTip(const EsmFile *file) const
|
||||||
{
|
{
|
||||||
if (isLoadOrderError(file))
|
if (isLoadOrderError(file))
|
||||||
{
|
{
|
||||||
QString text("<font color=#840000><b>");
|
QString text("<b>");
|
||||||
int index = indexFromItem(item(file->filePath())).row();
|
int index = indexFromItem(item(file->filePath())).row();
|
||||||
foreach(const LoadOrderError& error, checkForLoadOrderErrors(file, index))
|
foreach(const LoadOrderError& error, checkForLoadOrderErrors(file, index))
|
||||||
{
|
{
|
||||||
|
@ -626,7 +622,7 @@ QString ContentSelectorModel::ContentModel::toolTip(const EsmFile *file) const
|
||||||
text += error.toolTip();
|
text += error.toolTip();
|
||||||
text += "</p>";
|
text += "</p>";
|
||||||
}
|
}
|
||||||
text += ("</b></font>");
|
text += ("</b>");
|
||||||
text += file->toolTip();
|
text += file->toolTip();
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue