From e55018f99e60f9ae4c368daccfa7fd3cbbbd1b6d Mon Sep 17 00:00:00 2001 From: Live session user Date: Thu, 29 Feb 2024 21:08:41 -0800 Subject: [PATCH] add window icon --- .reuse/dep5 | 1 + CMakeLists.txt | 2 ++ src/qt_gui/game_install_dialog.cpp | 1 + src/qt_gui/main_window_ui.h | 3 +++ src/resources.qrc | 5 +++++ 5 files changed, 12 insertions(+) create mode 100644 src/resources.qrc diff --git a/.reuse/dep5 b/.reuse/dep5 index 9eaf57812..29661ab04 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -11,5 +11,6 @@ Files: CMakeSettings.json .gitmodules src/images/shadps4.ico src/shadps4.rc + src/resources.qrc Copyright: shadPS4 Emulator Project License: GPL-2.0-or-later diff --git a/CMakeLists.txt b/CMakeLists.txt index c46eaa179..be8bb9180 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses if(ENABLE_QT_GUI) find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent) qt_standard_project_setup() + set(CMAKE_AUTORCC ON) endif() # This function should be passed a list of all files in a target. It will automatically generate @@ -166,6 +167,7 @@ if(ENABLE_QT_GUI) src/qt_gui/main_window_themes.cpp src/qt_gui/main_window_themes.h src/qt_gui/main.cpp + src/resources.qrc ) endif() diff --git a/src/qt_gui/game_install_dialog.cpp b/src/qt_gui/game_install_dialog.cpp index 1fa6880b5..3ae78da99 100644 --- a/src/qt_gui/game_install_dialog.cpp +++ b/src/qt_gui/game_install_dialog.cpp @@ -24,6 +24,7 @@ GameInstallDialog::GameInstallDialog(std::shared_ptr gui_settings) layout->addWidget(SetupDialogActions()); setWindowTitle("Shadps4 - Choose directory"); + setWindowIcon(QIcon(":/images/shadps4.ico")); } GameInstallDialog::~GameInstallDialog() {} diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index c467911d4..9d7ecdadc 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -64,6 +64,9 @@ public: if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName("MainWindow"); MainWindow->resize(1058, 580); + QIcon icon; + icon.addFile(QString::fromUtf8(":/images/shadps4.ico"), QSize(), QIcon::Normal, QIcon::Off); + MainWindow->setWindowIcon(icon); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); diff --git a/src/resources.qrc b/src/resources.qrc new file mode 100644 index 000000000..2d98b4f67 --- /dev/null +++ b/src/resources.qrc @@ -0,0 +1,5 @@ + + + images/shadps4.ico + +