Merge pull request #12888 from TryTwo/Fix_Window_Titlebar

MainWindow: Bugfix. Windows Dark mode titlebar not being set.
This commit is contained in:
Admiral H. Curtiss 2024-07-04 21:13:19 +02:00 committed by GitHub
commit bb4e8d0d01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 18 deletions

View File

@ -251,7 +251,6 @@ int main(int argc, char* argv[])
Settings::Instance().ApplyStyle(); Settings::Instance().ApplyStyle();
MainWindow win{std::move(boot), static_cast<const char*>(options.get("movie"))}; MainWindow win{std::move(boot), static_cast<const char*>(options.get("movie"))};
win.Show();
#if defined(USE_ANALYTICS) && USE_ANALYTICS #if defined(USE_ANALYTICS) && USE_ANALYTICS
if (!Config::Get(Config::MAIN_ANALYTICS_PERMISSION_ASKED)) if (!Config::Get(Config::MAIN_ANALYTICS_PERMISSION_ASKED))

View File

@ -240,7 +240,10 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray()); restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray());
restoreGeometry(settings.value(QStringLiteral("mainwindow/geometry")).toByteArray()); restoreGeometry(settings.value(QStringLiteral("mainwindow/geometry")).toByteArray());
if (!Settings::Instance().IsBatchModeEnabled()) if (!Settings::Instance().IsBatchModeEnabled())
{
SetQWidgetWindowDecorations(this);
show(); show();
}
InitControllers(); InitControllers();
ConnectHotkeys(); ConnectHotkeys();
@ -320,6 +323,12 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
} }
Host::GetInstance()->SetMainWindowHandle(reinterpret_cast<void*>(winId())); Host::GetInstance()->SetMainWindowHandle(reinterpret_cast<void*>(winId()));
if (m_pending_boot != nullptr)
{
StartGame(std::move(m_pending_boot));
m_pending_boot.reset();
}
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -2072,19 +2081,3 @@ void MainWindow::ShowRiivolutionBootWidget(const UICommon::GameFile& game)
AddRiivolutionPatches(boot_params.get(), std::move(w.GetPatches())); AddRiivolutionPatches(boot_params.get(), std::move(w.GetPatches()));
StartGame(std::move(boot_params)); StartGame(std::move(boot_params));
} }
void MainWindow::Show()
{
if (!Settings::Instance().IsBatchModeEnabled())
{
SetQWidgetWindowDecorations(this);
QWidget::show();
}
// If the booting of a game was requested on start up, do that now
if (m_pending_boot != nullptr)
{
StartGame(std::move(m_pending_boot));
m_pending_boot.reset();
}
}

View File

@ -78,7 +78,6 @@ public:
const std::string& movie_path); const std::string& movie_path);
~MainWindow(); ~MainWindow();
void Show();
WindowSystemInfo GetWindowSystemInfo() const; WindowSystemInfo GetWindowSystemInfo() const;
bool eventFilter(QObject* object, QEvent* event) override; bool eventFilter(QObject* object, QEvent* event) override;