mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
DolphinQt: cache icons instead of single pixmaps
Fixes dynamically changing dpi scaling. Load resources from svg if possible. Currently svg support is not in Qt build in Externals, and image files need to be added later.
This commit is contained in:
@ -3,8 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QIcon>
|
||||
#include <QList>
|
||||
#include <QPixmap>
|
||||
#include <string_view>
|
||||
|
||||
namespace DiscIO
|
||||
@ -20,29 +20,26 @@ public:
|
||||
enum class MiscID
|
||||
{
|
||||
BannerMissing,
|
||||
LogoLarge,
|
||||
LogoSmall
|
||||
Logo,
|
||||
};
|
||||
|
||||
static void Init();
|
||||
|
||||
static QPixmap GetPlatform(DiscIO::Platform platform);
|
||||
static QPixmap GetCountry(DiscIO::Country country);
|
||||
static QIcon GetPlatform(DiscIO::Platform platform);
|
||||
static QIcon GetCountry(DiscIO::Country country);
|
||||
|
||||
static QPixmap GetMisc(MiscID id);
|
||||
static QIcon GetMisc(MiscID id);
|
||||
|
||||
static QIcon GetScaledIcon(std::string_view name);
|
||||
static QIcon GetScaledThemeIcon(std::string_view name);
|
||||
static QIcon GetResourceIcon(std::string_view name);
|
||||
static QIcon GetThemeIcon(std::string_view name);
|
||||
static QIcon GetAppIcon();
|
||||
|
||||
static QPixmap GetScaledPixmap(std::string_view name);
|
||||
|
||||
private:
|
||||
Resources() {}
|
||||
static QIcon GetIcon(std::string_view name, const QString& dir);
|
||||
static QPixmap GetPixmap(std::string_view name, const QString& dir);
|
||||
static QIcon LoadNamedIcon(std::string_view name, const QString& dir);
|
||||
|
||||
static QList<QPixmap> m_platforms;
|
||||
static QList<QPixmap> m_countries;
|
||||
static QList<QPixmap> m_misc;
|
||||
static bool m_svg_supported;
|
||||
static QList<QIcon> m_platforms;
|
||||
static QList<QIcon> m_countries;
|
||||
static QList<QIcon> m_misc;
|
||||
};
|
||||
|
Reference in New Issue
Block a user