mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 09:51:03 +00:00
QT: Add a placeholder for the render window when it's hidden
This commit is contained in:
parent
80e9064179
commit
c753c8f905
@ -57,6 +57,8 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)
|
||||
ui.setupUi(this);
|
||||
statusBar()->hide();
|
||||
|
||||
render_window_placeholder = new QSpacerItem(400, 480, QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
|
||||
render_window = new GRenderWindow(this, emu_thread.get());
|
||||
render_window->hide();
|
||||
|
||||
@ -230,6 +232,7 @@ void GMainWindow::BootGame(std::string filename) {
|
||||
// Update the GUI
|
||||
registersWidget->OnDebugModeEntered();
|
||||
callstackWidget->OnDebugModeEntered();
|
||||
ui.horizontalLayout->removeItem(render_window_placeholder);
|
||||
render_window->show();
|
||||
|
||||
OnStartGame();
|
||||
@ -259,6 +262,7 @@ void GMainWindow::ShutdownGame() {
|
||||
ui.action_Pause->setEnabled(false);
|
||||
ui.action_Stop->setEnabled(false);
|
||||
render_window->hide();
|
||||
ui.horizontalLayout->addSpacerItem(render_window_placeholder);
|
||||
}
|
||||
|
||||
void GMainWindow::OnMenuLoadFile()
|
||||
@ -318,11 +322,14 @@ void GMainWindow::ToggleWindowMode() {
|
||||
ui.horizontalLayout->addWidget(render_window);
|
||||
if (emu_thread != nullptr)
|
||||
render_window->setVisible(true);
|
||||
else
|
||||
ui.horizontalLayout->addSpacerItem(render_window_placeholder);
|
||||
render_window->setFocusPolicy(Qt::ClickFocus);
|
||||
render_window->setFocus();
|
||||
|
||||
} else {
|
||||
// Render in a separate window...
|
||||
ui.horizontalLayout->removeItem(render_window_placeholder);
|
||||
ui.horizontalLayout->removeWidget(render_window);
|
||||
render_window->setParent(nullptr);
|
||||
if (emu_thread != nullptr)
|
||||
|
@ -75,6 +75,7 @@ private slots:
|
||||
private:
|
||||
Ui::MainWindow ui;
|
||||
|
||||
QSpacerItem* render_window_placeholder;
|
||||
GRenderWindow* render_window;
|
||||
|
||||
std::unique_ptr<EmuThread> emu_thread;
|
||||
|
Loading…
Reference in New Issue
Block a user