diff options
| author | 2015-01-06 16:09:30 +0100 | |
|---|---|---|
| committer | 2015-01-20 22:50:24 +0100 | |
| commit | 76c74ffc9633a9c69062f0477f84592fb899203a (patch) | |
| tree | ef1f5d5028a0835c4ce794fe0241e6841a4a932c /src/citra_qt/main.cpp | |
| parent | Merge pull request #402 from chrisvj/master (diff) | |
| download | yuzu-76c74ffc9633a9c69062f0477f84592fb899203a.tar.gz yuzu-76c74ffc9633a9c69062f0477f84592fb899203a.tar.xz yuzu-76c74ffc9633a9c69062f0477f84592fb899203a.zip | |
citra-qt: 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 c6671bef1..3e7b5ddfe 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())); |
| @@ -156,6 +159,27 @@ GMainWindow::~GMainWindow() | |||
| 156 | Pica::g_debug_context.reset(); | 159 | Pica::g_debug_context.reset(); |
| 157 | } | 160 | } |
| 158 | 161 | ||
| 162 | void GMainWindow::OnDisplayTitleBars(bool show) | ||
| 163 | { | ||
| 164 | QList<QDockWidget*> widgets = findChildren<QDockWidget*>(); | ||
| 165 | |||
| 166 | if (show) { | ||
| 167 | for (QDockWidget* widget: widgets) { | ||
| 168 | QWidget* old = widget->titleBarWidget(); | ||
| 169 | widget->setTitleBarWidget(nullptr); | ||
| 170 | if (old != nullptr) | ||
| 171 | delete old; | ||
| 172 | } | ||
| 173 | } else { | ||
| 174 | for (QDockWidget* widget: widgets) { | ||
| 175 | QWidget* old = widget->titleBarWidget(); | ||
| 176 | widget->setTitleBarWidget(new QWidget()); | ||
| 177 | if (old != nullptr) | ||
| 178 | delete old; | ||
| 179 | } | ||
| 180 | } | ||
| 181 | } | ||
| 182 | |||
| 159 | void GMainWindow::BootGame(std::string filename) | 183 | void GMainWindow::BootGame(std::string filename) |
| 160 | { | 184 | { |
| 161 | LOG_INFO(Frontend, "Citra starting...\n"); | 185 | LOG_INFO(Frontend, "Citra starting...\n"); |
| @@ -259,6 +283,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) | |||
| 259 | settings.setValue("state", saveState()); | 283 | settings.setValue("state", saveState()); |
| 260 | settings.setValue("geometryRenderWindow", render_window->saveGeometry()); | 284 | settings.setValue("geometryRenderWindow", render_window->saveGeometry()); |
| 261 | settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); | 285 | settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); |
| 286 | settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked()); | ||
| 262 | settings.setValue("firstStart", false); | 287 | settings.setValue("firstStart", false); |
| 263 | SaveHotkeys(settings); | 288 | SaveHotkeys(settings); |
| 264 | 289 | ||