(ui) Style nits

This commit is contained in:
twinaphex 2017-01-17 19:04:42 +01:00
parent 0354ced675
commit e5b7b83b3f
2 changed files with 44 additions and 45 deletions

View File

@ -274,13 +274,12 @@ static void RunActionSheet(const char* title, const struct string_list* items,
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == alertView.firstOtherButtonIndex) {
if (buttonIndex == alertView.firstOtherButtonIndex)
menu_entry_bind_key_set(self.i, RETROK_UNKNOWN);
} else if(buttonIndex == alertView.firstOtherButtonIndex + 1) {
else if(buttonIndex == alertView.firstOtherButtonIndex + 1)
menu_entry_bind_joykey_set(self.i, NO_BTN);
} else if(buttonIndex == alertView.firstOtherButtonIndex + 2) {
else if(buttonIndex == alertView.firstOtherButtonIndex + 2)
menu_entry_bind_joyaxis_set(self.i, AXIS_NONE);
}
[self finishWithClickedButton:true];
}
@ -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())) {
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) {
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))) {
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 {
else
return;
}
[self finishWithClickedButton:false];
}
@ -496,11 +494,10 @@ replacementString:(NSString *)string
[super initialize:main idx:i];
self.formatter = [RANumberFormatter new];
if (menu_entry_num_has_range(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
@interface RAMenuItemInt : RAMenuItemNum

View File

@ -190,9 +190,8 @@ enum
* but is bad for business with events. */
static double last_time_stamp;
if (last_time_stamp == event.timestamp) {
if (last_time_stamp == event.timestamp)
return [super handleKeyUIEvent:event];
}
last_time_stamp = event.timestamp;
@ -495,16 +494,20 @@ enum
- (void)mainMenuPushPop: (bool)pushp
{
if ( 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 ) {
}
else
{
if ( self.menu_count == 0 )
[self.mainmenu reloadData];
} else {
else
{
self.menu_count--;
[self popViewControllerAnimated:YES];
@ -628,7 +631,6 @@ static void ui_companion_cocoatouch_notify_list_pushed(void *data,
{
RetroArch_iOS *ap = (RetroArch_iOS *)apple_platform;
bool pushp = false;
size_t new_size = file_list_get_size( menu_list );
/* FIXME workaround for the double call */
@ -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)