Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions rpcs3/rpcs3qt/game_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ game_list::game_list() : QTableWidget(), game_list_base()
{
Q_EMIT IconReady(game, item);
};

connect(this, &QTableWidget::currentCellChanged, this, [this](int new_row, int /*new_col*/, int prev_row, int /*prev_column*/)
{
if (new_row == prev_row) return;

// Stop movie of last selected row unless it's the hover item
if (movie_item* old_item = static_cast<movie_item*>(item(prev_row, 0)); old_item && old_item != m_last_hover_item)
{
old_item->set_active(false);
}

// Start move of new selected row
if (movie_item* new_item = static_cast<movie_item*>(item(new_row, 0)))
{
new_item->set_active(true);
}
});
}

void game_list::sync_header_actions(std::map<int, QAction*>& actions, std::function<bool(int)> get_visibility)
Expand Down Expand Up @@ -130,19 +147,23 @@ void game_list::mouseMoveEvent(QMouseEvent* event)
{
movie_item* new_item = static_cast<movie_item*>(itemAt(event->pos()));

// Check if the mouse is above a new item
if (new_item != m_last_hover_item)
{
if (m_last_hover_item)
// Stop movie of last hover item unless it's the selected row
if (m_last_hover_item && m_last_hover_item->row() != currentRow())
{
m_last_hover_item->set_active(false);
}

// Start move of new hover item
if (new_item)
{
new_item->set_active(true);
}
}

m_last_hover_item = new_item;
m_last_hover_item = new_item;
}

QTableWidget::mouseMoveEvent(event);
}
Expand Down Expand Up @@ -177,6 +198,13 @@ void game_list::keyPressEvent(QKeyEvent* event)

void game_list::leaveEvent(QEvent* event)
{
// Stop movie of selected row
if (movie_item* icon_item = static_cast<movie_item*>(item(currentRow(), 0)))
{
icon_item->set_active(false);
}

// Stop movie of hover item
if (m_last_hover_item)
{
m_last_hover_item->set_active(false);
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/rpcs3qt/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@
</action>
<action name="confShortcutsAct">
<property name="text">
<string>Shortcuts</string>
<string>Keyboard Shortcuts</string>
</property>
</action>
<action name="toolsSystemCommandsAct">
Expand Down
12 changes: 6 additions & 6 deletions rpcs3/rpcs3qt/shortcut_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Shortcuts</string>
<string>Keyboard Shortcuts</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
Expand All @@ -25,10 +25,10 @@
<item>
<spacer name="verticalSpacer_main_window">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -50,10 +50,10 @@
<item>
<spacer name="verticalSpacer_game_window">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -71,7 +71,7 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
<set>QDialogButtonBox::StandardButton::Apply|QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Save</set>
</property>
</widget>
</item>
Expand Down