summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2015-01-20 23:17:42 +0100
committerGravatar Tony Wasserka2015-01-20 23:17:42 +0100
commit8946df97b5113fbec4289b0a66cb565bdfd2136e (patch)
tree827f36283c4d847020c4bc51e6066fd727cb45c3 /src
parentMerge pull request #498 from lioncash/statics (diff)
parentcitra-qt: Add option to hide dock widget title bars (diff)
downloadyuzu-8946df97b5113fbec4289b0a66cb565bdfd2136e.tar.gz
yuzu-8946df97b5113fbec4289b0a66cb565bdfd2136e.tar.xz
yuzu-8946df97b5113fbec4289b0a66cb565bdfd2136e.zip
Merge pull request #429 from Kingcom/titlebar
Add option to hide dock widget title bars
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/main.cpp25
-rw-r--r--src/citra_qt/main.h1
-rw-r--r--src/citra_qt/main.ui94
3 files changed, 86 insertions, 34 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index ece593e5d..653ffec75 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -114,6 +114,9 @@ GMainWindow::GMainWindow()
114 ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool()); 114 ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool());
115 ToggleWindowMode(); 115 ToggleWindowMode();
116 116
117 ui.actionDisplay_widget_title_bars->setChecked(settings.value("displayTitleBars", true).toBool());
118 OnDisplayTitleBars(ui.actionDisplay_widget_title_bars->isChecked());
119
117 // Setup connections 120 // Setup connections
118 connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile())); 121 connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
119 connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap())); 122 connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap()));
@@ -160,6 +163,27 @@ GMainWindow::~GMainWindow()
160 Pica::g_debug_context.reset(); 163 Pica::g_debug_context.reset();
161} 164}
162 165
166void GMainWindow::OnDisplayTitleBars(bool show)
167{
168 QList<QDockWidget*> widgets = findChildren<QDockWidget*>();
169
170 if (show) {
171 for (QDockWidget* widget: widgets) {
172 QWidget* old = widget->titleBarWidget();
173 widget->setTitleBarWidget(nullptr);
174 if (old != nullptr)
175 delete old;
176 }
177 } else {
178 for (QDockWidget* widget: widgets) {
179 QWidget* old = widget->titleBarWidget();
180 widget->setTitleBarWidget(new QWidget());
181 if (old != nullptr)
182 delete old;
183 }
184 }
185}
186
163void GMainWindow::BootGame(std::string filename) 187void GMainWindow::BootGame(std::string filename)
164{ 188{
165 LOG_INFO(Frontend, "Citra starting...\n"); 189 LOG_INFO(Frontend, "Citra starting...\n");
@@ -263,6 +287,7 @@ void GMainWindow::closeEvent(QCloseEvent* event)
263 settings.setValue("state", saveState()); 287 settings.setValue("state", saveState());
264 settings.setValue("geometryRenderWindow", render_window->saveGeometry()); 288 settings.setValue("geometryRenderWindow", render_window->saveGeometry());
265 settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); 289 settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
290 settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked());
266 settings.setValue("firstStart", false); 291 settings.setValue("firstStart", false);
267 SaveHotkeys(settings); 292 SaveHotkeys(settings);
268 293
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 72df17c50..dd53489dd 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -46,6 +46,7 @@ private slots:
46 void OnMenuLoadSymbolMap(); 46 void OnMenuLoadSymbolMap();
47 void OnOpenHotkeysDialog(); 47 void OnOpenHotkeysDialog();
48 void OnConfigure(); 48 void OnConfigure();
49 void OnDisplayTitleBars(bool);
49 void ToggleWindowMode(); 50 void ToggleWindowMode();
50 51
51private: 52private:
diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui
index d06c207a0..a3752ac1e 100644
--- a/src/citra_qt/main.ui
+++ b/src/citra_qt/main.ui
@@ -32,7 +32,7 @@
32 <x>0</x> 32 <x>0</x>
33 <y>0</y> 33 <y>0</y>
34 <width>1081</width> 34 <width>1081</width>
35 <height>20</height> 35 <height>21</height>
36 </rect> 36 </rect>
37 </property> 37 </property>
38 <widget class="QMenu" name="menu_File"> 38 <widget class="QMenu" name="menu_File">
@@ -59,6 +59,7 @@
59 <string>&amp;View</string> 59 <string>&amp;View</string>
60 </property> 60 </property>
61 <addaction name="action_Single_Window_Mode"/> 61 <addaction name="action_Single_Window_Mode"/>
62 <addaction name="actionDisplay_widget_title_bars"/>
62 <addaction name="action_Hotkeys"/> 63 <addaction name="action_Hotkeys"/>
63 </widget> 64 </widget>
64 <widget class="QMenu" name="menu_Help"> 65 <widget class="QMenu" name="menu_Help">
@@ -73,17 +74,17 @@
73 <addaction name="menu_Help"/> 74 <addaction name="menu_Help"/>
74 </widget> 75 </widget>
75 <widget class="QStatusBar" name="statusbar"/> 76 <widget class="QStatusBar" name="statusbar"/>
76 <action name="action_Load_File"> 77 <action name="action_Load_File">
77 <property name="text"> 78 <property name="text">
78 <string>Load File...</string> 79 <string>Load File...</string>
79 </property> 80 </property>
80 </action> 81 </action>
81 <action name="action_Load_Symbol_Map"> 82 <action name="action_Load_Symbol_Map">
82 <property name="text"> 83 <property name="text">
83 <string>Load Symbol Map...</string> 84 <string>Load Symbol Map...</string>
84 </property> 85 </property>
85 </action> 86 </action>
86 <action name="action_Exit"> 87 <action name="action_Exit">
87 <property name="text"> 88 <property name="text">
88 <string>E&amp;xit</string> 89 <string>E&amp;xit</string>
89 </property> 90 </property>
@@ -101,28 +102,28 @@
101 <string>&amp;Pause</string> 102 <string>&amp;Pause</string>
102 </property> 103 </property>
103 </action> 104 </action>
104 <action name="action_Stop"> 105 <action name="action_Stop">
105 <property name="enabled"> 106 <property name="enabled">
106 <bool>false</bool> 107 <bool>false</bool>
107 </property> 108 </property>
108 <property name="text"> 109 <property name="text">
109 <string>&amp;Stop</string> 110 <string>&amp;Stop</string>
110 </property> 111 </property>
111 </action> 112 </action>
112 <action name="action_About"> 113 <action name="action_About">
113 <property name="text"> 114 <property name="text">
114 <string>About Citra</string> 115 <string>About Citra</string>
115 </property> 116 </property>
116 </action> 117 </action>
117 <action name="action_Single_Window_Mode"> 118 <action name="action_Single_Window_Mode">
118 <property name="checkable"> 119 <property name="checkable">
119 <bool>true</bool> 120 <bool>true</bool>
120 </property> 121 </property>
121 <property name="text"> 122 <property name="text">
122 <string>Single Window Mode</string> 123 <string>Single Window Mode</string>
123 </property> 124 </property>
124 </action> 125 </action>
125 <action name="action_Hotkeys"> 126 <action name="action_Hotkeys">
126 <property name="text"> 127 <property name="text">
127 <string>Configure &amp;Hotkeys ...</string> 128 <string>Configure &amp;Hotkeys ...</string>
128 </property> 129 </property>
@@ -132,6 +133,14 @@
132 <string>Configure ...</string> 133 <string>Configure ...</string>
133 </property> 134 </property>
134 </action> 135 </action>
136 <action name="actionDisplay_widget_title_bars">
137 <property name="checkable">
138 <bool>true</bool>
139 </property>
140 <property name="text">
141 <string>Display Dock Widget Headers</string>
142 </property>
143 </action>
135 </widget> 144 </widget>
136 <resources/> 145 <resources/>
137 <connections> 146 <connections>
@@ -167,8 +176,25 @@
167 </hint> 176 </hint>
168 </hints> 177 </hints>
169 </connection> 178 </connection>
179 <connection>
180 <sender>actionDisplay_widget_title_bars</sender>
181 <signal>triggered(bool)</signal>
182 <receiver>MainWindow</receiver>
183 <slot>OnDisplayTitleBars(bool)</slot>
184 <hints>
185 <hint type="sourcelabel">
186 <x>-1</x>
187 <y>-1</y>
188 </hint>
189 <hint type="destinationlabel">
190 <x>540</x>
191 <y>364</y>
192 </hint>
193 </hints>
194 </connection>
170 </connections> 195 </connections>
171 <slots> 196 <slots>
172 <slot>OnConfigure()</slot> 197 <slot>OnConfigure()</slot>
198 <slot>OnDisplayTitleBars(bool)</slot>
173 </slots> 199 </slots>
174</ui> 200</ui>