mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-10 22:38:39 -05:00
Merge pull request #429 from Kingcom/titlebar
Add option to hide dock widget title bars
This commit is contained in:
@ -114,6 +114,9 @@ GMainWindow::GMainWindow()
|
||||
ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool());
|
||||
ToggleWindowMode();
|
||||
|
||||
ui.actionDisplay_widget_title_bars->setChecked(settings.value("displayTitleBars", true).toBool());
|
||||
OnDisplayTitleBars(ui.actionDisplay_widget_title_bars->isChecked());
|
||||
|
||||
// Setup connections
|
||||
connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
|
||||
connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap()));
|
||||
@ -160,6 +163,27 @@ GMainWindow::~GMainWindow()
|
||||
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)
|
||||
{
|
||||
LOG_INFO(Frontend, "Citra starting...\n");
|
||||
@ -263,6 +287,7 @@ void GMainWindow::closeEvent(QCloseEvent* event)
|
||||
settings.setValue("state", saveState());
|
||||
settings.setValue("geometryRenderWindow", render_window->saveGeometry());
|
||||
settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
|
||||
settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked());
|
||||
settings.setValue("firstStart", false);
|
||||
SaveHotkeys(settings);
|
||||
|
||||
|
Reference in New Issue
Block a user