mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Merge branch 'highlight_color' into 'master'
Highlight new items in launcher by text formatting, not by color See merge request OpenMW/openmw!3625
This commit is contained in:
commit
53f5e4dd3c
@ -301,12 +301,14 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
||||
auto row = ui.directoryListWidget->count() - 1;
|
||||
auto* item = ui.directoryListWidget->item(row);
|
||||
|
||||
// Display new content with green background
|
||||
// Display new content with custom formatting
|
||||
if (mNewDataDirs.contains(canonicalDirPath))
|
||||
{
|
||||
tooltip += "Will be added to the current profile\n";
|
||||
item->setBackground(Qt::green);
|
||||
item->setForeground(Qt::black);
|
||||
QFont font = item->font();
|
||||
font.setBold(true);
|
||||
font.setItalic(true);
|
||||
item->setFont(font);
|
||||
}
|
||||
|
||||
// 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);
|
||||
if (mKnownArchives.filter(name).isEmpty()) // XXX why contains doesn't work here ???
|
||||
{
|
||||
ui.archiveListWidget->item(row)->setBackground(Qt::green);
|
||||
ui.archiveListWidget->item(row)->setForeground(Qt::black);
|
||||
auto item = ui.archiveListWidget->item(row);
|
||||
QFont font = item->font();
|
||||
font.setBold(true);
|
||||
font.setItalic(true);
|
||||
item->setFont(font);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFont>
|
||||
|
||||
#include <components/esm/format.hpp>
|
||||
#include <components/esm3/esmreader.hpp>
|
||||
@ -164,20 +165,14 @@ QVariant ContentSelectorModel::ContentModel::data(const QModelIndex& index, int
|
||||
return isLoadOrderError(file) ? mWarningIcon : QVariant();
|
||||
}
|
||||
|
||||
case Qt::BackgroundRole:
|
||||
case Qt::FontRole:
|
||||
{
|
||||
if (isNew(file->fileName()))
|
||||
{
|
||||
return QVariant(QColor(Qt::green));
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
case Qt::ForegroundRole:
|
||||
{
|
||||
if (isNew(file->fileName()))
|
||||
{
|
||||
return QVariant(QColor(Qt::black));
|
||||
auto font = QFont();
|
||||
font.setBold(true);
|
||||
font.setItalic(true);
|
||||
return font;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>571</width>
|
||||
<width>573</width>
|
||||
<height>384</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -30,7 +30,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="dataNoteLabel">
|
||||
<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>
|
||||
</widget>
|
||||
</item>
|
||||
@ -57,7 +57,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<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>
|
||||
</widget>
|
||||
</item>
|
||||
@ -210,7 +210,7 @@
|
||||
<item row="27" column="0" colspan="2">
|
||||
<widget class="QLabel" name="archiveNoteLabel">
|
||||
<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>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user