mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
ios: File browser tweaks.
The title is now just the last component of the path. The custom back button text is removed. A settings button is added to the right of the navigation bar.
This commit is contained in:
parent
de05d7d7fb
commit
291220aa54
@ -17,6 +17,7 @@
|
||||
@property (strong, nonatomic) NSString *nib_name;
|
||||
@property (strong, nonatomic) UIImage* file_icon;
|
||||
@property (strong, nonatomic) UIImage* folder_icon;
|
||||
@property (strong, nonatomic) UIBarButtonItem* settings_button;
|
||||
|
||||
@property const char* system_directory;
|
||||
|
||||
|
@ -34,9 +34,16 @@ extern uint32_t ios_current_touch_count ;
|
||||
bool is_iphone = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone;
|
||||
self.nib_name = is_iphone ? @"ViewController_iPhone" : @"ViewController_iPad";
|
||||
|
||||
// Load icons
|
||||
self.file_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ic_file" ofType:@"png"]];
|
||||
self.folder_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ic_dir" ofType:@"png"]];
|
||||
|
||||
// Load buttons
|
||||
self.settings_button = [[UIBarButtonItem alloc]
|
||||
initWithTitle:@"Settings"
|
||||
style:UIBarButtonItemStyleBordered
|
||||
target:nil action:nil];
|
||||
|
||||
|
||||
self.navigator = [[UINavigationController alloc] initWithNibName:self.nib_name bundle:nil];
|
||||
[self.navigator pushViewController: [[module_list alloc] initWithNibName:self.nib_name bundle:nil] animated:YES];
|
||||
|
@ -25,7 +25,7 @@
|
||||
free(path);
|
||||
path = strdup(directory);
|
||||
|
||||
[self setTitle: [[NSString alloc] initWithUTF8String:directory]];
|
||||
[self setTitle: [[[NSString alloc] initWithUTF8String:directory] lastPathComponent]];
|
||||
|
||||
return self;
|
||||
}
|
||||
@ -44,11 +44,7 @@
|
||||
table.dataSource = self;
|
||||
table.delegate = self;
|
||||
|
||||
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
|
||||
initWithTitle:@"Parent"
|
||||
style:UIBarButtonItemStyleBordered
|
||||
target:nil action:nil];
|
||||
|
||||
self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button;
|
||||
|
||||
self.view = table;
|
||||
}
|
||||
|
@ -50,10 +50,7 @@
|
||||
table.delegate = self;
|
||||
self.view = table;
|
||||
|
||||
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
|
||||
initWithTitle:@"Parent"
|
||||
style:UIBarButtonItemStyleBordered
|
||||
target:nil action:nil];
|
||||
self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
|
Loading…
x
Reference in New Issue
Block a user