UI: Massive revamp, new features and improvements
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
#pragma once
|
||||
#include "common/heterogeneous_containers.h"
|
||||
#include "common/lru_cache.h"
|
||||
#include "core/game_database.h"
|
||||
#include "core/types.h"
|
||||
#include "frontend-common/game_list.h"
|
||||
#include <QtCore/QAbstractTableModel>
|
||||
@@ -6,7 +9,6 @@
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
|
||||
class GameListModel final : public QAbstractTableModel
|
||||
{
|
||||
@@ -16,7 +18,7 @@ public:
|
||||
enum Column : int
|
||||
{
|
||||
Column_Type,
|
||||
Column_Code,
|
||||
Column_Serial,
|
||||
Column_Title,
|
||||
Column_FileTitle,
|
||||
Column_Developer,
|
||||
@@ -35,7 +37,7 @@ public:
|
||||
static std::optional<Column> getColumnIdForName(std::string_view name);
|
||||
static const char* getColumnName(Column col);
|
||||
|
||||
GameListModel(GameList* game_list, QObject* parent = nullptr);
|
||||
GameListModel(QObject* parent = nullptr);
|
||||
~GameListModel();
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
@@ -60,28 +62,24 @@ public:
|
||||
int getCoverArtHeight() const;
|
||||
int getCoverArtSpacing() const;
|
||||
void refreshCovers();
|
||||
void updateCacheSize(int width, int height);
|
||||
|
||||
private:
|
||||
void loadCommonImages();
|
||||
void setColumnDisplayNames();
|
||||
void loadOrGenerateCover(const GameList::Entry* ge);
|
||||
void invalidateCoverForPath(const std::string& path);
|
||||
|
||||
GameList* m_game_list;
|
||||
float m_cover_scale = 1.0f;
|
||||
float m_cover_scale = 0.0f;
|
||||
bool m_show_titles_for_covers = false;
|
||||
|
||||
std::array<QString, Column_Count> m_column_display_names;
|
||||
std::array<QPixmap, static_cast<int>(GameList::EntryType::Count)> m_type_pixmaps;
|
||||
std::array<QPixmap, static_cast<int>(DiscRegion::Count)> m_region_pixmaps;
|
||||
std::array<QPixmap, static_cast<int>(GameDatabase::CompatibilityRating::Count)> m_compatibility_pixmaps;
|
||||
|
||||
QPixmap m_type_disc_pixmap;
|
||||
QPixmap m_type_disc_with_settings_pixmap;
|
||||
QPixmap m_type_exe_pixmap;
|
||||
QPixmap m_type_playlist_pixmap;
|
||||
QPixmap m_type_psf_pixmap;
|
||||
QPixmap m_placeholder_pixmap;
|
||||
QPixmap m_loading_pixmap;
|
||||
|
||||
QPixmap m_region_jp_pixmap;
|
||||
QPixmap m_region_eu_pixmap;
|
||||
QPixmap m_region_us_pixmap;
|
||||
QPixmap m_region_other_pixmap;
|
||||
|
||||
std::array<QPixmap, static_cast<int>(GameListCompatibilityRating::Count)> m_compatibiliy_pixmaps;
|
||||
mutable std::unordered_map<std::string, QPixmap> m_cover_pixmap_cache;
|
||||
mutable LRUCache<std::string, QPixmap> m_cover_pixmap_cache;
|
||||
};
|
||||
Reference in New Issue
Block a user