@@ -695,7 +695,6 @@ void GameBrowser::Refresh() {
695695 layoutChoice->AddChoice (ImageID (" I_LINES" ));
696696 layoutChoice->SetSelection (*gridStyle_ ? 0 : 1 , false );
697697 layoutChoice->OnChoice .Handle (this , &GameBrowser::LayoutChange);
698- topBar->Add (new Choice (ImageID (" I_GEAR" ), new LayoutParams (64 .0f , 64 .0f )))->OnClick .Handle (this , &GameBrowser::GridSettingsClick);
699698 Add (topBar);
700699
701700 if (*gridStyle_) {
@@ -715,17 +714,6 @@ void GameBrowser::Refresh() {
715714 gl->SetSpacing (4 .0f );
716715 gameList_ = gl;
717716 }
718- // Until we can come up with a better space to put it (next to the tabs?) let's get rid of the icon config
719- // button on the Recent tab, it's ugly. You can use the button from the other tabs.
720-
721- // LinearLayout *gridOptionColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(64.0, 64.0f));
722- // gridOptionColumn->Add(new Spacer(12.0));
723- // gridOptionColumn->Add(new Choice(ImageID("I_GEAR"), new LayoutParams(64.0f, 64.0f)))->OnClick.Handle(this, &GameBrowser::GridSettingsClick);
724- // LinearLayout *grid = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
725- // gameList_->ReplaceLayoutParams(new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 0.75));
726- // grid->Add(gameList_);
727- // grid->Add(gridOptionColumn);
728- // Add(grid);
729717 Add (gameList_);
730718 }
731719
@@ -929,21 +917,24 @@ UI::EventReturn GameBrowser::NavigateClick(UI::EventParams &e) {
929917 return UI::EVENT_DONE;
930918}
931919
932- UI::EventReturn GameBrowser::GridSettingsClick (UI::EventParams &e) {
920+ UI::EventReturn MainScreen::OnGridSettings (UI::EventParams &e) {
933921 auto sy = GetI18NCategory (" System" );
934922 auto gridSettings = new GridSettingsScreen (sy->T (" Games list settings" ));
935- gridSettings->OnRecentChanged .Handle (this , &GameBrowser ::OnRecentClear);
923+ gridSettings->OnRecentChanged .Handle (this , &MainScreen ::OnRecentClear);
936924 if (e.v )
937925 gridSettings->SetPopupOrigin (e.v );
938926
939- screenManager_ ->push (gridSettings);
927+ screenManager () ->push (gridSettings);
940928 return UI::EVENT_DONE;
941929}
942930
943- UI::EventReturn GameBrowser::OnRecentClear (UI::EventParams &e) {
944- screenManager_->RecreateAllViews ();
945- if (host) {
946- host->UpdateUI ();
931+ UI::EventReturn MainScreen::OnRecentClear (UI::EventParams &e) {
932+ if (tabHolder_->GetCurrentTab () == 0 ) {
933+ // If we are in recent tab update the tab below
934+ RecreateViews ();
935+ } else {
936+ // If not schedule for dialog finish (avoid losing the current game list)
937+ recreateViewOnDialogFinish_ = true ;
947938 }
948939 return UI::EVENT_DONE;
949940}
@@ -1091,6 +1082,7 @@ void MainScreen::CreateViews() {
10911082 leftColumn->Add (new Spacer (new LinearLayoutParams (0 .1f )));
10921083 }
10931084
1085+ tabHolder_->AddChoice (new Choice (ImageID (" I_GEAR" ), new LayoutParams (64 .0f , 64 .0f )))->OnClick .Handle (this , &MainScreen::OnGridSettings);
10941086 ViewGroup *rightColumn = new ScrollView (ORIENT_VERTICAL);
10951087 LinearLayout *rightColumnItems = new LinearLayout (ORIENT_VERTICAL, new LinearLayoutParams (FILL_PARENT, WRAP_CONTENT));
10961088 rightColumnItems->SetSpacing (0 .0f );
@@ -1426,6 +1418,10 @@ void MainScreen::dialogFinished(const Screen *dialog, DialogResult result) {
14261418 backFromStore_ = true ;
14271419 RecreateViews ();
14281420 }
1421+ if (recreateViewOnDialogFinish_) {
1422+ recreateViewOnDialogFinish_ = false ;
1423+ RecreateViews ();
1424+ }
14291425 if (dialog->tag () == " game" ) {
14301426 if (!restoreFocusGamePath_.empty () && UI::IsFocusMovementEnabled ()) {
14311427 // Prevent the background from fading, since we just were displaying it.
0 commit comments