Qt: Autofocus on the right save slot
Jeffrey Pfau jeffrey@endrift.com
Tue, 04 Aug 2015 22:07:30 -0700
2 files changed,
10 insertions(+),
1 deletions(-)
M
src/platform/qt/GameController.h
→
src/platform/qt/GameController.h
@@ -72,6 +72,8 @@ void clearOverride() { m_threadContext.hasOverride = false; }
void setOptions(const GBAOptions*); + int stateSlot() const { return m_stateSlot; } + #ifdef USE_GDB_STUB ARMDebugger* debugger(); void setDebugger(ARMDebugger*);
M
src/platform/qt/LoadSaveState.cpp
→
src/platform/qt/LoadSaveState.cpp
@@ -23,7 +23,7 @@
LoadSaveState::LoadSaveState(GameController* controller, QWidget* parent) : QWidget(parent) , m_controller(controller) - , m_currentFocus(0) + , m_currentFocus(controller->stateSlot() - 1) , m_mode(LoadSave::LOAD) { m_ui.setupUi(this);@@ -43,6 +43,13 @@ for (i = 0; i < NUM_SLOTS; ++i) {
loadState(i + 1); m_slots[i]->installEventFilter(this); connect(m_slots[i], &QAbstractButton::clicked, this, [this, i]() { triggerState(i + 1); }); + } + + if (m_currentFocus >= 9) { + m_currentFocus = 0; + } + if (m_currentFocus < 0) { + m_currentFocus = 0; } QAction* escape = new QAction(this);