mirror of https://github.com/stella-emu/stella.git
fix #613 (debugger focus)
This commit is contained in:
parent
b5d0a5a057
commit
da3d7f1108
|
@ -688,6 +688,7 @@ void Debugger::setStartState()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Debugger::setQuitState()
|
||||
{
|
||||
myDialog->saveConfig();
|
||||
saveOldState();
|
||||
|
||||
// Bus must be unlocked for normal operation when leaving debugger mode
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue