Skip to content

Commit

Permalink
Fix blank game collections defaulting to list view instead of grid view.
Browse files Browse the repository at this point in the history
  • Loading branch information
robotoad committed Dec 25, 2015
1 parent 2fde968 commit 8fead0d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions OpenEmu/OELibraryGamesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ - (void)_setupToolbar
toolbar.gridViewButton.enabled = YES;
toolbar.listViewButton.enabled = YES;

const BOOL inGridViewMode = self.collectionController.selectedViewTag == OEGridViewTag;
toolbar.gridViewButton.state = inGridViewMode ? NSOnState : NSOffState;
toolbar.listViewButton.state = !inGridViewMode ? NSOnState : NSOffState;
OECollectionViewControllerViewTag selectedViewTag = self.collectionController.selectedViewTag;
BOOL setGridView = selectedViewTag == OEGridViewTag || selectedViewTag == OEBlankSlateTag;
toolbar.gridViewButton.state = setGridView ? NSOnState : NSOffState;
toolbar.listViewButton.state = !setGridView ? NSOnState : NSOffState;

NSSearchField *field = toolbar.searchField;
field.searchMenuTemplate = nil;
Expand Down

0 comments on commit 8fead0d

Please sign in to comment.