diff --git a/.github/workflows/stable-compilation.yml b/.github/workflows/stable-compilation.yml index b7333404..4c46c543 100644 --- a/.github/workflows/stable-compilation.yml +++ b/.github/workflows/stable-compilation.yml @@ -9,13 +9,17 @@ on: description: Git Ref (Optional) required: false +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + defaults: run: shell: bash jobs: flatpak: - name: "Flatpak" + name: "Flatpak (x86_64)" runs-on: ubuntu-latest container: image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10 @@ -48,33 +52,36 @@ jobs: name: ubuntu-24.04-arm steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.8.0 - - - name: Install dependencies + - &deps + name: Install dependencies run: | export DEBIAN_FRONTEND="noninteractive" apt-get update apt-get install -yqq --no-install-recommends --no-install-suggests \ ca-certificates build-essential cmake ninja-build git \ - curl zip unzip tar tzdata + libicu-dev curl zip unzip tar tzdata - - name: Install Qt6 + - &qt6 + name: Install Qt6 uses: jurplel/install-qt-action@v4 with: version: '6.10.1' install-deps: 'nosudo' - modules: 'qtmultimedia qtshadertools' + modules: 'qtmultimedia qtshadertools qtwaylandcompositor' - - name: Install vcpkg + - &vcpkg + name: Install vcpkg run: | git clone https://github.com/Microsoft/vcpkg.git ../vcpkg - - name: Clone Repository - uses: actions/checkout@v2 + - &clone + name: Clone Repository + uses: actions/checkout@v6 if: github.event.inputs.git-ref == '' - - name: Clone Repository (with custom ref) - uses: actions/checkout@v2 + + - &cloneref + name: Clone Repository (with custom ref) + uses: actions/checkout@v6 if: github.event.inputs.git-ref != '' with: ref: ${{ github.event.inputs.git-ref }} @@ -93,3 +100,64 @@ jobs: - name: Install run: | cmake --build --preset vcpkg-liblcf-release --target install + + appimage: + name: "AppImage (x86_64)" + runs-on: ubuntu-latest + container: + image: ubuntu:24.04 + options: --privileged + + steps: + - *deps + + - name: Install linuxdeploy dependencies + run: | + export DEBIAN_FRONTEND="noninteractive" + apt-get install -yqq --no-install-recommends --no-install-suggests \ + file fuse + + - *qt6 + - *vcpkg + - *clone + - *cloneref + + - name: Download linuxdeploy + run: | + curl -LO https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + chmod +x linuxdeploy-x86_64.AppImage + + - name: Download linuxdeploy qt plugin + run: | + curl -LO https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage + chmod +x linuxdeploy-plugin-qt-x86_64.AppImage + + - name: Compile + run: | + export VCPKG_ROOT=$PWD/../vcpkg + export Qt6_Path=$QT_ROOT_DIR + cmake --preset vcpkg-liblcf-release -DCMAKE_INSTALL_PREFIX=AppDir \ + -DCMAKE_PREFIX_PATH=$QT_ROOT_DIR + cmake --build --preset vcpkg-liblcf-release + + - name: Install + run: | + cmake --build --preset vcpkg-liblcf-release --target install + + - name: Build AppImage + run: | + export EXTRA_QT_PLUGINS=waylandcompositor + export QML_SOURCES_PATHS="$PWD/src/ui" + ./linuxdeploy-x86_64.AppImage \ + --appdir AppDir \ + --executable AppDir/bin/easyrpg-editor \ + --desktop-file AppDir/share/applications/easyrpg-editor.desktop \ + --icon-file AppDir/share/icons/hicolor/48x48/apps/easyrpg-editor.png \ + --output appimage \ + --plugin qt + + - name: Upload AppImage artifact + uses: actions/upload-artifact@v4 + with: + name: EasyRPG-Editor-AppImage + path: ./EasyRPG*.AppImage diff --git a/CMakeLists.txt b/CMakeLists.txt index cea25999..cdf88de0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,9 @@ cmake_policy(SET CMP0091 NEW) # Support MSVC_RUNTIME_LIBRARY project(EasyRPG_Editor VERSION 0.1.0 LANGUAGES CXX) -# Qt6 and KF6 required -set(REQUIRED_QT_VERSION "6.11.0") -set(KF_DEP_VERSION "6.11.0") - # Extra CMake Module files -find_package(ECM ${KF_DEP_VERSION} REQUIRED) +set(REQUIRED_QT_VERSION "6.10.1") +find_package(ECM ${REQUIRED_QT_VERSION} REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/Modules" ${ECM_MODULE_PATH}) include(EditorConfigureWindows) @@ -334,14 +331,16 @@ set(EDITOR_QML_INTERFACE ) # Dependencies -find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) +set(QT_NO_PRIVATE_MODULE_WARNING ON) +find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui GuiPrivate Svg QuickControls2) find_package(Qt6LinguistTools CONFIG QUIET) find_package(ZLIB REQUIRED) find_package(glaze REQUIRED) find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Kirigami) +find_package(QQC2BreezeStyle REQUIRED) qt_standard_project_setup( - REQUIRES "6.10.1" + REQUIRES "${REQUIRED_QT_VERSION}" ) # Executable @@ -471,6 +470,35 @@ target_link_libraries(${EXE_NAME} PRIVATE Qt6::QuickControls2 ) +get_target_property(KIRIGAMI_TYPE KF6::Kirigami TYPE) +message(STATUS "Kirigami library type: ${KIRIGAMI_TYPE}") +if(KIRIGAMI_TYPE STREQUAL "STATIC_LIBRARY") + # Why is this so difficult? Kirigami bug? + target_link_libraries(${EXE_NAME} PRIVATE + KF6::Kirigami + KF6Kirigamiplugin + KF6KirigamiTemplatesplugin + KF6KirigamiDialogsplugin + KF6KirigamiDelegatesplugin + KF6KirigamiLayoutsplugin + KF6KirigamiLayoutsPrivateplugin + KF6KirigamiPrimitivesplugin + KF6KirigamiPrivateplugin + KF6KirigamiPolyfillplugin + ) +endif() + +get_target_property(QQC2_TYPE org.kde.breeze TYPE) +message(STATUS "BreezeStyle library type: ${QQC2_TYPE}") +if(QQC2_TYPE STREQUAL "STATIC_LIBRARY") + target_link_libraries(${EXE_NAME} PRIVATE + BreezeStyle + BreezeImpl + ) +endif() + +qt_import_qml_plugins(${EXE_NAME}) + # Add resources target_sources(${EXE_NAME} PRIVATE "resources/Resources.qrc") @@ -495,11 +523,6 @@ else() message(STATUS "Disabling translation support") endif() -# Kirigami QML import path to make developing easier when using vcpkg -if (DEFINED VCPKG_TARGET_TRIPLET) - target_compile_options(${EXE_NAME} PUBLIC "-DQML_EXTRA_IMPORT_PATHS=\"${VCPKG_DIR}/lib/qml\"") -endif() - qt_finalize_target(${EXE_NAME}) # Installation @@ -544,20 +567,10 @@ if(WIN32 OR APPLE) endif() if(WIN32) - # Copy DLL dependencies - install( - DIRECTORY ${VCPKG_DIR}/bin/ - DESTINATION ${CMAKE_INSTALL_BINDIR} - FILES_MATCHING - PATTERN "*.dll" - ) - # Copy Kirigami QML - install(DIRECTORY ${VCPKG_DIR}/lib/qml/ DESTINATION qml) - # Environment for the MSVC Debugger set_target_properties(${EXE_NAME} PROPERTIES VS_DEBUGGER_ENVIRONMENT - "PATH=${VCPKG_DIR}/bin;$ENV{Qt6_Path}/bin;%PATH%" + "PATH=$ENV{Qt6_Path}/bin;%PATH%" ) # Other dev environments diff --git a/CMakePresets.json b/CMakePresets.json index 4c18309c..1869dfb5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -129,7 +129,7 @@ { "name": "windows-parent", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-eze" }, "inherits": "win-user", "hidden": true @@ -141,7 +141,7 @@ "windows-parent", "type-debug" ], - "binaryDir": "${sourceDir}/build/win-debug" + "binaryDir": "${sourceDir}/build/win-dbg" }, { "name": "windows-relwithdebinfo", @@ -150,7 +150,7 @@ "windows-parent", "type-relwithdebinfo" ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + "binaryDir": "${sourceDir}/build/win-reld" }, { "name": "windows-release", @@ -159,7 +159,7 @@ "windows-parent", "type-release" ], - "binaryDir": "${sourceDir}/build/win-release" + "binaryDir": "${sourceDir}/build/win-rel" }, { "name": "windows-liblcf-debug", @@ -169,7 +169,7 @@ "windows-parent", "type-debug" ], - "binaryDir": "${sourceDir}/build/win-debug" + "binaryDir": "${sourceDir}/build/win-dbg" }, { "name": "windows-liblcf-relwithdebinfo", @@ -179,7 +179,7 @@ "windows-parent", "type-relwithdebinfo" ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + "binaryDir": "${sourceDir}/build/win-reld" }, { "name": "windows-liblcf-release", @@ -189,14 +189,14 @@ "windows-parent", "type-release" ], - "binaryDir": "${sourceDir}/build/win-release" + "binaryDir": "${sourceDir}/build/win-rel" }, { "name": "windows-x64-vs2022-parent", "generator": "Visual Studio 17 2022", "architecture": "x64", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "x64-windows-eze" }, "inherits": "win-user", "hidden": true @@ -208,7 +208,7 @@ "windows-x64-vs2022-parent", "type-debug" ], - "binaryDir": "${sourceDir}/build/win-debug" + "binaryDir": "${sourceDir}/build/win-dbg" }, { "name": "windows-x64-vs2022-relwithdebinfo", @@ -217,7 +217,7 @@ "windows-x64-vs2022-parent", "type-relwithdebinfo" ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + "binaryDir": "${sourceDir}/build/win-reld" }, { "name": "windows-x64-vs2022-release", @@ -226,7 +226,7 @@ "windows-x64-vs2022-parent", "type-release" ], - "binaryDir": "${sourceDir}/build/win-release" + "binaryDir": "${sourceDir}/build/win-rel" }, { "name": "windows-x64-vs2022-liblcf-debug", @@ -236,7 +236,7 @@ "windows-x64-vs2022-parent", "type-debug" ], - "binaryDir": "${sourceDir}/build/win-debug" + "binaryDir": "${sourceDir}/build/win-dbg" }, { "name": "windows-x64-vs2022-liblcf-relwithdebinfo", @@ -246,7 +246,7 @@ "windows-x64-vs2022-parent", "type-relwithdebinfo" ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + "binaryDir": "${sourceDir}/build/win-reld" }, { "name": "windows-x64-vs2022-liblcf-release", @@ -256,7 +256,7 @@ "windows-x64-vs2022-parent", "type-release" ], - "binaryDir": "${sourceDir}/build/win-release" + "binaryDir": "${sourceDir}/build/win-rel" }, { "name": "macos-parent", diff --git a/builds/CMakePresets.json b/builds/CMakePresets.json deleted file mode 100644 index 4c18309c..00000000 --- a/builds/CMakePresets.json +++ /dev/null @@ -1,532 +0,0 @@ -{ - "vendor": { - "README": { - "line1": "!!! GENERATED FILE. DO NOT EDIT !!!", - "line2": "Modify builds/cmake/CMakePresets.json.template instead", - "line3": "and run gen-cmake-presets.py to regenerate this file." - } - }, - "version": 4, - "cmakeMinimumRequired": { - "major": 3, - "minor": 23, - "patch": 0 - }, - "include": [ - "builds/cmake/CMakePresetsUser.json" - ], - "configurePresets": [ - { - "name": "parent", - "hidden": true, - "inherits": "base-user" - }, - { - "name": "debug", - "displayName": "System environment (Debug)", - "inherits": [ - "parent", - "type-debug" - ] - }, - { - "name": "relwithdebinfo", - "displayName": "System environment (RelWithDebInfo)", - "inherits": [ - "parent", - "type-relwithdebinfo" - ] - }, - { - "name": "release", - "displayName": "System environment (Release)", - "inherits": [ - "parent", - "type-release" - ] - }, - { - "name": "liblcf-debug", - "displayName": "System environment (build liblcf, Debug)", - "inherits": [ - "build-liblcf", - "parent", - "type-debug" - ] - }, - { - "name": "liblcf-relwithdebinfo", - "displayName": "System environment (build liblcf, RelWithDebInfo)", - "inherits": [ - "build-liblcf", - "parent", - "type-relwithdebinfo" - ] - }, - { - "name": "liblcf-release", - "displayName": "System environment (build liblcf, Release)", - "inherits": [ - "build-liblcf", - "parent", - "type-release" - ] - }, - { - "name": "vcpkg-debug", - "displayName": "System environment (install deps with vcpkg, Debug)", - "inherits": [ - "build-vcpkg", - "parent", - "type-debug" - ] - }, - { - "name": "vcpkg-relwithdebinfo", - "displayName": "System environment (install deps with vcpkg, RelWithDebInfo)", - "inherits": [ - "build-vcpkg", - "parent", - "type-relwithdebinfo" - ] - }, - { - "name": "vcpkg-release", - "displayName": "System environment (install deps with vcpkg, Release)", - "inherits": [ - "build-vcpkg", - "parent", - "type-release" - ] - }, - { - "name": "vcpkg-liblcf-debug", - "displayName": "System environment (install deps with vcpkg + build liblcf, Debug)", - "inherits": [ - "build-vcpkg-liblcf", - "parent", - "type-debug" - ] - }, - { - "name": "vcpkg-liblcf-relwithdebinfo", - "displayName": "System environment (install deps with vcpkg + build liblcf, RelWithDebInfo)", - "inherits": [ - "build-vcpkg-liblcf", - "parent", - "type-relwithdebinfo" - ] - }, - { - "name": "vcpkg-liblcf-release", - "displayName": "System environment (install deps with vcpkg + build liblcf, Release)", - "inherits": [ - "build-vcpkg-liblcf", - "parent", - "type-release" - ] - }, - { - "name": "windows-parent", - "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" - }, - "inherits": "win-user", - "hidden": true - }, - { - "name": "windows-debug", - "displayName": "Windows (Debug)", - "inherits": [ - "windows-parent", - "type-debug" - ], - "binaryDir": "${sourceDir}/build/win-debug" - }, - { - "name": "windows-relwithdebinfo", - "displayName": "Windows (RelWithDebInfo)", - "inherits": [ - "windows-parent", - "type-relwithdebinfo" - ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" - }, - { - "name": "windows-release", - "displayName": "Windows (Release)", - "inherits": [ - "windows-parent", - "type-release" - ], - "binaryDir": "${sourceDir}/build/win-release" - }, - { - "name": "windows-liblcf-debug", - "displayName": "Windows (build liblcf, Debug)", - "inherits": [ - "build-liblcf", - "windows-parent", - "type-debug" - ], - "binaryDir": "${sourceDir}/build/win-debug" - }, - { - "name": "windows-liblcf-relwithdebinfo", - "displayName": "Windows (build liblcf, RelWithDebInfo)", - "inherits": [ - "build-liblcf", - "windows-parent", - "type-relwithdebinfo" - ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" - }, - { - "name": "windows-liblcf-release", - "displayName": "Windows (build liblcf, Release)", - "inherits": [ - "build-liblcf", - "windows-parent", - "type-release" - ], - "binaryDir": "${sourceDir}/build/win-release" - }, - { - "name": "windows-x64-vs2022-parent", - "generator": "Visual Studio 17 2022", - "architecture": "x64", - "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" - }, - "inherits": "win-user", - "hidden": true - }, - { - "name": "windows-x64-vs2022-debug", - "displayName": "Windows (x64) using Visual Studio 2022 (Debug)", - "inherits": [ - "windows-x64-vs2022-parent", - "type-debug" - ], - "binaryDir": "${sourceDir}/build/win-debug" - }, - { - "name": "windows-x64-vs2022-relwithdebinfo", - "displayName": "Windows (x64) using Visual Studio 2022 (RelWithDebInfo)", - "inherits": [ - "windows-x64-vs2022-parent", - "type-relwithdebinfo" - ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" - }, - { - "name": "windows-x64-vs2022-release", - "displayName": "Windows (x64) using Visual Studio 2022 (Release)", - "inherits": [ - "windows-x64-vs2022-parent", - "type-release" - ], - "binaryDir": "${sourceDir}/build/win-release" - }, - { - "name": "windows-x64-vs2022-liblcf-debug", - "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Debug)", - "inherits": [ - "build-liblcf", - "windows-x64-vs2022-parent", - "type-debug" - ], - "binaryDir": "${sourceDir}/build/win-debug" - }, - { - "name": "windows-x64-vs2022-liblcf-relwithdebinfo", - "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, RelWithDebInfo)", - "inherits": [ - "build-liblcf", - "windows-x64-vs2022-parent", - "type-relwithdebinfo" - ], - "binaryDir": "${sourceDir}/build/win-relwithdebinfo" - }, - { - "name": "windows-x64-vs2022-liblcf-release", - "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Release)", - "inherits": [ - "build-liblcf", - "windows-x64-vs2022-parent", - "type-release" - ], - "binaryDir": "${sourceDir}/build/win-release" - }, - { - "name": "macos-parent", - "cacheVariables": { - "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos", - "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", - "CMAKE_OSX_ARCHITECTURES": "arm64" - }, - "environment": { - "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "hidden": true, - "inherits": "base-user" - }, - { - "name": "macos-debug", - "displayName": "macOS (Debug)", - "inherits": [ - "macos-parent", - "type-debug" - ] - }, - { - "name": "macos-relwithdebinfo", - "displayName": "macOS (RelWithDebInfo)", - "inherits": [ - "macos-parent", - "type-relwithdebinfo" - ] - }, - { - "name": "macos-release", - "displayName": "macOS (Release)", - "inherits": [ - "macos-parent", - "type-release" - ] - }, - { - "name": "macos-liblcf-debug", - "displayName": "macOS (build liblcf, Debug)", - "inherits": [ - "build-liblcf", - "macos-parent", - "type-debug" - ] - }, - { - "name": "macos-liblcf-relwithdebinfo", - "displayName": "macOS (build liblcf, RelWithDebInfo)", - "inherits": [ - "build-liblcf", - "macos-parent", - "type-relwithdebinfo" - ] - }, - { - "name": "macos-liblcf-release", - "displayName": "macOS (build liblcf, Release)", - "inherits": [ - "build-liblcf", - "macos-parent", - "type-release" - ] - }, - { - "name": "macos-vcpkg-debug", - "displayName": "macOS (install deps with vcpkg, Debug)", - "inherits": [ - "build-vcpkg", - "macos-parent", - "type-debug" - ] - }, - { - "name": "macos-vcpkg-relwithdebinfo", - "displayName": "macOS (install deps with vcpkg, RelWithDebInfo)", - "inherits": [ - "build-vcpkg", - "macos-parent", - "type-relwithdebinfo" - ] - }, - { - "name": "macos-vcpkg-release", - "displayName": "macOS (install deps with vcpkg, Release)", - "inherits": [ - "build-vcpkg", - "macos-parent", - "type-release" - ] - }, - { - "name": "macos-vcpkg-liblcf-debug", - "displayName": "macOS (install deps with vcpkg + build liblcf, Debug)", - "inherits": [ - "build-vcpkg-liblcf", - "macos-parent", - "type-debug" - ] - }, - { - "name": "macos-vcpkg-liblcf-relwithdebinfo", - "displayName": "macOS (install deps with vcpkg + build liblcf, RelWithDebInfo)", - "inherits": [ - "build-vcpkg-liblcf", - "macos-parent", - "type-relwithdebinfo" - ] - }, - { - "name": "macos-vcpkg-liblcf-release", - "displayName": "macOS (install deps with vcpkg + build liblcf, Release)", - "inherits": [ - "build-vcpkg-liblcf", - "macos-parent", - "type-release" - ] - } - ], - "buildPresets": [ - { - "name": "debug", - "configurePreset": "debug" - }, - { - "name": "relwithdebinfo", - "configurePreset": "relwithdebinfo" - }, - { - "name": "release", - "configurePreset": "release" - }, - { - "name": "liblcf-debug", - "configurePreset": "liblcf-debug" - }, - { - "name": "liblcf-relwithdebinfo", - "configurePreset": "liblcf-relwithdebinfo" - }, - { - "name": "liblcf-release", - "configurePreset": "liblcf-release" - }, - { - "name": "vcpkg-debug", - "configurePreset": "vcpkg-debug" - }, - { - "name": "vcpkg-relwithdebinfo", - "configurePreset": "vcpkg-relwithdebinfo" - }, - { - "name": "vcpkg-release", - "configurePreset": "vcpkg-release" - }, - { - "name": "vcpkg-liblcf-debug", - "configurePreset": "vcpkg-liblcf-debug" - }, - { - "name": "vcpkg-liblcf-relwithdebinfo", - "configurePreset": "vcpkg-liblcf-relwithdebinfo" - }, - { - "name": "vcpkg-liblcf-release", - "configurePreset": "vcpkg-liblcf-release" - }, - { - "name": "windows-debug", - "configurePreset": "windows-debug" - }, - { - "name": "windows-relwithdebinfo", - "configurePreset": "windows-relwithdebinfo" - }, - { - "name": "windows-release", - "configurePreset": "windows-release" - }, - { - "name": "windows-liblcf-debug", - "configurePreset": "windows-liblcf-debug" - }, - { - "name": "windows-liblcf-relwithdebinfo", - "configurePreset": "windows-liblcf-relwithdebinfo" - }, - { - "name": "windows-liblcf-release", - "configurePreset": "windows-liblcf-release" - }, - { - "name": "windows-x64-vs2022-debug", - "configurePreset": "windows-x64-vs2022-debug" - }, - { - "name": "windows-x64-vs2022-relwithdebinfo", - "configurePreset": "windows-x64-vs2022-relwithdebinfo" - }, - { - "name": "windows-x64-vs2022-release", - "configurePreset": "windows-x64-vs2022-release" - }, - { - "name": "windows-x64-vs2022-liblcf-debug", - "configurePreset": "windows-x64-vs2022-liblcf-debug" - }, - { - "name": "windows-x64-vs2022-liblcf-relwithdebinfo", - "configurePreset": "windows-x64-vs2022-liblcf-relwithdebinfo" - }, - { - "name": "windows-x64-vs2022-liblcf-release", - "configurePreset": "windows-x64-vs2022-liblcf-release" - }, - { - "name": "macos-debug", - "configurePreset": "macos-debug" - }, - { - "name": "macos-relwithdebinfo", - "configurePreset": "macos-relwithdebinfo" - }, - { - "name": "macos-release", - "configurePreset": "macos-release" - }, - { - "name": "macos-liblcf-debug", - "configurePreset": "macos-liblcf-debug" - }, - { - "name": "macos-liblcf-relwithdebinfo", - "configurePreset": "macos-liblcf-relwithdebinfo" - }, - { - "name": "macos-liblcf-release", - "configurePreset": "macos-liblcf-release" - }, - { - "name": "macos-vcpkg-debug", - "configurePreset": "macos-vcpkg-debug" - }, - { - "name": "macos-vcpkg-relwithdebinfo", - "configurePreset": "macos-vcpkg-relwithdebinfo" - }, - { - "name": "macos-vcpkg-release", - "configurePreset": "macos-vcpkg-release" - }, - { - "name": "macos-vcpkg-liblcf-debug", - "configurePreset": "macos-vcpkg-liblcf-debug" - }, - { - "name": "macos-vcpkg-liblcf-relwithdebinfo", - "configurePreset": "macos-vcpkg-liblcf-relwithdebinfo" - }, - { - "name": "macos-vcpkg-liblcf-release", - "configurePreset": "macos-vcpkg-liblcf-release" - } - ], - "testPresets": [] -} diff --git a/builds/cmake/CMakePresets.json.template b/builds/cmake/CMakePresets.json.template index 348b0f49..ce8534bb 100644 --- a/builds/cmake/CMakePresets.json.template +++ b/builds/cmake/CMakePresets.json.template @@ -18,7 +18,7 @@ "name": "windows", "displayName": "Windows", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-eze" }, "inherits": "win-user", "easyrpg_platforms": ["liblcf"] @@ -29,7 +29,7 @@ "generator": "Visual Studio 17 2022", "architecture": "x64", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + "VCPKG_TARGET_TRIPLET": "x64-windows-eze" }, "inherits": "win-user", "easyrpg_platforms": ["liblcf"] diff --git a/builds/cmake/Modules/EditorConfigureWindows.cmake b/builds/cmake/Modules/EditorConfigureWindows.cmake index 66949686..1ab6f4c5 100644 --- a/builds/cmake/Modules/EditorConfigureWindows.cmake +++ b/builds/cmake/Modules/EditorConfigureWindows.cmake @@ -10,6 +10,15 @@ if(WIN32) # Make math constants available add_compile_definitions(_USE_MATH_DEFINES) + + # Path limit check + string(LENGTH "${CMAKE_CURRENT_BINARY_DIR}" path_length) + math(EXPR path_length "${path_length} + 195") + if(path_length GREATER 259) + message(FATAL_ERROR + "The resulting path is too long (${path_length}) and exceeds the Windows path limit of 260 characters." + "Please move the project into a different directory") + endif() endif() if(MSVC) @@ -30,9 +39,3 @@ if (CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_CONFIGURATION_TYPES) # Remove all configuration types except the current build type set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE}) endif() - -if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(VCPKG_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug") -else() - set(VCPKG_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}") -endif() diff --git a/builds/cmake/gen-cmake-presets.py b/builds/cmake/gen-cmake-presets.py index 21e2faa9..e7a596ef 100644 --- a/builds/cmake/gen-cmake-presets.py +++ b/builds/cmake/gen-cmake-presets.py @@ -10,7 +10,7 @@ import os script_dir = os.path.dirname(os.path.abspath(__file__)) -repo_dir = f"{script_dir}/.." +repo_dir = f"{script_dir}/../.." with open(f"{script_dir}/CMakePresets.json.template", "r") as f: j = json.load(f) @@ -83,8 +83,9 @@ def append_name(name): if "windows" in name: # Hack: The MSVC Linker does not support long paths - # Shorten the build folder name to "win" - item["binaryDir"] = "${sourceDir}/build/win-" + build_type.lower() + # Shorten the build folder name + btype = "dbg" if build_type == "Debug" else "reld" if build_type == "RelWithDebInfo" else "rel" + item["binaryDir"] = "${sourceDir}/build/win-" + btype item["inherits"] += [f"type-{build_type.lower()}"] diff --git a/builds/vcpkg_overlay/ecm/portfile.cmake b/builds/vcpkg_overlay/ecm/portfile.cmake index 7f7f14cd..d3e9bac2 100644 --- a/builds/vcpkg_overlay/ecm/portfile.cmake +++ b/builds/vcpkg_overlay/ecm/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KDE/extra-cmake-modules REF "v${VERSION}" - SHA512 fe00d410764a335385c960b0f4c55ef8650e70d9a843ea291aa67653d002d6234198d0e71f0cec390a335134272fbc75434b1c997c1b34abf3f800107767b4d7 + SHA512 2aedb0d0a647642ab86fc8d365e1e2508ce585081de79e31a44d9d68c3cdec407990e76059ffbb3cc64dae11a7aec5edcbe2a8cf015af3264987055f618bc0b9 HEAD_REF master ) diff --git a/builds/vcpkg_overlay/ecm/vcpkg.json b/builds/vcpkg_overlay/ecm/vcpkg.json index 40d89c40..27eaeb25 100644 --- a/builds/vcpkg_overlay/ecm/vcpkg.json +++ b/builds/vcpkg_overlay/ecm/vcpkg.json @@ -1,6 +1,6 @@ { "name": "ecm", - "version": "6.20.0", + "version": "6.23.0", "port-version": 1, "description": "Extra CMake Modules (ECM), extra modules and scripts for CMake", "homepage": "https://github.com/KDE/extra-cmake-modules", diff --git a/builds/vcpkg_overlay/kirigami/portfile.cmake b/builds/vcpkg_overlay/kirigami/portfile.cmake index ea0309d9..4bd8e886 100644 --- a/builds/vcpkg_overlay/kirigami/portfile.cmake +++ b/builds/vcpkg_overlay/kirigami/portfile.cmake @@ -1,10 +1,8 @@ -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KDE/kirigami REF "v${VERSION}" - SHA512 89bd4131bb92804c45f1db095df27e79121aebd5054efea60605f590b64f9e6b718037f800d5133ac78f2dfb6fbd22e694e5fa266f61ef57b375154b5b098cda + SHA512 6d9851a43741eb80e914b2a54cb6f171522eea9fd4095003d0db4b8a26af6dea26052fc647c3c5f83481fcc82f499574a63c5714abb472a543e4e35c585ce30c HEAD_REF master ) diff --git a/builds/vcpkg_overlay/kirigami/vcpkg.json b/builds/vcpkg_overlay/kirigami/vcpkg.json index dc4f0f64..370160fe 100644 --- a/builds/vcpkg_overlay/kirigami/vcpkg.json +++ b/builds/vcpkg_overlay/kirigami/vcpkg.json @@ -1,6 +1,6 @@ { "name": "kirigami", - "version": "6.20.0", + "version": "6.23.0", "port-version": 1, "description": " A QtQuick based components set ", "homepage": "https://github.com/KDE/kirigami", diff --git a/builds/vcpkg_overlay/qqc2-breeze-style/no-plasma-integration.patch b/builds/vcpkg_overlay/qqc2-breeze-style/no-plasma-integration.patch new file mode 100644 index 00000000..2eec4dc5 --- /dev/null +++ b/builds/vcpkg_overlay/qqc2-breeze-style/no-plasma-integration.patch @@ -0,0 +1,140 @@ +diff '--color=auto' -Naur qqc2-breeze-style-orig/CMakeLists.txt qqc2-breeze-style/CMakeLists.txt +--- qqc2-breeze-style-orig/CMakeLists.txt 2026-02-26 01:43:50.541710810 +0100 ++++ qqc2-breeze-style/CMakeLists.txt 2026-02-26 02:10:13.001891985 +0100 +@@ -37,7 +37,7 @@ + include(KDEGitCommitHooks) + include(ECMQmlModule) + +-find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui Qml Quick QuickControls2 QuickTemplates2) ++find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui GuiPrivate Qml Quick QuickControls2 QuickTemplates2) + + # shall we use DBus? + # enabled per default on Linux & BSD systems +@@ -51,7 +51,7 @@ + set(HAVE_DBUS ON) + endif() + +-find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS GuiAddons Config KirigamiPlatform ColorScheme IconThemes) ++find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS KirigamiPlatform) + + if (NOT APPLE AND NOT WIN32) + find_package(X11) +diff '--color=auto' -Naur qqc2-breeze-style-orig/kirigami-plasmadesktop-integration/CMakeLists.txt qqc2-breeze-style/kirigami-plasmadesktop-integration/CMakeLists.txt +--- qqc2-breeze-style-orig/kirigami-plasmadesktop-integration/CMakeLists.txt 2026-02-26 01:43:50.540014669 +0100 ++++ qqc2-breeze-style/kirigami-plasmadesktop-integration/CMakeLists.txt 2026-02-26 02:12:44.428182595 +0100 +@@ -4,11 +4,11 @@ + add_library(org.kde.breeze) + endif() + +-target_sources(org.kde.breeze PRIVATE +- plasmadesktoptheme.cpp +- kirigamiplasmafactory.cpp +- units.cpp +-) ++#target_sources(org.kde.breeze PRIVATE ++# plasmadesktoptheme.cpp ++# kirigamiplasmafactory.cpp ++# units.cpp ++#) + + target_link_libraries(org.kde.breeze + PUBLIC +@@ -17,9 +17,9 @@ + PRIVATE + Qt::Qml + Qt::Quick +- KF6::GuiAddons +- KF6::ColorScheme +- KF6::IconThemes ++# KF6::GuiAddons ++# KF6::ColorScheme ++# KF6::IconThemes + ) + + if (HAVE_DBUS) +@@ -38,9 +38,9 @@ + + if (NOT BUILD_SHARED_LIBS) + target_compile_definitions(org.kde.breeze PRIVATE QT_STATICPLUGIN=1) +- set_target_properties(org.kde.breeze PROPERTIES QT_PLUGIN_CLASS_NAME KirigamiPlasmaFactory) +- __qt_internal_add_static_plugin_init_object_library(org.kde.breeze plugin_init_target) +- __qt_internal_propagate_object_library(org.kde.breeze "${plugin_init_target}") ++# set_target_properties(org.kde.breeze PROPERTIES QT_PLUGIN_CLASS_NAME KirigamiPlasmaFactory) ++# __qt_internal_add_static_plugin_init_object_library(org.kde.breeze plugin_init_target) ++# __qt_internal_propagate_object_library(org.kde.breeze "${plugin_init_target}") + endif() + + install(TARGETS org.kde.breeze ${plugin_init_target} DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/kirigami/platform EXPORT QQC2BreezeStyleTargets) +diff '--color=auto' -Naur qqc2-breeze-style-orig/QQC2BreezeStyleConfig.cmake.in qqc2-breeze-style/QQC2BreezeStyleConfig.cmake.in +--- qqc2-breeze-style-orig/QQC2BreezeStyleConfig.cmake.in 2026-02-26 01:43:50.539959779 +0100 ++++ qqc2-breeze-style/QQC2BreezeStyleConfig.cmake.in 2026-02-26 01:44:11.898256987 +0100 +@@ -3,8 +3,8 @@ + include(CMakeFindDependencyMacro) + + if (NOT @BUILD_SHARED_LIBS@) +- find_dependency(KF6IconThemes @KF6_MIN_VERSION@) +- find_dependency(KF6ColorScheme @KF6_MIN_VERSION@) ++# find_dependency(KF6IconThemes @KF6_MIN_VERSION@) ++# find_dependency(KF6ColorScheme @KF6_MIN_VERSION@) + endif() + + # Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file. +diff '--color=auto' -Naur qqc2-breeze-style-orig/style/impl/CMakeLists.txt qqc2-breeze-style/style/impl/CMakeLists.txt +--- qqc2-breeze-style-orig/style/impl/CMakeLists.txt 2026-02-26 01:43:50.540241356 +0100 ++++ qqc2-breeze-style/style/impl/CMakeLists.txt 2026-02-26 01:44:11.898309947 +0100 +@@ -59,8 +59,8 @@ + Qt6::Quick + Qt6::QuickControls2 + Qt6::QuickTemplates2 +- KF6::ConfigCore +- KF6::GuiAddons ++ #KF6::ConfigCore ++ #KF6::GuiAddons + ) + + ecm_finalize_qml_module(BreezeImpl EXPORT QQC2BreezeStyleTargets) +diff '--color=auto' -Naur qqc2-breeze-style-orig/style/qtquickcontrols/ApplicationWindow.qml qqc2-breeze-style/style/qtquickcontrols/ApplicationWindow.qml +--- qqc2-breeze-style-orig/style/qtquickcontrols/ApplicationWindow.qml 2026-02-26 01:43:50.540864580 +0100 ++++ qqc2-breeze-style/style/qtquickcontrols/ApplicationWindow.qml 2026-02-26 01:48:16.823609857 +0100 +@@ -6,7 +6,7 @@ + import QtQuick + import QtQuick.Templates as T + import org.kde.kirigami as Kirigami +-import org.kde.guiaddons as GuiAddons ++//import org.kde.guiaddons as GuiAddons + + T.ApplicationWindow { + id: window +@@ -20,16 +20,16 @@ + Kirigami.Theme.colorSet: Kirigami.Theme.Header + Kirigami.Theme.inherit: false + +- Binding { ++ /*Binding { + target: GuiAddons.WindowInsetsController + property: "statusBarBackgroundColor" + value: Kirigami.Theme.backgroundColor +- } ++ }*/ + } + +- Binding { ++ /*Binding { + target: GuiAddons.WindowInsetsController + property: "navigationBarBackgroundColor" + value: window.footer ? window.footer.Kirigami.Theme.backgroundColor : Kirigami.Theme.backgroundColor +- } ++ }*/ + } +diff '--color=auto' -Naur qqc2-breeze-style-orig/style/qtquickcontrols/CMakeLists.txt qqc2-breeze-style/style/qtquickcontrols/CMakeLists.txt +--- qqc2-breeze-style-orig/style/qtquickcontrols/CMakeLists.txt 2026-02-26 01:43:50.540923649 +0100 ++++ qqc2-breeze-style/style/qtquickcontrols/CMakeLists.txt 2026-02-26 01:48:46.430637040 +0100 +@@ -6,7 +6,7 @@ + "QtQuick.Window" + "org.kde.kirigami" + "org.kde.breeze.impl" +- "org.kde.guiaddons" ++# "org.kde.guiaddons" + ) + + ecm_target_qml_sources(BreezeStyle SOURCES diff --git a/builds/vcpkg_overlay/qqc2-breeze-style/portfile.cmake b/builds/vcpkg_overlay/qqc2-breeze-style/portfile.cmake new file mode 100644 index 00000000..4ee8a24c --- /dev/null +++ b/builds/vcpkg_overlay/qqc2-breeze-style/portfile.cmake @@ -0,0 +1,40 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/qqc2-breeze-style + REF "v${VERSION}" + SHA512 3109fa7c0b85ba1c9d0fc4440f4afeb23967de7c0359474740e75f925ccfee72c7e832a14301cc478a122699215f992f4299b3236a67b0eb06c9d9edab937a81 + HEAD_REF master + PATCHES + no-plasma-integration.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DCMAKE_PREFIX_PATH="$ENV{Qt6_Path}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME QQC2BreezeStyle CONFIG_PATH "lib/cmake/QQC2BreezeStyle") + +# Remove debug files +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") +endif() + +# Handle copyright +vcpkg_install_copyright(FILE_LIST + "${SOURCE_PATH}/LICENSES/CC0-1.0.txt" + "${SOURCE_PATH}/LICENSES/GPL-2.0-or-later.txt" + "${SOURCE_PATH}/LICENSES/LGPL-2.0-or-later.txt" + "${SOURCE_PATH}/LICENSES/LGPL-2.1-only.txt" + "${SOURCE_PATH}/LICENSES/LGPL-3.0-only.txt" + "${SOURCE_PATH}/LICENSES/LicenseRef-KDE-Accepted-LGPL.txt" + "${SOURCE_PATH}/LICENSES/LicenseRef-KFQF-Accepted-GPL.txt" +) diff --git a/builds/vcpkg_overlay/qqc2-breeze-style/vcpkg.json b/builds/vcpkg_overlay/qqc2-breeze-style/vcpkg.json new file mode 100644 index 00000000..86512c8a --- /dev/null +++ b/builds/vcpkg_overlay/qqc2-breeze-style/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "qqc2-breeze-style", + "version": "6.6.1", + "port-version": 1, + "description": "Breeze inspired QQC2 Style", + "homepage": "https://github.com/KDE/qqc2-breeze-style", + "dependencies": [ + { + "name": "qtbase", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "kirigami" + ] +} diff --git a/resources/Resources.qrc b/resources/Resources.qrc index 937f86f5..5b5c4bec 100644 --- a/resources/Resources.qrc +++ b/resources/Resources.qrc @@ -4,6 +4,12 @@ app/easyrpg.png app/editor.ico app/logo.svg + icons/ezbright/index.theme + icons/ezbright/icons/arrow-down.svg + icons/ezbright/icons/arrow-up.svg + icons/ezdark/index.theme + icons/ezdark/icons/arrow-down.svg + icons/ezdark/icons/arrow-up.svg icons/bright/audio.svg @@ -94,4 +100,7 @@ icons/ranks/rank3.svg icons/ranks/rank4.svg + + Theme.qml + diff --git a/resources/Theme.qml b/resources/Theme.qml new file mode 100644 index 00000000..d06ae049 --- /dev/null +++ b/resources/Theme.qml @@ -0,0 +1,101 @@ +/* + * SPDX-FileCopyrightText: 2015 Marco Martin + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick +import org.kde.kirigami as Kirigami + +Kirigami.BasicThemeDefinition { + readonly property color ezAccent: "#4DE600" + readonly property color ezDanger: "#FF4E4E" + readonly property color ezNeutral: "#D1C64E" + readonly property color ezBaseBg: "#26272B" + readonly property color ezElevatedBg: "#444450" + readonly property color ezInputBg: "#222428" + readonly property color ezHoverBg: "#3A3D41" + readonly property color ezAltBg: "#2C2E33" + readonly property color ezText: "#E0E0E0" + + textColor: ezText + disabledTextColor: Qt.darker(ezText, 1.8) + + highlightColor: ezAccent + highlightedTextColor: Qt.lighter(ezText, 1.5) + backgroundColor: ezBaseBg + alternateBackgroundColor: ezAltBg + activeTextColor: "#000000" + activeBackgroundColor: ezAccent + linkColor: ezAccent + linkBackgroundColor: "transparent" + visitedLinkColor: Qt.darker(ezAccent, 1.3) + visitedLinkBackgroundColor: Qt.darker(ezAccent, 1.3) + hoverColor: ezHoverBg + focusColor: ezAccent + negativeTextColor: ezDanger + negativeBackgroundColor: ezDanger + neutralTextColor: ezNeutral + neutralBackgroundColor: ezNeutral + positiveTextColor: ezAccent + positiveBackgroundColor: ezAccent + + buttonTextColor: ezText + buttonBackgroundColor: ezElevatedBg + buttonAlternateBackgroundColor: Qt.darker(ezElevatedBg, 1.3) + buttonHoverColor: ezHoverBg + buttonFocusColor: ezAccent + + viewTextColor: ezText + viewBackgroundColor: ezBaseBg + viewAlternateBackgroundColor: ezAltBg + viewHoverColor: ezHoverBg + viewFocusColor: ezAccent + + selectionTextColor: "#000000" + selectionBackgroundColor: ezAccent + selectionAlternateBackgroundColor: "#1B5200" + selectionHoverColor: ezAccent + selectionFocusColor: ezAccent + + tooltipTextColor: "#FFFFFF" + tooltipBackgroundColor: ezInputBg + tooltipAlternateBackgroundColor: ezElevatedBg + tooltipHoverColor: ezHoverBg + tooltipFocusColor: ezAccent + + complementaryTextColor: "#FFFFFF" + complementaryBackgroundColor: ezInputBg + complementaryAlternateBackgroundColor: ezElevatedBg + complementaryHoverColor: ezHoverBg + complementaryFocusColor: ezAccent + + headerTextColor: "#FFFFFF" + headerBackgroundColor: ezElevatedBg + headerAlternateBackgroundColor: ezAltBg + headerHoverColor: ezHoverBg + headerFocusColor: ezAccent + + defaultFont: fontMetrics.font + + property list children: [ + TextMetrics { + id: fontMetrics + }, + SystemPalette { + id: palette + colorGroup: SystemPalette.Active + }, + SystemPalette { + id: disabledPalette + colorGroup: SystemPalette.Disabled + } + ] + + function __propagateColorSet(object, context) {} + + function __propagateTextColor(object, color) {} + function __propagateBackgroundColor(object, color) {} + function __propagatePrimaryColor(object, color) {} + function __propagateAccentColor(object, color) {} +} diff --git a/resources/icons/ezbright/icons/arrow-down.svg b/resources/icons/ezbright/icons/arrow-down.svg new file mode 100644 index 00000000..83912053 --- /dev/null +++ b/resources/icons/ezbright/icons/arrow-down.svg @@ -0,0 +1,10 @@ + + + + diff --git a/resources/icons/ezbright/icons/arrow-up.svg b/resources/icons/ezbright/icons/arrow-up.svg new file mode 100644 index 00000000..68d5c035 --- /dev/null +++ b/resources/icons/ezbright/icons/arrow-up.svg @@ -0,0 +1,10 @@ + + + + diff --git a/resources/icons/ezbright/index.theme b/resources/icons/ezbright/index.theme new file mode 100644 index 00000000..9563f932 --- /dev/null +++ b/resources/icons/ezbright/index.theme @@ -0,0 +1,8 @@ +[Icon Theme] +Name=ezbright +Comment=EasyRPG Icon Theme (Bright Mode) +Directories=icons + +[icons] +Size=32 +Type=Scalable diff --git a/resources/icons/ezdark/icons/arrow-down.svg b/resources/icons/ezdark/icons/arrow-down.svg new file mode 100644 index 00000000..6eb51b79 --- /dev/null +++ b/resources/icons/ezdark/icons/arrow-down.svg @@ -0,0 +1,10 @@ + + + + diff --git a/resources/icons/ezdark/icons/arrow-up.svg b/resources/icons/ezdark/icons/arrow-up.svg new file mode 100644 index 00000000..07d624ba --- /dev/null +++ b/resources/icons/ezdark/icons/arrow-up.svg @@ -0,0 +1,10 @@ + + + + diff --git a/resources/icons/ezdark/index.theme b/resources/icons/ezdark/index.theme new file mode 100644 index 00000000..ac8efa56 --- /dev/null +++ b/resources/icons/ezdark/index.theme @@ -0,0 +1,8 @@ +[Icon Theme] +Name=ezdark +Comment=EasyRPG Icon Theme (Dark Mode) +Directories=icons + +[icons] +Size=32 +Type=Scalable diff --git a/src/main.cpp b/src/main.cpp index 9d84d270..c97ce9de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,29 +22,58 @@ #include #include #include +#include +#include int main(int argc, char *argv[]) { - QApplication a(argc, argv); + QApplication app(argc, argv); + + app.setApplicationName("EasyRPG Editor"); + app.setOrganizationName("EasyRPG"); + app.setOrganizationDomain("easyrpg.org"); // show splash QPixmap logo(":/app/splash.png"); QSplashScreen s(logo, Qt::WindowStaysOnTopHint); + + // Style setup + bool force_dark = false; + + // Kirigami only loads a custom style when using a static build + // Lets wait for upstream to improve this +#if defined(_WIN32) || defined(__APPLE__) + // Default to org.kde.breeze style (from qqc2-breeze style) + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { + const char* fstyle = "KIRIGAMI_FORCE_STYLE"; + if (qEnvironmentVariableIsEmpty(fstyle) || qEnvironmentVariableIntValue(fstyle) > 0) { + // Built in EasyRPG Style (Theme.qml) + qputenv("KIRIGAMI_FORCE_STYLE", "1"); + force_dark = true; + } + QQuickStyle::setStyle(QStringLiteral("org.kde.breeze")); + } +#endif + + auto hints = app.styleHints(); + auto scheme_changed = [=]() { + if (!force_dark && hints->colorScheme() == Qt::ColorScheme::Light) { + QIcon::setThemeName("ezbright"); + } else { + QIcon::setThemeName("ezdark"); + } + }; + scheme_changed(); + QObject::connect(hints, &QStyleHints::colorSchemeChanged, scheme_changed); + s.showMessage("EasyRPG Editor"); - s.show(); + //s.show(); #ifdef NDEBUG // close splash after 3 seconds for release QTimer::singleShot(3000, &s, &QWidget::close); #endif - a.setApplicationName("EasyRPG Editor"); - a.setOrganizationName("EasyRPG"); - a.setOrganizationDomain("easyrpg.org"); - // setup qml engine QQmlApplicationEngine engine; -#ifdef QML_EXTRA_IMPORT_PATHS - engine.addImportPath(QML_EXTRA_IMPORT_PATHS); -#endif engine.loadFromModule("org.easyrpg.editor", "MainWindow"); if (engine.rootObjects().isEmpty()) { @@ -53,7 +82,7 @@ int main(int argc, char *argv[]) { // load translations s.showMessage("Loading translations..."); - a.processEvents(); + app.processEvents(); QTranslator t; bool found = false; #ifndef NDEBUG @@ -65,16 +94,16 @@ int main(int argc, char *argv[]) { if (!found) found = t.load(QLocale(), QLatin1String("easyrpg-editor"), QLatin1String("_"), QLatin1String(":/i18n")); if (found) - a.installTranslator(&t); + app.installTranslator(&t); else qDebug() << "No translation(s) available."; // main window and project s.showMessage("Loading main window..."); - a.processEvents(); + app.processEvents(); MainWindow w; s.showMessage("Loading last project..."); - a.processEvents(); + app.processEvents(); w.LoadLastProject(); s.clearMessage(); w.show(); @@ -84,5 +113,5 @@ int main(int argc, char *argv[]) { #endif // into event loop - return a.exec(); + return app.exec(); } diff --git a/vcpkg.json b/vcpkg.json index 3d756da0..390b9985 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -11,6 +11,7 @@ "expat", "glaze", "kddockwidgets", - "kirigami" + "kirigami", + "qqc2-breeze-style" ] }