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) NSString *nib_name;
|
||||||
@property (strong, nonatomic) UIImage* file_icon;
|
@property (strong, nonatomic) UIImage* file_icon;
|
||||||
@property (strong, nonatomic) UIImage* folder_icon;
|
@property (strong, nonatomic) UIImage* folder_icon;
|
||||||
|
@property (strong, nonatomic) UIBarButtonItem* settings_button;
|
||||||
|
|
||||||
@property const char* system_directory;
|
@property const char* system_directory;
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,16 @@ extern uint32_t ios_current_touch_count ;
|
||||||
bool is_iphone = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone;
|
bool is_iphone = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone;
|
||||||
self.nib_name = is_iphone ? @"ViewController_iPhone" : @"ViewController_iPad";
|
self.nib_name = is_iphone ? @"ViewController_iPhone" : @"ViewController_iPad";
|
||||||
|
|
||||||
|
// Load icons
|
||||||
self.file_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ic_file" ofType:@"png"]];
|
self.file_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ic_file" ofType:@"png"]];
|
||||||
self.folder_icon = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ic_dir" 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 = [[UINavigationController alloc] initWithNibName:self.nib_name bundle:nil];
|
||||||
[self.navigator pushViewController: [[module_list alloc] initWithNibName:self.nib_name bundle:nil] animated:YES];
|
[self.navigator pushViewController: [[module_list alloc] initWithNibName:self.nib_name bundle:nil] animated:YES];
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
free(path);
|
free(path);
|
||||||
path = strdup(directory);
|
path = strdup(directory);
|
||||||
|
|
||||||
[self setTitle: [[NSString alloc] initWithUTF8String:directory]];
|
[self setTitle: [[[NSString alloc] initWithUTF8String:directory] lastPathComponent]];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -44,11 +44,7 @@
|
||||||
table.dataSource = self;
|
table.dataSource = self;
|
||||||
table.delegate = self;
|
table.delegate = self;
|
||||||
|
|
||||||
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
|
self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button;
|
||||||
initWithTitle:@"Parent"
|
|
||||||
style:UIBarButtonItemStyleBordered
|
|
||||||
target:nil action:nil];
|
|
||||||
|
|
||||||
|
|
||||||
self.view = table;
|
self.view = table;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,7 @@
|
||||||
table.delegate = self;
|
table.delegate = self;
|
||||||
self.view = table;
|
self.view = table;
|
||||||
|
|
||||||
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
|
self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button;
|
||||||
initWithTitle:@"Parent"
|
|
||||||
style:UIBarButtonItemStyleBordered
|
|
||||||
target:nil action:nil];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
|
|
Loading…
Reference in New Issue