Windows: fix window icon being replaced
Dunno why it happens but the fix was literally 2 lines, so whatever I guess Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
This commit is contained in:
parent
4d4dfab388
commit
cc5f82bfac
@ -2112,6 +2112,10 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
|||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico");
|
iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico");
|
||||||
|
|
||||||
|
// part of fix for weird bug involving the window icon being replaced
|
||||||
|
// dunno why it happens, but this 2-line fix seems to be enough, so w/e
|
||||||
|
auto appIcon = QGuiApplication::windowIcon();
|
||||||
|
|
||||||
QFile iconFile(iconPath);
|
QFile iconFile(iconPath);
|
||||||
if (!iconFile.open(QFile::WriteOnly))
|
if (!iconFile.open(QFile::WriteOnly))
|
||||||
{
|
{
|
||||||
@ -2129,6 +2133,9 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
|||||||
|
|
||||||
iconFile.close();
|
iconFile.close();
|
||||||
iconGenerated = true;
|
iconGenerated = true;
|
||||||
|
|
||||||
|
// restore original window icon
|
||||||
|
QGuiApplication::setWindowIcon(appIcon);
|
||||||
#else
|
#else
|
||||||
iconPath = icon->getFilePath();
|
iconPath = icon->getFilePath();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user