diff options
| author | 2015-01-20 23:17:42 +0100 | |
|---|---|---|
| committer | 2015-01-20 23:17:42 +0100 | |
| commit | 8946df97b5113fbec4289b0a66cb565bdfd2136e (patch) | |
| tree | 827f36283c4d847020c4bc51e6066fd727cb45c3 /src/citra_qt/main.cpp | |
| parent | Merge pull request #498 from lioncash/statics (diff) | |
| parent | citra-qt: Add option to hide dock widget title bars (diff) | |
| download | yuzu-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/citra_qt/main.cpp')
| -rw-r--r-- | src/citra_qt/main.cpp | 25 |
1 files changed, 25 insertions, 0 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 | ||
| 166 | void 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 | |||
| 163 | void GMainWindow::BootGame(std::string filename) | 187 | void 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 | ||