fix #613 (debugger focus)

This commit is contained in:
thrust26 2020-05-01 20:49:45 +02:00
parent b5d0a5a057
commit da3d7f1108
3 changed files with 14 additions and 7 deletions

View File

@ -688,6 +688,7 @@ void Debugger::setStartState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::setQuitState() void Debugger::setQuitState()
{ {
myDialog->saveConfig();
saveOldState(); saveOldState();
// Bus must be unlocked for normal operation when leaving debugger mode // Bus must be unlocked for normal operation when leaving debugger mode

View File

@ -71,12 +71,11 @@ DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::loadConfig() void DebuggerDialog::loadConfig()
{ {
// set initial focus to myPrompt if(myFocusedWidget == nullptr)
if (myFirstLoad) // Set initial focus to prompt tab
{ myFocusedWidget = myPrompt;
setFocus(myPrompt); // Restore focus
myFirstLoad = false; setFocus(myFocusedWidget);
}
myTab->loadConfig(); myTab->loadConfig();
myTiaInfo->loadConfig(); myTiaInfo->loadConfig();
@ -89,6 +88,11 @@ void DebuggerDialog::loadConfig()
myMessageBox->setText(""); myMessageBox->setText("");
} }
void DebuggerDialog::saveConfig()
{
myFocusedWidget = _focusedWidget;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated) void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated)
{ {

View File

@ -71,6 +71,7 @@ class DebuggerDialog : public Dialog
ButtonWidget& unwindButton() const { return *myUnwindButton; } ButtonWidget& unwindButton() const { return *myUnwindButton; }
void showFatalMessage(const string& msg); void showFatalMessage(const string& msg);
void saveConfig();
private: private:
void center() override { positionAt(0); } void center() override { positionAt(0); }
@ -136,7 +137,8 @@ class DebuggerDialog : public Dialog
unique_ptr<GUI::Font> myLFont; // used for labels unique_ptr<GUI::Font> myLFont; // used for labels
unique_ptr<GUI::Font> myNFont; // used for normal text unique_ptr<GUI::Font> myNFont; // used for normal text
bool myFirstLoad{true}; Widget* myFocusedWidget{nullptr};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported