mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 10:35:03 +00:00
fixed right click bug
This commit is contained in:
parent
a8d0b0b210
commit
aed2e0e024
@ -80,9 +80,10 @@ GameListFrame::GameListFrame(std::shared_ptr<gui_settings> gui_settings,
|
||||
});
|
||||
|
||||
connect(this, &QTableWidget::customContextMenuRequested, this, [=, this](const QPoint& pos) {
|
||||
m_gui_context_menus.RequestGameMenu(pos, m_game_info->m_games, m_compat_info,
|
||||
m_gui_settings, this, true);
|
||||
PopulateGameList(false);
|
||||
int changedFavorite = m_gui_context_menus.RequestGameMenu(
|
||||
pos, m_game_info->m_games, m_compat_info, m_gui_settings, this, true);
|
||||
if (changedFavorite)
|
||||
PopulateGameList(false);
|
||||
});
|
||||
|
||||
connect(this, &QTableWidget::cellClicked, this, [=, this](int row, int column) {
|
||||
|
@ -31,13 +31,13 @@
|
||||
class GuiContextMenus : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
void RequestGameMenu(const QPoint& pos, QVector<GameInfo>& m_games,
|
||||
std::shared_ptr<CompatibilityInfoClass> m_compat_info,
|
||||
std::shared_ptr<gui_settings> settings, QTableWidget* widget,
|
||||
bool isList) {
|
||||
int RequestGameMenu(const QPoint& pos, QVector<GameInfo>& m_games,
|
||||
std::shared_ptr<CompatibilityInfoClass> m_compat_info,
|
||||
std::shared_ptr<gui_settings> settings, QTableWidget* widget, bool isList) {
|
||||
QPoint global_pos = widget->viewport()->mapToGlobal(pos);
|
||||
std::shared_ptr<gui_settings> m_gui_settings = std::move(settings);
|
||||
int itemID = 0;
|
||||
int changedFavorite = 0;
|
||||
if (isList) {
|
||||
itemID = widget->currentRow();
|
||||
} else {
|
||||
@ -46,7 +46,7 @@ public:
|
||||
|
||||
// Do not show the menu if no item is selected
|
||||
if (itemID < 0 || itemID >= m_games.size()) {
|
||||
return;
|
||||
return changedFavorite;
|
||||
}
|
||||
|
||||
// Setup menu.
|
||||
@ -142,7 +142,7 @@ public:
|
||||
// Show menu.
|
||||
auto selected = menu.exec(global_pos);
|
||||
if (!selected) {
|
||||
return;
|
||||
return changedFavorite;
|
||||
}
|
||||
|
||||
if (selected == openGameFolder) {
|
||||
@ -318,6 +318,7 @@ public:
|
||||
if (selected == toggleFavorite) {
|
||||
m_gui_settings->SetValue(gui::favorites, serialStr, !isFavorite, true);
|
||||
widget->setCurrentCell(-1, -1);
|
||||
changedFavorite = 1;
|
||||
}
|
||||
|
||||
if (selected == &openCheats) {
|
||||
@ -605,6 +606,7 @@ public:
|
||||
QUrl(url_issues + m_games[itemID].compatibility.issue_number));
|
||||
}
|
||||
}
|
||||
return changedFavorite;
|
||||
}
|
||||
|
||||
int GetRowIndex(QTreeWidget* treeWidget, QTreeWidgetItem* item) {
|
||||
|
Loading…
Reference in New Issue
Block a user