2020-12-05 12:08:24 +00:00
|
|
|
#pragma once
|
2017-07-13 00:59:01 +00:00
|
|
|
|
|
|
|
#include <QTableWidget>
|
|
|
|
#include <QMouseEvent>
|
2021-04-15 20:52:40 +00:00
|
|
|
#include <QPixmap>
|
|
|
|
|
|
|
|
#include "game_compatibility.h"
|
|
|
|
#include "Emu/GameInfo.h"
|
|
|
|
|
2021-04-16 01:53:31 +00:00
|
|
|
class movie_item;
|
|
|
|
|
2021-04-15 20:52:40 +00:00
|
|
|
/* Having the icons associated with the game info simplifies logic internally */
|
|
|
|
struct gui_game_info
|
|
|
|
{
|
|
|
|
GameInfo info;
|
|
|
|
QString localized_category;
|
|
|
|
compat::status compat;
|
|
|
|
QPixmap icon;
|
|
|
|
QPixmap pxmap;
|
2021-09-07 23:00:49 +00:00
|
|
|
bool hasCustomConfig = false;
|
|
|
|
bool hasCustomPadConfig = false;
|
|
|
|
bool has_hover_gif = false;
|
|
|
|
movie_item* item = nullptr;
|
2021-04-15 20:52:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::shared_ptr<gui_game_info> game_info;
|
|
|
|
Q_DECLARE_METATYPE(game_info)
|
2017-07-13 00:59:01 +00:00
|
|
|
|
|
|
|
/*
|
2021-04-16 20:37:00 +00:00
|
|
|
class used in order to get deselection and hover change
|
2017-07-13 00:59:01 +00:00
|
|
|
if you know a simpler way, tell @Megamouse
|
|
|
|
*/
|
2017-09-05 20:16:22 +00:00
|
|
|
class game_list : public QTableWidget
|
|
|
|
{
|
2021-04-18 07:37:32 +00:00
|
|
|
public:
|
|
|
|
void clear_list(); // Use this instead of clearContents
|
|
|
|
|
2021-04-16 20:37:00 +00:00
|
|
|
protected:
|
|
|
|
movie_item* m_last_hover_item = nullptr;
|
2021-04-15 20:52:40 +00:00
|
|
|
|
2021-04-16 20:37:00 +00:00
|
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
void mouseMoveEvent(QMouseEvent *event) override;
|
|
|
|
void leaveEvent(QEvent *event) override;
|
2017-07-13 00:59:01 +00:00
|
|
|
};
|