mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	update graphics api button indicator (#6625)
* update graphics api button indicator This tiny pull request * update the graphics button indicator when launching or closing a game (graphics button doesn't update with per game configuration) * Disable graphics button indicator click while in game * fix crash * It fixed crash when opening configure dialog in game if the graphics api for the game is different of the global graphics api
This commit is contained in:
		
							parent
							
								
									d735f5c458
								
							
						
					
					
						commit
						08970e7ba0
					
				
					 2 changed files with 6 additions and 8 deletions
				
			
		|  | @ -83,7 +83,7 @@ void SetPerGameSetting(QComboBox* combobox, | |||
| /// account per-game status
 | ||||
| template <typename Type, bool ranged> | ||||
| Type GetComboboxSetting(int index, const Settings::SwitchableSetting<Type, ranged>* setting) { | ||||
|     if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) { | ||||
|     if (Settings::IsConfiguringGlobal() || setting->UsingGlobal()) { | ||||
|         return static_cast<Type>(index); | ||||
|     } else if (!Settings::IsConfiguringGlobal()) { | ||||
|         if (index == 0) { | ||||
|  |  | |||
|  | @ -371,13 +371,7 @@ void GMainWindow::InitializeWidgets() { | |||
|     graphics_api_button->setFocusPolicy(Qt::NoFocus); | ||||
|     UpdateAPIIndicator(); | ||||
| 
 | ||||
|     connect(graphics_api_button, &QPushButton::clicked, this, [this] { | ||||
|         if (emulation_running) { | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         UpdateAPIIndicator(true); | ||||
|     }); | ||||
|     connect(graphics_api_button, &QPushButton::clicked, this, [this] { UpdateAPIIndicator(true); }); | ||||
| 
 | ||||
|     statusBar()->insertPermanentWidget(0, graphics_api_button); | ||||
| 
 | ||||
|  | @ -1734,6 +1728,7 @@ void GMainWindow::OnStartGame() { | |||
|     PreventOSSleep(); | ||||
| 
 | ||||
|     emu_thread->SetRunning(true); | ||||
|     graphics_api_button->setEnabled(false); | ||||
|     qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus"); | ||||
|     qRegisterMetaType<std::string>("std::string"); | ||||
|     connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError); | ||||
|  | @ -1743,6 +1738,7 @@ void GMainWindow::OnStartGame() { | |||
|     discord_rpc->Update(); | ||||
| 
 | ||||
|     UpdateSaveStates(); | ||||
|     UpdateAPIIndicator(); | ||||
| } | ||||
| 
 | ||||
| void GMainWindow::OnRestartGame() { | ||||
|  | @ -1773,7 +1769,9 @@ void GMainWindow::OnPauseContinueGame() { | |||
| 
 | ||||
| void GMainWindow::OnStopGame() { | ||||
|     ShutdownGame(); | ||||
|     graphics_api_button->setEnabled(true); | ||||
|     Settings::RestoreGlobalState(false); | ||||
|     UpdateAPIIndicator(); | ||||
| } | ||||
| 
 | ||||
| void GMainWindow::OnLoadComplete() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue