mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 10:45:33 +00:00
Highlight new items in launcher by text formatting, not by color
This commit is contained in:
parent
b280f1b1d0
commit
5e96825e6b
3 changed files with 20 additions and 20 deletions
|
@ -301,12 +301,14 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
||||||
auto row = ui.directoryListWidget->count() - 1;
|
auto row = ui.directoryListWidget->count() - 1;
|
||||||
auto* item = ui.directoryListWidget->item(row);
|
auto* item = ui.directoryListWidget->item(row);
|
||||||
|
|
||||||
// Display new content with green background
|
// Display new content with custom formatting
|
||||||
if (mNewDataDirs.contains(canonicalDirPath))
|
if (mNewDataDirs.contains(canonicalDirPath))
|
||||||
{
|
{
|
||||||
tooltip += "Will be added to the current profile\n";
|
tooltip += "Will be added to the current profile\n";
|
||||||
item->setBackground(Qt::green);
|
QFont font = item->font();
|
||||||
item->setForeground(Qt::black);
|
font.setBold(true);
|
||||||
|
font.setItalic(true);
|
||||||
|
item->setFont(font);
|
||||||
}
|
}
|
||||||
|
|
||||||
// deactivate data-local and global data directory: they are always included
|
// deactivate data-local and global data directory: they are always included
|
||||||
|
@ -737,8 +739,11 @@ void Launcher::DataFilesPage::addArchive(const QString& name, Qt::CheckState sel
|
||||||
ui.archiveListWidget->item(row)->setCheckState(selected);
|
ui.archiveListWidget->item(row)->setCheckState(selected);
|
||||||
if (mKnownArchives.filter(name).isEmpty()) // XXX why contains doesn't work here ???
|
if (mKnownArchives.filter(name).isEmpty()) // XXX why contains doesn't work here ???
|
||||||
{
|
{
|
||||||
ui.archiveListWidget->item(row)->setBackground(Qt::green);
|
auto item = ui.archiveListWidget->item(row);
|
||||||
ui.archiveListWidget->item(row)->setForeground(Qt::black);
|
QFont font = item->font();
|
||||||
|
font.setBold(true);
|
||||||
|
font.setItalic(true);
|
||||||
|
item->setFont(font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
#include <components/esm/format.hpp>
|
#include <components/esm/format.hpp>
|
||||||
#include <components/esm3/esmreader.hpp>
|
#include <components/esm3/esmreader.hpp>
|
||||||
|
@ -164,20 +165,14 @@ QVariant ContentSelectorModel::ContentModel::data(const QModelIndex& index, int
|
||||||
return isLoadOrderError(file) ? mWarningIcon : QVariant();
|
return isLoadOrderError(file) ? mWarningIcon : QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
case Qt::BackgroundRole:
|
case Qt::FontRole:
|
||||||
{
|
{
|
||||||
if (isNew(file->fileName()))
|
if (isNew(file->fileName()))
|
||||||
{
|
{
|
||||||
return QVariant(QColor(Qt::green));
|
auto font = QFont();
|
||||||
}
|
font.setBold(true);
|
||||||
return QVariant();
|
font.setItalic(true);
|
||||||
}
|
return font;
|
||||||
|
|
||||||
case Qt::ForegroundRole:
|
|
||||||
{
|
|
||||||
if (isNew(file->fileName()))
|
|
||||||
{
|
|
||||||
return QVariant(QColor(Qt::black));
|
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>571</width>
|
<width>573</width>
|
||||||
<height>384</height>
|
<height>384</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="dataNoteLabel">
|
<widget class="QLabel" name="dataNoteLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-style:italic;">note: content files that are not part of current Content List are </span><span style=" font-style:italic; background-color:#00ff00;">highlighted</span></p></body></html></string>
|
<string><html><head/><body><p>note: content files that are not part of current Content List are <span style=" font-style:italic;font-weight: bold">highlighted</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-style:italic;">note: directories that are not part of current Content List are </span><span style=" font-style:italic; background-color:#00ff00;">highlighted</span></p></body></html></string>
|
<string><html><head/><body><p>note: directories that are not part of current Content List are <span style=" font-style:italic;font-weight: bold">highlighted</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -210,7 +210,7 @@
|
||||||
<item row="27" column="0" colspan="2">
|
<item row="27" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="archiveNoteLabel">
|
<widget class="QLabel" name="archiveNoteLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-style:italic;">note: archives that are not part of current Content List are </span><span style=" font-style:italic; background-color:#00ff00;">highlighted</span></p></body></html></string>
|
<string><html><head/><body><p>note: archives that are not part of current Content List are <span style=" font-style:italic;font-weight: bold">highlighted</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue