mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Add toolbar in Rom's list to accommodate refresh and new folder buttons.
This commit is contained in:
parent
acfa16089e
commit
edc710d124
@ -212,7 +212,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
UIWindow* _window;
|
||||
|
||||
bool _isGameTop;
|
||||
bool _isGameTop, _isRomList;
|
||||
uint32_t _settingMenusInBackStack;
|
||||
uint32_t _enabledOrientations;
|
||||
|
||||
@ -272,11 +272,13 @@ int main(int argc, char *argv[])
|
||||
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
|
||||
{
|
||||
_isGameTop = [viewController isKindOfClass:[RAGameView class]];
|
||||
_isRomList = [viewController isKindOfClass:[RADirectoryList class]];
|
||||
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:_isGameTop withAnimation:UIStatusBarAnimationNone];
|
||||
[[UIApplication sharedApplication] setIdleTimerDisabled:_isGameTop];
|
||||
|
||||
self.navigationBarHidden = _isGameTop;
|
||||
[self setToolbarHidden:!_isRomList animated:YES];
|
||||
self.topViewController.navigationItem.rightBarButtonItem = [self createSettingsButton];
|
||||
}
|
||||
|
||||
|
@ -35,11 +35,7 @@
|
||||
{
|
||||
NSString* rootPath = RetroArch_iOS.get.documentsDirectory;
|
||||
NSString* ragPath = [rootPath stringByAppendingPathComponent:@"RetroArchGames"];
|
||||
|
||||
RADirectoryList* list = [RADirectoryList directoryListForPath:path_is_directory(ragPath.UTF8String) ? ragPath : rootPath];
|
||||
|
||||
list.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"New Folder" style:UIBarButtonItemStyleBordered target:list action:@selector(createNewFolder)];
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -57,6 +53,22 @@
|
||||
self = [super initWithStyle:UITableViewStylePlain];
|
||||
self.title = path.lastPathComponent;
|
||||
self.hidesHeaders = YES;
|
||||
|
||||
NSMutableArray *toolbarButtons = [[NSMutableArray alloc] initWithCapacity:3];
|
||||
|
||||
UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh)];
|
||||
refreshButton.style = UIBarButtonItemStyleBordered;
|
||||
[toolbarButtons addObject:refreshButton];
|
||||
|
||||
UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
|
||||
[toolbarButtons addObject:flexibleSpace];
|
||||
|
||||
UIBarButtonItem *newFolderButton = [[UIBarButtonItem alloc] initWithTitle:@"New Folder" style:UIBarButtonItemStyleBordered target:self action:@selector(createNewFolder)];
|
||||
[toolbarButtons addObject:newFolderButton];
|
||||
|
||||
[[[RetroArch_iOS get] toolbar] setItems:toolbarButtons];
|
||||
[self setToolbarItems:toolbarButtons];
|
||||
|
||||
[self refresh];
|
||||
|
||||
return self;
|
||||
|
Loading…
x
Reference in New Issue
Block a user