Mouse enter tracking for savestate screen
Jeffrey Pfau jeffrey@endrift.com
Thu, 16 Oct 2014 01:32:06 -0700
1 files changed,
11 insertions(+),
1 deletions(-)
M
src/platform/qt/LoadSaveState.cpp
→
src/platform/qt/LoadSaveState.cpp
@@ -47,7 +47,7 @@ setWindowTitle(text);
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;@@ -86,6 +86,16 @@ row %= 9;
m_currentFocus = column + row; 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; }