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()
{
myDialog->saveConfig();
saveOldState();
// 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()
{
// set initial focus to myPrompt
if (myFirstLoad)
{
setFocus(myPrompt);
myFirstLoad = false;
}
if(myFocusedWidget == nullptr)
// Set initial focus to prompt tab
myFocusedWidget = myPrompt;
// Restore focus
setFocus(myFocusedWidget);
myTab->loadConfig();
myTiaInfo->loadConfig();
@ -89,6 +88,11 @@ void DebuggerDialog::loadConfig()
myMessageBox->setText("");
}
void DebuggerDialog::saveConfig()
{
myFocusedWidget = _focusedWidget;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated)
{

View File

@ -71,6 +71,7 @@ class DebuggerDialog : public Dialog
ButtonWidget& unwindButton() const { return *myUnwindButton; }
void showFatalMessage(const string& msg);
void saveConfig();
private:
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> myNFont; // used for normal text
bool myFirstLoad{true};
Widget* myFocusedWidget{nullptr};
private:
// Following constructors and assignment operators not supported