Merge pull request #13883 from Dentomologist/fifoplayerwindow_geometry_fixes

FIFOPlayerWindow geometry fixes
This commit is contained in:
Tilka
2025-08-18 20:23:24 +01:00
committed by GitHub
3 changed files with 12 additions and 4 deletions

View File

@@ -83,6 +83,8 @@ FIFOPlayerWindow::FIFOPlayerWindow(FifoPlayer& fifo_player, FifoRecorder& fifo_r
FIFOPlayerWindow::~FIFOPlayerWindow() FIFOPlayerWindow::~FIFOPlayerWindow()
{ {
Settings::GetQSettings().setValue(QStringLiteral("fifoplayerwindow/geometry"), saveGeometry());
m_fifo_player.SetFileLoadedCallback({}); m_fifo_player.SetFileLoadedCallback({});
m_fifo_player.SetFrameWrittenCallback({}); m_fifo_player.SetFrameWrittenCallback({});
} }
@@ -168,6 +170,7 @@ void FIFOPlayerWindow::CreateWidgets()
layout->addWidget(info_group); layout->addWidget(info_group);
layout->addWidget(playback_group); layout->addWidget(playback_group);
layout->addWidget(recording_group); layout->addWidget(recording_group);
layout->addStretch();
layout->addWidget(m_button_box); layout->addWidget(m_button_box);
m_main_widget = new QWidget(this); m_main_widget = new QWidget(this);
@@ -188,6 +191,9 @@ void FIFOPlayerWindow::CreateWidgets()
void FIFOPlayerWindow::LoadSettings() void FIFOPlayerWindow::LoadSettings()
{ {
restoreGeometry(
Settings::GetQSettings().value(QStringLiteral("fifoplayerwindow/geometry")).toByteArray());
m_early_memory_updates->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_EARLY_MEMORY_UPDATES)); m_early_memory_updates->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_EARLY_MEMORY_UPDATES));
m_loop->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_LOOP_REPLAY)); m_loop->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_LOOP_REPLAY));
} }

View File

@@ -1379,8 +1379,8 @@ void MainWindow::ShowFIFOPlayer()
{ {
if (!m_fifo_window) if (!m_fifo_window)
{ {
m_fifo_window = new FIFOPlayerWindow(m_system.GetFifoPlayer(), m_system.GetFifoRecorder()); m_fifo_window.reset(new FIFOPlayerWindow(m_system.GetFifoPlayer(), m_system.GetFifoRecorder()));
connect(m_fifo_window, &FIFOPlayerWindow::LoadFIFORequested, this, connect(m_fifo_window.get(), &FIFOPlayerWindow::LoadFIFORequested, this,
[this](const QString& path) { StartGame(path, ScanForSecondDisc::No); }); [this](const QString& path) { StartGame(path, ScanForSecondDisc::No); });
} }

View File

@@ -16,6 +16,7 @@
#endif // USE_RETRO_ACHIEVEMENTS #endif // USE_RETRO_ACHIEVEMENTS
#include "Core/Boot/Boot.h" #include "Core/Boot/Boot.h"
#include "DolphinQt/FIFO/FIFOPlayerWindow.h"
class QMenu; class QMenu;
class QStackedWidget; class QStackedWidget;
@@ -29,7 +30,6 @@ class CheatsManager;
class CodeWidget; class CodeWidget;
class DiscordHandler; class DiscordHandler;
class DragEnterEvent; class DragEnterEvent;
class FIFOPlayerWindow;
class FreeLookWindow; class FreeLookWindow;
class GameList; class GameList;
class GBATASInputWindow; class GBATASInputWindow;
@@ -245,7 +245,9 @@ private:
std::unique_ptr<BootParameters> m_pending_boot; std::unique_ptr<BootParameters> m_pending_boot;
SettingsWindow* m_settings_window = nullptr; SettingsWindow* m_settings_window = nullptr;
FIFOPlayerWindow* m_fifo_window = nullptr; // m_fifo_window doesn't set MainWindow as its parent so that the fifo can be focused without
// raising the main window, so use a unique_ptr to make sure it gets destroyed.
std::unique_ptr<FIFOPlayerWindow> m_fifo_window = nullptr;
SkylanderPortalWindow* m_skylander_window = nullptr; SkylanderPortalWindow* m_skylander_window = nullptr;
InfinityBaseWindow* m_infinity_window = nullptr; InfinityBaseWindow* m_infinity_window = nullptr;
WiiSpeakWindow* m_wii_speak_window = nullptr; WiiSpeakWindow* m_wii_speak_window = nullptr;