From c2e7e8254fe192d42c6e17025751d6cd36d883a8 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 9 Sep 2020 19:03:49 +1000 Subject: [PATCH] Qt: Use svgs for region icons --- src/duckstation-qt/duckstation-qt.vcxproj.filters | 8 +++++--- src/duckstation-qt/gamelistmodel.cpp | 7 +++---- src/duckstation-qt/gamelistmodel.h | 7 ++++--- src/duckstation-qt/gamelistwidget.cpp | 3 ++- src/duckstation-qt/resources/resources.qrc | 2 -- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/duckstation-qt/duckstation-qt.vcxproj.filters b/src/duckstation-qt/duckstation-qt.vcxproj.filters index 74a1763f0..69708755a 100644 --- a/src/duckstation-qt/duckstation-qt.vcxproj.filters +++ b/src/duckstation-qt/duckstation-qt.vcxproj.filters @@ -62,9 +62,6 @@ {4230e20b-2aff-4c86-966c-b620263a371d} - - - @@ -137,4 +134,9 @@ translations + + + resources + + \ No newline at end of file diff --git a/src/duckstation-qt/gamelistmodel.cpp b/src/duckstation-qt/gamelistmodel.cpp index 459794a7e..34c615698 100644 --- a/src/duckstation-qt/gamelistmodel.cpp +++ b/src/duckstation-qt/gamelistmodel.cpp @@ -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(GameListCompatibilityRating::Count); i++) m_compatibiliy_pixmaps[i].load(QStringLiteral(":/icons/star-%1.png").arg(i)); diff --git a/src/duckstation-qt/gamelistmodel.h b/src/duckstation-qt/gamelistmodel.h index edf04892e..365083a4b 100644 --- a/src/duckstation-qt/gamelistmodel.h +++ b/src/duckstation-qt/gamelistmodel.h @@ -2,6 +2,7 @@ #include "core/types.h" #include "frontend-common/game_list.h" #include +#include #include #include #include @@ -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(GameListCompatibilityRating::Count)> m_compatibiliy_pixmaps; }; \ No newline at end of file diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index 2f4325dcd..41f789cad 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -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) diff --git a/src/duckstation-qt/resources/resources.qrc b/src/duckstation-qt/resources/resources.qrc index 669f65fbe..ba533b5cd 100644 --- a/src/duckstation-qt/resources/resources.qrc +++ b/src/duckstation-qt/resources/resources.qrc @@ -9,11 +9,9 @@ icons/flag-uc.svg icons/flag-uc.png icons/flag-uc@2x.png - icons/star-0.png icons/star-1.png icons/star-2.png