mirror of https://github.com/stella-emu/stella.git
Remember and restore focus for all tabs of a Dialog
This commit is contained in:
parent
cd8d7498d3
commit
33f7c5b7e8
|
@ -99,12 +99,11 @@ void Dialog::open()
|
||||||
|
|
||||||
center();
|
center();
|
||||||
|
|
||||||
|
// (Re)-build the focus list to use for all widgets of all tabs
|
||||||
|
for(auto& tabfocus : _myTabList)
|
||||||
|
buildCurrentFocusList(tabfocus.widget->getID());
|
||||||
|
|
||||||
// (Re)-build the focus list to use for the widgets which are currently
|
loadConfig(); // has to be done AFTER (re)building the focus list
|
||||||
// onscreen
|
|
||||||
buildCurrentFocusList(0);
|
|
||||||
|
|
||||||
loadConfig();
|
|
||||||
|
|
||||||
_visible = true;
|
_visible = true;
|
||||||
|
|
||||||
|
@ -178,6 +177,10 @@ void Dialog::releaseFocus()
|
||||||
{
|
{
|
||||||
if(_focusedWidget)
|
if(_focusedWidget)
|
||||||
{
|
{
|
||||||
|
// remember focus of all tabs for when dialog is reopened again
|
||||||
|
for(auto& tabfocus : _myTabList)
|
||||||
|
tabfocus.saveCurrentFocus(_focusedWidget);
|
||||||
|
|
||||||
_focusedWidget->lostFocus();
|
_focusedWidget->lostFocus();
|
||||||
_focusedWidget = nullptr;
|
_focusedWidget = nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ GameInfoDialog::GameInfoDialog(
|
||||||
"(*) Changes require a ROM reload");
|
"(*) Changes require a ROM reload");
|
||||||
|
|
||||||
// Add items for tab 0
|
// Add items for tab 0
|
||||||
addToFocusList(wid, myTab, tabID);
|
addToFocusList(wid, myTab, tabID);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// 2) Console properties
|
// 2) Console properties
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "TabWidget.hxx"
|
#include "TabWidget.hxx"
|
||||||
#include "NTSCFilter.hxx"
|
#include "NTSCFilter.hxx"
|
||||||
#include "TIASurface.hxx"
|
#include "TIASurface.hxx"
|
||||||
|
|
||||||
#include "VideoDialog.hxx"
|
#include "VideoDialog.hxx"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
Loading…
Reference in New Issue