mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-23 03:02:53 +01:00
game_list_frame: add method colorizedIcons
This commit is contained in:
parent
ced539579e
commit
743a19027a
@ -23,6 +23,7 @@
|
||||
#include <QTimer>
|
||||
#include <QUrl>
|
||||
#include <QLabel>
|
||||
#include <QBitmap>
|
||||
|
||||
static const std::string m_class_name = "GameViewer";
|
||||
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();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
m_oldLayoutIsList = m_isListLayout;
|
||||
|
@ -189,6 +189,8 @@ public:
|
||||
/** Resize Gamelist Icons to size */
|
||||
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:
|
||||
void SetListMode(const bool& isList);
|
||||
void SetToolBarVisible(const bool& showToolBar);
|
||||
|
Loading…
Reference in New Issue
Block a user