mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
game_list_frame: add method colorizedIcons
This commit is contained in:
parent
ced539579e
commit
743a19027a
@ -23,6 +23,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QBitmap>
|
||||||
|
|
||||||
static const std::string m_class_name = "GameViewer";
|
static const std::string m_class_name = "GameViewer";
|
||||||
inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); }
|
inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); }
|
||||||
@ -754,6 +755,15 @@ void game_list_frame::ResizeIcons(const QString& sizeStr, const QSize& size, con
|
|||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon game_list_frame::colorizedIcon(const QIcon& icon, const QColor& oldColor, const QColor& newColor)
|
||||||
|
{
|
||||||
|
QPixmap pixmap = icon.pixmap(icon.availableSizes().at(0));
|
||||||
|
QBitmap mask = pixmap.createMaskFromColor(oldColor, Qt::MaskOutColor);
|
||||||
|
pixmap.fill(newColor);
|
||||||
|
pixmap.setMask(mask);
|
||||||
|
return QIcon(pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
void game_list_frame::SetListMode(const bool& isList)
|
void game_list_frame::SetListMode(const bool& isList)
|
||||||
{
|
{
|
||||||
m_oldLayoutIsList = m_isListLayout;
|
m_oldLayoutIsList = m_isListLayout;
|
||||||
|
@ -189,6 +189,8 @@ public:
|
|||||||
/** Resize Gamelist Icons to size */
|
/** Resize Gamelist Icons to size */
|
||||||
void ResizeIcons(const QString& sizeStr, const QSize& size, const int& index);
|
void ResizeIcons(const QString& sizeStr, const QSize& size, const int& index);
|
||||||
|
|
||||||
|
static QIcon colorizedIcon(const QIcon& icon, const QColor& oldColor, const QColor& newColor);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void SetListMode(const bool& isList);
|
void SetListMode(const bool& isList);
|
||||||
void SetToolBarVisible(const bool& showToolBar);
|
void SetToolBarVisible(const bool& showToolBar);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user