mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu.git
				synced 2025-05-12 00:45:25 +00:00 
			
		
		
		
	citra-qt: Add option to hide dock widget title bars
This commit is contained in:
		
							parent
							
								
									0bf5a0bfc4
								
							
						
					
					
						commit
						76c74ffc96
					
				| @ -114,6 +114,9 @@ GMainWindow::GMainWindow() | |||||||
|     ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool()); |     ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool()); | ||||||
|     ToggleWindowMode(); |     ToggleWindowMode(); | ||||||
| 
 | 
 | ||||||
|  |     ui.actionDisplay_widget_title_bars->setChecked(settings.value("displayTitleBars", true).toBool()); | ||||||
|  |     OnDisplayTitleBars(ui.actionDisplay_widget_title_bars->isChecked()); | ||||||
|  | 
 | ||||||
|     // Setup connections
 |     // Setup connections
 | ||||||
|     connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile())); |     connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile())); | ||||||
|     connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap())); |     connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap())); | ||||||
| @ -156,6 +159,27 @@ GMainWindow::~GMainWindow() | |||||||
|     Pica::g_debug_context.reset(); |     Pica::g_debug_context.reset(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void GMainWindow::OnDisplayTitleBars(bool show) | ||||||
|  | { | ||||||
|  |     QList<QDockWidget*> widgets = findChildren<QDockWidget*>(); | ||||||
|  | 
 | ||||||
|  |     if (show) { | ||||||
|  |         for (QDockWidget* widget: widgets) { | ||||||
|  |             QWidget* old = widget->titleBarWidget(); | ||||||
|  |             widget->setTitleBarWidget(nullptr); | ||||||
|  |             if (old != nullptr) | ||||||
|  |                 delete old; | ||||||
|  |         } | ||||||
|  |     } else { | ||||||
|  |         for (QDockWidget* widget: widgets) { | ||||||
|  |             QWidget* old = widget->titleBarWidget(); | ||||||
|  |             widget->setTitleBarWidget(new QWidget()); | ||||||
|  |             if (old != nullptr) | ||||||
|  |                 delete old; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void GMainWindow::BootGame(std::string filename) | void GMainWindow::BootGame(std::string filename) | ||||||
| { | { | ||||||
|     LOG_INFO(Frontend, "Citra starting...\n"); |     LOG_INFO(Frontend, "Citra starting...\n"); | ||||||
| @ -259,6 +283,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) | |||||||
|     settings.setValue("state", saveState()); |     settings.setValue("state", saveState()); | ||||||
|     settings.setValue("geometryRenderWindow", render_window->saveGeometry()); |     settings.setValue("geometryRenderWindow", render_window->saveGeometry()); | ||||||
|     settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); |     settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); | ||||||
|  |     settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked()); | ||||||
|     settings.setValue("firstStart", false); |     settings.setValue("firstStart", false); | ||||||
|     SaveHotkeys(settings); |     SaveHotkeys(settings); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -46,6 +46,7 @@ private slots: | |||||||
|     void OnMenuLoadSymbolMap(); |     void OnMenuLoadSymbolMap(); | ||||||
|     void OnOpenHotkeysDialog(); |     void OnOpenHotkeysDialog(); | ||||||
|     void OnConfigure(); |     void OnConfigure(); | ||||||
|  |     void OnDisplayTitleBars(bool); | ||||||
|     void ToggleWindowMode(); |     void ToggleWindowMode(); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ | |||||||
|      <x>0</x> |      <x>0</x> | ||||||
|      <y>0</y> |      <y>0</y> | ||||||
|      <width>1081</width> |      <width>1081</width> | ||||||
|      <height>20</height> |      <height>21</height> | ||||||
|     </rect> |     </rect> | ||||||
|    </property> |    </property> | ||||||
|    <widget class="QMenu" name="menu_File"> |    <widget class="QMenu" name="menu_File"> | ||||||
| @ -59,6 +59,7 @@ | |||||||
|      <string>&View</string> |      <string>&View</string> | ||||||
|     </property> |     </property> | ||||||
|     <addaction name="action_Single_Window_Mode"/> |     <addaction name="action_Single_Window_Mode"/> | ||||||
|  |     <addaction name="actionDisplay_widget_title_bars"/> | ||||||
|     <addaction name="action_Hotkeys"/> |     <addaction name="action_Hotkeys"/> | ||||||
|    </widget> |    </widget> | ||||||
|    <widget class="QMenu" name="menu_Help"> |    <widget class="QMenu" name="menu_Help"> | ||||||
| @ -73,17 +74,17 @@ | |||||||
|    <addaction name="menu_Help"/> |    <addaction name="menu_Help"/> | ||||||
|   </widget> |   </widget> | ||||||
|   <widget class="QStatusBar" name="statusbar"/> |   <widget class="QStatusBar" name="statusbar"/> | ||||||
|    <action name="action_Load_File"> |   <action name="action_Load_File"> | ||||||
|      <property name="text"> |    <property name="text"> | ||||||
|        <string>Load File...</string> |     <string>Load File...</string> | ||||||
|      </property> |    </property> | ||||||
|    </action> |   </action> | ||||||
|    <action name="action_Load_Symbol_Map"> |   <action name="action_Load_Symbol_Map"> | ||||||
|      <property name="text"> |    <property name="text"> | ||||||
|        <string>Load Symbol Map...</string> |     <string>Load Symbol Map...</string> | ||||||
|      </property> |    </property> | ||||||
|    </action> |   </action> | ||||||
|    <action name="action_Exit"> |   <action name="action_Exit"> | ||||||
|    <property name="text"> |    <property name="text"> | ||||||
|     <string>E&xit</string> |     <string>E&xit</string> | ||||||
|    </property> |    </property> | ||||||
| @ -101,28 +102,28 @@ | |||||||
|     <string>&Pause</string> |     <string>&Pause</string> | ||||||
|    </property> |    </property> | ||||||
|   </action> |   </action> | ||||||
|    <action name="action_Stop"> |   <action name="action_Stop"> | ||||||
|      <property name="enabled"> |    <property name="enabled"> | ||||||
|        <bool>false</bool> |     <bool>false</bool> | ||||||
|      </property> |    </property> | ||||||
|      <property name="text"> |    <property name="text"> | ||||||
|        <string>&Stop</string> |     <string>&Stop</string> | ||||||
|      </property> |    </property> | ||||||
|    </action> |   </action> | ||||||
|    <action name="action_About"> |   <action name="action_About"> | ||||||
|      <property name="text"> |    <property name="text"> | ||||||
|        <string>About Citra</string> |     <string>About Citra</string> | ||||||
|      </property> |    </property> | ||||||
|    </action> |   </action> | ||||||
|    <action name="action_Single_Window_Mode"> |   <action name="action_Single_Window_Mode"> | ||||||
|      <property name="checkable"> |    <property name="checkable"> | ||||||
|        <bool>true</bool> |     <bool>true</bool> | ||||||
|      </property> |    </property> | ||||||
|      <property name="text"> |    <property name="text"> | ||||||
|        <string>Single Window Mode</string> |     <string>Single Window Mode</string> | ||||||
|      </property> |    </property> | ||||||
|    </action> |   </action> | ||||||
|    <action name="action_Hotkeys"> |   <action name="action_Hotkeys"> | ||||||
|    <property name="text"> |    <property name="text"> | ||||||
|     <string>Configure &Hotkeys ...</string> |     <string>Configure &Hotkeys ...</string> | ||||||
|    </property> |    </property> | ||||||
| @ -132,6 +133,14 @@ | |||||||
|     <string>Configure ...</string> |     <string>Configure ...</string> | ||||||
|    </property> |    </property> | ||||||
|   </action> |   </action> | ||||||
|  |   <action name="actionDisplay_widget_title_bars"> | ||||||
|  |    <property name="checkable"> | ||||||
|  |     <bool>true</bool> | ||||||
|  |    </property> | ||||||
|  |    <property name="text"> | ||||||
|  |     <string>Display Dock Widget Headers</string> | ||||||
|  |    </property> | ||||||
|  |   </action> | ||||||
|  </widget> |  </widget> | ||||||
|  <resources/> |  <resources/> | ||||||
|  <connections> |  <connections> | ||||||
| @ -167,8 +176,25 @@ | |||||||
|     </hint> |     </hint> | ||||||
|    </hints> |    </hints> | ||||||
|   </connection> |   </connection> | ||||||
|  |   <connection> | ||||||
|  |    <sender>actionDisplay_widget_title_bars</sender> | ||||||
|  |    <signal>triggered(bool)</signal> | ||||||
|  |    <receiver>MainWindow</receiver> | ||||||
|  |    <slot>OnDisplayTitleBars(bool)</slot> | ||||||
|  |    <hints> | ||||||
|  |     <hint type="sourcelabel"> | ||||||
|  |      <x>-1</x> | ||||||
|  |      <y>-1</y> | ||||||
|  |     </hint> | ||||||
|  |     <hint type="destinationlabel"> | ||||||
|  |      <x>540</x> | ||||||
|  |      <y>364</y> | ||||||
|  |     </hint> | ||||||
|  |    </hints> | ||||||
|  |   </connection> | ||||||
|  </connections> |  </connections> | ||||||
|  <slots> |  <slots> | ||||||
|   <slot>OnConfigure()</slot> |   <slot>OnConfigure()</slot> | ||||||
|  |   <slot>OnDisplayTitleBars(bool)</slot> | ||||||
|  </slots> |  </slots> | ||||||
| </ui> | </ui> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Kingcom
						Kingcom