Qt: Add hidpi icons

This commit is contained in:
Connor McLaughlin 2020-09-10 20:47:59 +10:00
parent 9b942de47e
commit 14778b5d24
56 changed files with 86 additions and 49 deletions

View file

@ -1,6 +1,7 @@
#include "gamelistmodel.h"
#include "common/string_util.h"
#include "core/system.h"
#include <QtGui/QIcon>
static constexpr std::array<const char*, GameListModel::Column_Count> s_column_names = {
{"Type", "Code", "Title", "File Title", "Size", "Region", "Compatibility"}};
@ -277,12 +278,12 @@ bool GameListModel::lessThan(const QModelIndex& left_index, const QModelIndex& r
void GameListModel::loadCommonImages()
{
// TODO: Use svg instead of png
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.addFile(QStringLiteral(":/icons/flag-eu.png"));
m_region_jp_pixmap.addFile(QStringLiteral(":/icons/flag-jp.png"));
m_region_us_pixmap.addFile(QStringLiteral(":/icons/flag-uc.png"));
m_type_disc_pixmap = QIcon(QStringLiteral(":/icons/media-optical-24.png")).pixmap(QSize(24, 24));
m_type_exe_pixmap = QIcon(QStringLiteral(":/icons/applications-system-24.png")).pixmap(QSize(24, 24));
m_type_playlist_pixmap = QIcon(QStringLiteral(":/icons/address-book-new-22.png")).pixmap(QSize(22, 22));
m_region_eu_pixmap = QIcon(QStringLiteral(":/icons/flag-eu.png")).pixmap(QSize(42, 30));
m_region_jp_pixmap = QIcon(QStringLiteral(":/icons/flag-jp.png")).pixmap(QSize(42, 30));
m_region_us_pixmap = QIcon(QStringLiteral(":/icons/flag-uc.png")).pixmap(QSize(42, 30));
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,7 +2,6 @@
#include "core/types.h"
#include "frontend-common/game_list.h"
#include <QtCore/QAbstractTableModel>
#include <QtGui/QIcon>
#include <QtGui/QPixmap>
#include <array>
#include <optional>
@ -56,9 +55,9 @@ private:
QPixmap m_type_exe_pixmap;
QPixmap m_type_playlist_pixmap;
QIcon m_region_jp_pixmap;
QIcon m_region_eu_pixmap;
QIcon m_region_us_pixmap;
QPixmap m_region_jp_pixmap;
QPixmap m_region_eu_pixmap;
QPixmap m_region_us_pixmap;
std::array<QPixmap, static_cast<int>(GameListCompatibilityRating::Count)> m_compatibiliy_pixmaps;
};

View file

@ -47,7 +47,6 @@ 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);
@ -148,7 +147,7 @@ void GameListWidget::resizeEvent(QResizeEvent* event)
void GameListWidget::resizeTableViewColumnsToFit()
{
QtUtils::ResizeColumnsForTableView(m_table_view, {32, 80, -1, -1, 100, 45, 100});
QtUtils::ResizeColumnsForTableView(m_table_view, {32, 80, -1, -1, 100, 50, 100});
}
static TinyString getColumnVisibilitySettingsKeyName(int column)

View file

