mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	applets/swkbd: Properly handle button_text
I'm not sure why we decided to have a boolean here, but apparently that wasn't the correct behaviour. According to HW tests, the Software Keyboard simply displays the default text when the button text provided is empty (**not necessarily all zero**). For example, if you set a text for one of the buttons and leave others empty, the button you set will have your text, while others will have their default texts. Removed the boolean and updated frontend code to make it correct.
This commit is contained in:
		
							parent
							
								
									7dc472a3a7
								
							
						
					
					
						commit
						190a053987
					
				
					 3 changed files with 18 additions and 38 deletions
				
			
		|  | @ -34,33 +34,21 @@ QtKeyboardDialog::QtKeyboardDialog(QWidget* parent, QtKeyboard* keyboard_) | |||
|     // Initialize buttons
 | ||||
|     switch (config.button_config) { | ||||
|     case ButtonConfig::Triple: | ||||
|         buttons->addButton(config.has_custom_button_text | ||||
|                                ? QString::fromStdString(config.button_text[2]) | ||||
|                                : tr(SWKBD_BUTTON_OKAY), | ||||
|                            QDialogButtonBox::ButtonRole::AcceptRole); | ||||
|         buttons->addButton(config.has_custom_button_text | ||||
|                                ? QString::fromStdString(config.button_text[1]) | ||||
|                                : tr(SWKBD_BUTTON_FORGOT), | ||||
|         buttons->addButton(config.button_text[1].empty() | ||||
|                                ? tr(SWKBD_BUTTON_FORGOT) | ||||
|                                : QString::fromStdString(config.button_text[1]), | ||||
|                            QDialogButtonBox::ButtonRole::HelpRole); | ||||
|         buttons->addButton(config.has_custom_button_text | ||||
|                                ? QString::fromStdString(config.button_text[0]) | ||||
|                                : tr(SWKBD_BUTTON_CANCEL), | ||||
|                            QDialogButtonBox::ButtonRole::RejectRole); | ||||
|         break; | ||||
|     // fallthrough
 | ||||
|     case ButtonConfig::Dual: | ||||
|         buttons->addButton(config.has_custom_button_text | ||||
|                                ? QString::fromStdString(config.button_text[2]) | ||||
|                                : tr(SWKBD_BUTTON_OKAY), | ||||
|                            QDialogButtonBox::ButtonRole::AcceptRole); | ||||
|         buttons->addButton(config.has_custom_button_text | ||||
|                                ? QString::fromStdString(config.button_text[0]) | ||||
|                                : tr(SWKBD_BUTTON_CANCEL), | ||||
|         buttons->addButton(config.button_text[0].empty() | ||||
|                                ? tr(SWKBD_BUTTON_CANCEL) | ||||
|                                : QString::fromStdString(config.button_text[0]), | ||||
|                            QDialogButtonBox::ButtonRole::RejectRole); | ||||
|         break; | ||||
|     // fallthrough
 | ||||
|     case ButtonConfig::Single: | ||||
|         buttons->addButton(config.has_custom_button_text | ||||
|                                ? QString::fromStdString(config.button_text[2]) | ||||
|                                : tr(SWKBD_BUTTON_OKAY), | ||||
|         buttons->addButton(config.button_text[2].empty() | ||||
|                                ? tr(SWKBD_BUTTON_OKAY) | ||||
|                                : QString::fromStdString(config.button_text[2]), | ||||
|                            QDialogButtonBox::ButtonRole::AcceptRole); | ||||
|         break; | ||||
|     case ButtonConfig::None: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue