Qt: Use svgs for region icons

This commit is contained in:
Connor McLaughlin 2020-09-09 19:03:49 +10:00
parent 9c4e935de9
commit c2e7e8254f
5 changed files with 14 additions and 13 deletions

View File

@ -62,9 +62,6 @@
<UniqueIdentifier>{4230e20b-2aff-4c86-966c-b620263a371d}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<QtResource Include="resources\resources.qrc" />
</ItemGroup>
<ItemGroup>
<QtMoc Include="consolesettingswidget.h" />
<QtMoc Include="gamelistsettingswidget.h" />
@ -137,4 +134,9 @@
<Filter>translations</Filter>
</None>
</ItemGroup>
<ItemGroup>
<QtResource Include="resources\resources.qrc">
<Filter>resources</Filter>
</QtResource>
</ItemGroup>
</Project>

View File

@ -280,10 +280,9 @@ void GameListModel::loadCommonImages()
m_type_disc_pixmap.load(QStringLiteral(":/icons/media-optical-24.png"));
m_type_exe_pixmap.load(QStringLiteral(":/icons/applications-system-24.png"));
m_type_playlist_pixmap.load(QStringLiteral(":/icons/address-book-new-22.png"));
m_region_eu_pixmap.load(QStringLiteral(":/icons/flag-eu.png"));
m_region_jp_pixmap.load(QStringLiteral(":/icons/flag-jp.png"));
m_region_us_pixmap.load(QStringLiteral(":/icons/flag-uc.png"));
m_region_eu_pixmap.load(QStringLiteral(":/icons/flag-eu.png"));
m_region_eu_pixmap.addFile(QStringLiteral(":/icons/flag-eu.svg"));
m_region_jp_pixmap.addFile(QStringLiteral(":/icons/flag-jp.svg"));
m_region_us_pixmap.addFile(QStringLiteral(":/icons/flag-uc.svg"));
for (int i = 0; i < static_cast<int>(GameListCompatibilityRating::Count); i++)
m_compatibiliy_pixmaps[i].load(QStringLiteral(":/icons/star-%1.png").arg(i));

View File

@ -2,6 +2,7 @@
#include "core/types.h"
#include "frontend-common/game_list.h"
#include <QtCore/QAbstractTableModel>
#include <QtGui/QIcon>
#include <QtGui/QPixmap>
#include <array>
#include <optional>
@ -55,9 +56,9 @@ private:
QPixmap m_type_exe_pixmap;
QPixmap m_type_playlist_pixmap;
QPixmap m_region_jp_pixmap;
QPixmap m_region_eu_pixmap;
QPixmap m_region_us_pixmap;
QIcon m_region_jp_pixmap;
QIcon m_region_eu_pixmap;
QIcon m_region_us_pixmap;
std::array<QPixmap, static_cast<int>(GameListCompatibilityRating::Count)> m_compatibiliy_pixmaps;
};

View File

@ -47,6 +47,7 @@ void GameListWidget::initialize(QtHostInterface* host_interface)
m_table_sort_model->setSourceModel(m_table_model);
m_table_view = new QTableView(this);
m_table_view->setModel(m_table_sort_model);
m_table_view->setIconSize(QSize(32, 32));
m_table_view->setSortingEnabled(true);
m_table_view->setSelectionMode(QAbstractItemView::SingleSelection);
m_table_view->setSelectionBehavior(QAbstractItemView::SelectRows);
@ -147,7 +148,7 @@ void GameListWidget::resizeEvent(QResizeEvent* event)
void GameListWidget::resizeTableViewColumnsToFit()
{
QtUtils::ResizeColumnsForTableView(m_table_view, {32, 80, -1, -1, 100, 60, 100});
QtUtils::ResizeColumnsForTableView(m_table_view, {32, 80, -1, -1, 100, 45, 100});
}
static TinyString getColumnVisibilitySettingsKeyName(int column)

View File

@ -9,11 +9,9 @@
<file>icons/flag-uc.svg</file>
<file>icons/flag-uc.png</file>
<file>icons/flag-uc@2x.png</file>
<!--
<file>icons/flag-us.svg</file>
<file>icons/flag-us.png</file>
<file>icons/flag-us@2x.png</file>
-->
<file>icons/star-0.png</file>
<file>icons/star-1.png</file>
<file>icons/star-2.png</file>