messing about with icons

This commit is contained in:
Alister
2021-12-24 16:06:56 +00:00
parent d7675ea2d1
commit 27b1b11349
18 changed files with 43 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
media/project-icon-cata.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
media/res.aps Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -13,8 +13,15 @@
<qresource prefix="/"> <qresource prefix="/">
<file alias="icon">../media/noggit_icon.png</file> <file alias="icon">../media/noggit_icon.png</file>
<file alias="splash">../media/splash.png</file> <file alias="splash">../media/splash.png</file>
<file alias="wrath_logo">../media/WrathLogo.png</file> <file alias="icon-classic">../media/project-icon-classic.png</file>
<file alias="shadowlands_logo">../media/wow-sl.png</file> <file alias="icon-burning">../media/project-icon-burning.png</file>
<file alias="icon-wrath">../media/project-icon-wrath.png</file>
<file alias="icon-cata">../media/project-icon-cata.png</file>
<file alias="icon-panda">../media/project-icon-panda.png</file>
<file alias="icon-warlords">../media/project-icon-warlords.png</file>
<file alias="icon-legion">../media/project-icon-legion.png</file>
<file alias="icon-battle">../media/project-icon-battle.png</file>
<file alias="icon-shadow">../media/project-icon-shadow.png</file>
</qresource> </qresource>
<qresource prefix="/shader"> <qresource prefix="/shader">
<file alias="m2_vs">../src/glsl/m2_vert.glsl</file> <file alias="m2_vs">../src/glsl/m2_vert.glsl</file>

View File

@@ -31,6 +31,7 @@
#include <QSysInfo> #include <QSysInfo>
#include <QStandardPaths> #include <QStandardPaths>
#include <QDir> #include <QDir>
#include <QIcon>
#ifdef USE_MYSQL_UID_STORAGE #ifdef USE_MYSQL_UID_STORAGE
#include <mysql/mysql.h> #include <mysql/mysql.h>
@@ -352,15 +353,31 @@ namespace Noggit::Ui
e.mapID = record.RecordId; e.mapID = record.RecordId;
e.name = record.Columns["MapName_lang"].Value; e.name = record.Columns["MapName_lang"].Value;
e.areaType = std::stoi(record.Columns["InstanceType"].Value); e.areaType = std::stoi(record.Columns["InstanceType"].Value);
e.expansion = std::stoi(record.Columns["ExpansionID"].Value);
if (e.areaType < 0 || e.areaType > 5 || !World::IsEditableWorld(record)) if (e.areaType < 0 || e.areaType > 5 || !World::IsEditableWorld(record))
continue; continue;
auto item(new QListWidgetItem(QString::number(e.mapID) + " - " + QString::fromUtf8(e.name.c_str()), auto item(new QListWidgetItem(QString::number(e.mapID) + " - " + QString::fromUtf8(e.name.c_str()), type_to_table[e.areaType]));
type_to_table[e.areaType])); if (e.expansion == 0)
item->setIcon(QIcon(":/icon-classic"));
if (e.expansion == 1)
item->setIcon(QIcon(":/icon-burning"));
if (e.expansion == 2)
item->setIcon(QIcon(":/icon-wrath"));
if (e.expansion == 3)
item->setIcon(QIcon(":/icon-cata"));
if (e.expansion == 4)
item->setIcon(QIcon(":/icon-panda"));
if (e.expansion == 5)
item->setIcon(QIcon(":/icon-warlords"));
if (e.expansion == 6)
item->setIcon(QIcon(":/icon-legion"));
if (e.expansion == 7)
item->setIcon(QIcon(":/icon-battle"));
if (e.expansion == 8)
item->setIcon(QIcon(":/icon-shadow"));
item->setData(Qt::UserRole, QVariant(e.mapID)); item->setData(Qt::UserRole, QVariant(e.mapID));
} }
_project->ClientDatabase->UnloadTable(table); _project->ClientDatabase->UnloadTable(table);
} }

View File

@@ -69,6 +69,7 @@ namespace Noggit
int mapID; int mapID;
std::string name; std::string name;
int areaType; int areaType;
int expansion;
}; };
struct BookmarkEntry struct BookmarkEntry

View File

@@ -10,6 +10,10 @@ namespace Noggit::Ui::Component
auto stringList = QStringList(); auto stringList = QStringList();
for (const auto& dirEntry : std::filesystem::directory_iterator(projectDirectory)) for (const auto& dirEntry : std::filesystem::directory_iterator(projectDirectory))
{ {
//uto item(new QListWidgetItem(QString::number(e.mapID) + " - " + QString::fromUtf8(e.name.c_str()),type_to_table[e.areaType]));
//tem->setData(Qt::UserRole, QVariant(e.mapID));
stringList << QString::fromStdString(dirEntry.path().filename().generic_string()); stringList << QString::fromStdString(dirEntry.path().filename().generic_string());
} }

View File

@@ -75,7 +75,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QListView" name="listView"> <widget class="QListWidget" name="listView">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>

View File

@@ -22,6 +22,12 @@ namespace Noggit::Ui::Windows
auto applicationProjectsFolderPath = std::filesystem::path(applicationConfiguration->ApplicationProjectPath); auto applicationProjectsFolderPath = std::filesystem::path(applicationConfiguration->ApplicationProjectPath);
auto existingProjects = _existingProjectEnumerationComponent->EnumerateExistingProjects(applicationProjectsFolderPath); auto existingProjects = _existingProjectEnumerationComponent->EnumerateExistingProjects(applicationProjectsFolderPath);
for (const auto& dirEntry : std::filesystem::directory_iterator(applicationConfiguration->ApplicationProjectPath))
{
auto item = new QListWidgetItem(QString::fromStdString(dirEntry.path().filename().generic_string()), ui->listView);
item->setData(Qt::UserRole, QVariant());
}
_projectListModel = new QStringListModel(this); _projectListModel = new QStringListModel(this);
_projectListModel->setStringList(existingProjects); _projectListModel->setStringList(existingProjects);
@@ -69,7 +75,7 @@ namespace Noggit::Ui::Windows
} }
); );
ui->listView->setModel(_projectListModel); //ui->listView->setModel(_projectListModel);
} }
noggitRedProjectPage::~noggitRedProjectPage() noggitRedProjectPage::~noggitRedProjectPage()