all repos — mgba @ 73d28a1ae423017e3f16266dce1d019b8da292b4

mGBA Game Boy Advance Emulator

Mouse enter tracking for savestate screen
Jeffrey Pfau jeffrey@endrift.com
Thu, 16 Oct 2014 01:32:06 -0700
commit

73d28a1ae423017e3f16266dce1d019b8da292b4

parent

f49494cd1d76255d8969057469c69fd82ee0a409

1 files changed, 11 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/LoadSaveState.cppsrc/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; }