mirror of
https://github.com/libretro/RetroArch
synced 2025-02-16 21:40:04 +00:00
(ui) Style nits
This commit is contained in:
parent
0354ced675
commit
e5b7b83b3f
ui/drivers
@ -274,15 +274,14 @@ static void RunActionSheet(const char* title, const struct string_list* items,
|
||||
|
||||
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
|
||||
{
|
||||
if (buttonIndex == alertView.firstOtherButtonIndex) {
|
||||
menu_entry_bind_key_set(self.i, RETROK_UNKNOWN);
|
||||
} else if(buttonIndex == alertView.firstOtherButtonIndex + 1) {
|
||||
menu_entry_bind_joykey_set(self.i, NO_BTN);
|
||||
} else if(buttonIndex == alertView.firstOtherButtonIndex + 2) {
|
||||
menu_entry_bind_joyaxis_set(self.i, AXIS_NONE);
|
||||
}
|
||||
|
||||
[self finishWithClickedButton:true];
|
||||
if (buttonIndex == alertView.firstOtherButtonIndex)
|
||||
menu_entry_bind_key_set(self.i, RETROK_UNKNOWN);
|
||||
else if(buttonIndex == alertView.firstOtherButtonIndex + 1)
|
||||
menu_entry_bind_joykey_set(self.i, NO_BTN);
|
||||
else if(buttonIndex == alertView.firstOtherButtonIndex + 2)
|
||||
menu_entry_bind_joyaxis_set(self.i, AXIS_NONE);
|
||||
|
||||
[self finishWithClickedButton:true];
|
||||
}
|
||||
|
||||
- (void)checkBind:(NSTimer*)send
|
||||
@ -290,15 +289,14 @@ static void RunActionSheet(const char* title, const struct string_list* items,
|
||||
int32_t value = 0;
|
||||
int32_t idx = menu_entry_bind_index(self.i);
|
||||
|
||||
if ((value = cocoa_input_find_any_key())) {
|
||||
menu_entry_bind_key_set(self.i, input_keymaps_translate_keysym_to_rk(value));
|
||||
} else if ((value = cocoa_input_find_any_button(idx)) >= 0) {
|
||||
menu_entry_bind_joykey_set(self.i, value);
|
||||
} else if ((value = cocoa_input_find_any_axis(idx))) {
|
||||
menu_entry_bind_joyaxis_set(self.i, (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1));
|
||||
} else {
|
||||
if ((value = cocoa_input_find_any_key()))
|
||||
menu_entry_bind_key_set(self.i, input_keymaps_translate_keysym_to_rk(value));
|
||||
else if ((value = cocoa_input_find_any_button(idx)) >= 0)
|
||||
menu_entry_bind_joykey_set(self.i, value);
|
||||
else if ((value = cocoa_input_find_any_axis(idx)))
|
||||
menu_entry_bind_joyaxis_set(self.i, (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1));
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
[self finishWithClickedButton:false];
|
||||
}
|
||||
@ -496,10 +494,9 @@ replacementString:(NSString *)string
|
||||
[super initialize:main idx:i];
|
||||
self.formatter = [RANumberFormatter new];
|
||||
|
||||
if (menu_entry_num_has_range(self.i)) {
|
||||
[self.formatter setRangeFrom:BOXFLOAT(menu_entry_num_min(self.i))
|
||||
To:BOXFLOAT(menu_entry_num_max(self.i))];
|
||||
}
|
||||
if (menu_entry_num_has_range(self.i))
|
||||
[self.formatter setRangeFrom:BOXFLOAT(menu_entry_num_min(self.i))
|
||||
To:BOXFLOAT(menu_entry_num_max(self.i))];
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -190,9 +190,8 @@ enum
|
||||
* but is bad for business with events. */
|
||||
static double last_time_stamp;
|
||||
|
||||
if (last_time_stamp == event.timestamp) {
|
||||
return [super handleKeyUIEvent:event];
|
||||
}
|
||||
if (last_time_stamp == event.timestamp)
|
||||
return [super handleKeyUIEvent:event];
|
||||
|
||||
last_time_stamp = event.timestamp;
|
||||
|
||||
@ -495,21 +494,25 @@ enum
|
||||
|
||||
- (void)mainMenuPushPop: (bool)pushp
|
||||
{
|
||||
if ( pushp ) {
|
||||
self.menu_count++;
|
||||
RAMenuBase* next_menu = [RAMainMenu new];
|
||||
next_menu.last_menu = self.mainmenu;
|
||||
self.mainmenu = next_menu;
|
||||
[self pushViewController:self.mainmenu animated:YES];
|
||||
} else {
|
||||
if ( self.menu_count == 0 ) {
|
||||
[self.mainmenu reloadData];
|
||||
} else {
|
||||
self.menu_count--;
|
||||
if ( pushp )
|
||||
{
|
||||
self.menu_count++;
|
||||
RAMenuBase* next_menu = [RAMainMenu new];
|
||||
next_menu.last_menu = self.mainmenu;
|
||||
self.mainmenu = next_menu;
|
||||
[self pushViewController:self.mainmenu animated:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( self.menu_count == 0 )
|
||||
[self.mainmenu reloadData];
|
||||
else
|
||||
{
|
||||
self.menu_count--;
|
||||
|
||||
[self popViewControllerAnimated:YES];
|
||||
self.mainmenu = self.mainmenu.last_menu;
|
||||
}
|
||||
[self popViewControllerAnimated:YES];
|
||||
self.mainmenu = self.mainmenu.last_menu;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -627,9 +630,8 @@ static void ui_companion_cocoatouch_notify_list_pushed(void *data,
|
||||
file_list_t *list, file_list_t *menu_list)
|
||||
{
|
||||
RetroArch_iOS *ap = (RetroArch_iOS *)apple_platform;
|
||||
bool pushp = false;
|
||||
|
||||
size_t new_size = file_list_get_size( menu_list );
|
||||
bool pushp = false;
|
||||
size_t new_size = file_list_get_size( menu_list );
|
||||
|
||||
/* FIXME workaround for the double call */
|
||||
if ( old_size == 0 )
|
||||
@ -638,13 +640,13 @@ static void ui_companion_cocoatouch_notify_list_pushed(void *data,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( old_size == new_size ) {
|
||||
if ( old_size == new_size )
|
||||
pushp = false;
|
||||
} else if ( old_size < new_size ) {
|
||||
else if ( old_size < new_size )
|
||||
pushp = true;
|
||||
} else if ( old_size > new_size ) {
|
||||
else if ( old_size > new_size )
|
||||
printf( "notify_list_pushed: old size should not be larger\n" );
|
||||
}
|
||||
|
||||
old_size = new_size;
|
||||
|
||||
if (ap)
|
||||
|
Loading…
x
Reference in New Issue
Block a user