Mouse enter tracking for savestate screen

This commit is contained in:
Jeffrey Pfau 2014-10-16 01:32:06 -07:00
parent f49494cd1d
commit 73d28a1ae4
1 changed files with 11 additions and 1 deletions

View File

@ -47,7 +47,7 @@ void LoadSaveState::setMode(LoadSave mode) {
m_ui.lsLabel->setText(text);
}
bool LoadSaveState::eventFilter(QObject*, QEvent* event) {
bool LoadSaveState::eventFilter(QObject* object, QEvent* event) {
if (event->type() == QEvent::KeyPress) {
int column = m_currentFocus % 3;
int row = m_currentFocus - column;
@ -87,6 +87,16 @@ bool LoadSaveState::eventFilter(QObject*, QEvent* event) {
m_slots[m_currentFocus]->setFocus();
return true;
}
if (event->type() == QEvent::Enter) {
int i;
for (i = 0; i < 9; ++i) {
if (m_slots[i] == object) {
m_currentFocus = i;
m_slots[m_currentFocus]->setFocus();
return true;
}
}
}
return false;
}