Partial fix for #399, sometimes(!) the initial tab has the correct widget focused

This commit is contained in:
thrust26 2018-12-29 23:30:12 +01:00
parent c5c3014819
commit c1d5020ea0
4 changed files with 7 additions and 10 deletions

View File

@ -98,11 +98,13 @@ void Dialog::open()
parent().addDialog(this); parent().addDialog(this);
center(); center();
loadConfig();
// (Re)-build the focus list to use for the widgets which are currently // (Re)-build the focus list to use for the widgets which are currently
// onscreen // onscreen
buildCurrentFocusList(); buildCurrentFocusList(0);
loadConfig();
_visible = true; _visible = true;

View File

@ -126,7 +126,7 @@ void TabWidget::updateActiveTab()
setDirty(); setDirty();
// Redraw focused areas // Redraw focused areas
_boss->redrawFocus(); _boss->redrawFocus(); // TJ: Does nothing!
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -240,7 +240,7 @@ bool TabWidget::handleEvent(Event::Type event)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TabWidget::loadConfig() void TabWidget::loadConfig()
{ {
if(_firstTime) //if(_firstTime)
{ {
setActiveTab(_activeTab, true); setActiveTab(_activeTab, true);
_firstTime = false; _firstTime = false;

View File

@ -196,11 +196,6 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
addBGroupToFocusList(wid); addBGroupToFocusList(wid);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UIDialog::~UIDialog()
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void UIDialog::loadConfig() void UIDialog::loadConfig()
{ {

View File

@ -35,7 +35,7 @@ class UIDialog : public Dialog
{ {
public: public:
UIDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font); UIDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font);
virtual ~UIDialog(); virtual ~UIDialog() = default;
private: private:
void loadConfig() override; void loadConfig() override;