diff --git a/.github/workflows/build.linux.workflow.yml b/.github/workflows/build.linux.workflow.yml index eb0fc990..845fecf1 100644 --- a/.github/workflows/build.linux.workflow.yml +++ b/.github/workflows/build.linux.workflow.yml @@ -52,10 +52,6 @@ jobs: run: | sudo sed -i 's/azure\.//' /etc/apt/sources.list - - name: Remove windows-only qt version override in vcpkg.json - run: | - sed -i '/For Windows only/d' ${{ github.workspace }}/gui/qt/vcpkg.json - - name: Install dependencies run: | set -e diff --git a/.github/workflows/build.mac.workflow.yml b/.github/workflows/build.mac.workflow.yml index 28fd5ea6..229f9da3 100644 --- a/.github/workflows/build.mac.workflow.yml +++ b/.github/workflows/build.mac.workflow.yml @@ -45,10 +45,6 @@ jobs: with: submodules: 'recursive' - - name: Remove windows-only qt version override in vcpkg.json - run: | - sed -i '' '/For Windows only/d' ${{ github.workspace }}/gui/qt/vcpkg.json - - name: Install dependencies run: | set -e diff --git a/gui/qt/CMakeLists.txt b/gui/qt/CMakeLists.txt index 27079500..68ce1294 100644 --- a/gui/qt/CMakeLists.txt +++ b/gui/qt/CMakeLists.txt @@ -73,7 +73,10 @@ endif() include(GNUInstallDirs) find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core) -find_package(Qt6 REQUIRED COMPONENTS DBus Gui Network Widgets) +find_package(Qt6 REQUIRED COMPONENTS Gui Network Widgets) +if(NOT WIN32) + find_package(Qt6 COMPONENTS DBus) +endif() set(CMAKE_AUTORCC ON) set(CMAKE_AUTOMOC ON) @@ -284,10 +287,12 @@ endif() target_link_libraries(CEmu PRIVATE Qt::Core Qt::Gui - Qt::DBus # needed at runtime by QtGui for some reason...? Qt::Network Qt::Widgets ) +if(TARGET Qt::DBus) + target_link_libraries(CEmu PRIVATE Qt::DBus) +endif() include(CheckIPOSupported) check_ipo_supported(RESULT lto_supported OUTPUT error) diff --git a/gui/qt/main.cpp b/gui/qt/main.cpp index 700554c2..c028fbba 100644 --- a/gui/qt/main.cpp +++ b/gui/qt/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include int main(int argc, char *argv[]) { @@ -16,6 +17,16 @@ int main(int argc, char *argv[]) { #endif QApplication app(argc, argv); +#if defined(Q_OS_WIN) + const QString kDesiredStyle = QStringLiteral("WindowsVista"); + const auto availableStyles = QStyleFactory::keys(); + if (availableStyles.contains(kDesiredStyle, Qt::CaseInsensitive)) { + QApplication::setStyle(QStyleFactory::create(kDesiredStyle)); + } else if (availableStyles.contains(QStringLiteral("Fusion"), Qt::CaseInsensitive)) { + QApplication::setStyle(QStyleFactory::create(QStringLiteral("Fusion"))); + } +#endif + QCoreApplication::setOrganizationName(QStringLiteral("cemu-dev")); QCoreApplication::setApplicationName(QStringLiteral("CEmu")); QCoreApplication::setApplicationVersion(QStringLiteral(CEMU_VERSION " (git: " CEMU_GIT_SHA ")")); diff --git a/gui/qt/vcpkg.json b/gui/qt/vcpkg.json index 4b772163..02edd435 100644 --- a/gui/qt/vcpkg.json +++ b/gui/qt/vcpkg.json @@ -18,17 +18,21 @@ { "name": "qtbase", "default-features": false, - "features": [ "dbus", "gui", "network", "widgets", "png" ] + "features": [ "gui", "network", "widgets", "png" ], + "platform": "windows" }, { "name": "qtbase", "default-features": false, - "features": [ "fontconfig", "xcb" ], + "features": [ "gui", "network", "widgets", "png", "dbus" ], + "platform": "osx" + }, + { + "name": "qtbase", + "default-features": false, + "features": [ "gui", "network", "widgets", "png", "dbus", "fontconfig", "xcb" ], "platform": "linux" } ], - "builtin-baseline": "a62ce77d56ee07513b4b67de1ec2daeaebfae51a", - "overrides": [ - { "name": "qtbase", "version": "6.6.3", "$comment": "For Windows only due to UI issues later. For non-Windows, edited out in CI" } - ] -} \ No newline at end of file + "builtin-baseline": "a62ce77d56ee07513b4b67de1ec2daeaebfae51a" +}