@ -61,7 +61,7 @@
</property>
<property name="icon">
<iconset resource="resources/icons.qrc">
<normaloff>:/icons/actions-tools-wizard.png</normaloff>:/icons/actions-tools-wizard.png</iconset>
<normaloff>:/icons/conical-flask-red.png</normaloff>:/icons/conical-flask-red.png</iconset>
</property>
</widget>
<widget class="QMenu" name="menuLoadState">
@ -400,7 +400,7 @@
<action name="actionCheats">
<property name="icon">
<iconset resource="resources/icons.qrc">
<normaloff>:/icons/actions-tools-wizard-32.png</normaloff>:/icons/actions-tools-wizard-32.png</iconset>
<normaloff>:/icons/conical-flask-red.png</normaloff>:/icons/conical-flask-red.png</iconset>
</property>
<property name="text">
<string>Cheats...</string>
@ -454,7 +454,7 @@
<action name="actionSettings">
<property name="icon">
<iconset resource="resources/icons.qrc">
<normaloff>:/icons/applications-system.png</normaloff>:/icons/applications-system.png</iconset>
<normaloff>:/icons/preferences-system.png</normaloff>:/icons/preferences-system.png</iconset>
</property>
<property name="text">
<string>&amp;Settings...</string>
@ -565,7 +565,7 @@
<action name="actionScreenshot">
<property name="icon">
<iconset resource="resources/icons.qrc">
<normaloff>:/icons/video-display.png</normaloff>:/icons/video-display.png</iconset>
<normaloff>:/icons/camera-photo.png</normaloff>:/icons/camera-photo.png</iconset>
</property>
<property name="text">
<string>&amp;Screenshot</string>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -1,56 +1,94 @@
<RCC>
<qresource>
<file>icons/flag-eu.svg</file>
<file>icons/address-book-new-22.png</file>
<file>icons/address-book-new-22@2x.png</file>
<file>icons/antialias-icon.png</file>
<file>icons/antialias-icon@2x.png</file>
<file>icons/applications-development.png</file>
<file>icons/applications-development@2x.png</file>
<file>icons/applications-internet.png</file>
<file>icons/applications-other.png</file>
<file>icons/applications-other@2x.png</file>
<file>icons/applications-system.png</file>
<file>icons/applications-system@2x.png</file>
<file>icons/applications-system-24.png</file>
<file>icons/applications-system-24@2x.png</file>
<file>icons/audio-card.png</file>
<file>icons/audio-card@2x.png</file>
<file>icons/camera-photo.png</file>
<file>icons/camera-photo@2x.png</file>
<file>icons/camera-video.png</file>
<file>icons/camera-video@2x.png</file>
<file>icons/conical-flask-red.png</file>
<file>icons/conical-flask-red@2x.png</file>
<file>icons/document-open.png</file>
<file>icons/document-open@2x.png</file>
<file>icons/document-save.png</file>
<file>icons/document-save@2x.png</file>
<file>icons/drive-optical.png</file>
<file>icons/drive-optical@2x.png</file>
<file>icons/drive-removable-media.png</file>
<file>icons/drive-removable-media@2x.png</file>
<file>icons/duck.png</file>
<file>icons/duck_128.png</file>
<file>icons/duck_64.png</file>
<file>icons/edit-find.png</file>
<file>icons/flag-eu.png</file>
<file>icons/flag-eu@2x.png</file>
<file>icons/flag-jp.svg</file>
<file>icons/flag-jp.png</file>
<file>icons/flag-jp@2x.png</file>
<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/folder-open.png</file>
<file>icons/folder-open@2x.png</file>
<file>icons/input-gaming.png</file>
<file>icons/input-gaming@2x.png</file>
<file>icons/list-add.png</file>
<file>icons/list-add@2x.png</file>
<file>icons/list-remove.png</file>
<file>icons/list-remove@2x.png</file>
<file>icons/media-flash.png</file>
<file>icons/media-flash@2x.png</file>
<file>icons/media-flash-24.png</file>
<file>icons/media-flash-24@2x.png</file>
<file>icons/media-optical.png</file>
<file>icons/media-optical@2x.png</file>
<file>icons/media-optical-24.png</file>
<file>icons/media-optical-24@2x.png</file>
<file>icons/media-playback-pause.png</file>
<file>icons/media-playback-pause@2x.png</file>
<file>icons/media-playback-start.png</file>
<file>icons/media-playback-start@2x.png</file>
<file>icons/media-record.png</file>
<file>icons/media-record@2x.png</file>
<file>icons/preferences-desktop-keyboard-shortcuts.png</file>
<file>icons/preferences-desktop-keyboard-shortcuts@2x.png</file>
<file>icons/preferences-system.png</file>
<file>icons/preferences-system@2x.png</file>
<file>icons/software-update-available.png</file>
<file>icons/software-update-available@2x.png</file>
<file>icons/star-0.png</file>
<file>icons/star-1.png</file>
<file>icons/star-2.png</file>
<file>icons/star-3.png</file>
<file>icons/star-4.png</file>
<file>icons/star-5.png</file>
<file>icons/address-book-new-22.png</file>
<file>icons/actions-tools-wizard.png</file>
<file>icons/actions-tools-wizard@2x.png</file>
<file>icons/actions-tools-wizard-32.png</file>
<file>icons/actions-tools-wizard-32@2x.png</file>
<file>icons/applications-internet.png</file>
<file>icons/system-file-manager.png</file>
<file>icons/system-file-manager@2x.png</file>
<file>icons/system-search.png</file>
<file>icons/list-add.png</file>
<file>icons/list-remove.png</file>
<file>icons/duck.png</file>
<file>icons/edit-find.png</file>
<file>icons/folder-open.png</file>
<file>icons/applications-development.png</file>
<file>icons/applications-other.png</file>
<file>icons/applications-system.png</file>
<file>icons/applications-system-24.png</file>
<file>icons/audio-card.png</file>
<file>icons/document-open.png</file>
<file>icons/document-save.png</file>
<file>icons/drive-optical.png</file>
<file>icons/drive-removable-media.png</file>
<file>icons/input-gaming.png</file>
<file>icons/media-flash.png</file>
<file>icons/media-flash-24.png</file>
<file>icons/media-optical.png</file>
<file>icons/media-optical-24.png</file>
<file>icons/media-playback-pause.png</file>
<file>icons/media-playback-start.png</file>
<file>icons/system-search@2x.png</file>
<file>icons/system-shutdown.png</file>
<file>icons/system-shutdown@2x.png</file>
<file>icons/utilities-system-monitor.png</file>
<file>icons/utilities-system-monitor@2x.png</file>
<file>icons/video-display.png</file>
<file>icons/video-display@2x.png</file>
<file>icons/view-fullscreen.png</file>
<file>icons/view-fullscreen@2x.png</file>
<file>icons/view-refresh.png</file>
<file>icons/view-refresh@2x.png</file>
</qresource>
<qresource>

View file

@ -82,7 +82,7 @@
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/folder-open.png</normaloff>:/icons/folder-open.png</iconset>
<normaloff>:/icons/system-file-manager.png</normaloff>:/icons/system-file-manager.png</iconset>
</property>
</item>
<item>
@ -91,7 +91,7 @@
</property>
<property name="icon">
<iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-other.png</normaloff>:/icons/applications-other.png</iconset>
<normaloff>:/icons/preferences-desktop-keyboard-shortcuts.png</normaloff>:/icons/preferences-desktop-keyboard-shortcuts.png</iconset>
</property>
</item>
<item>