Merge pull request #150 from zhuzichu520/6.5.0

6.5.0
main
zhuzichu 2023-06-06 22:21:56 +08:00 committed by GitHub
commit 7c1b03b22f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 10 deletions

View File

@ -22,7 +22,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [macos-12] os: [macos-12]
qt_ver: [6.4.3] qt_ver: [6.5.0]
qt_arch: [clang_64] qt_arch: [clang_64]
env: env:
targetName: example targetName: example
@ -50,7 +50,7 @@ jobs:
cmake --version cmake --version
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/FluentUI/Qt/6.4.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja .. cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/FluentUI/Qt/6.5.0/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel cmake --build . --target all --config Release --parallel
- name: package - name: package

View File

@ -23,7 +23,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04] os: [ubuntu-20.04]
qt_ver: [6.4.3] qt_ver: [6.5.0]
qt_arch: [gcc_64] qt_arch: [gcc_64]
env: env:
targetName: example targetName: example
@ -47,7 +47,7 @@ jobs:
version: 1.10.2 version: 1.10.2
- name: ubuntu install GL library - name: ubuntu install GL library
run: sudo apt-get install -y libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev run: sudo apt-get install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
- name: build ubuntu - name: build ubuntu
run: | run: |
@ -55,7 +55,7 @@ jobs:
cmake --version cmake --version
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.4.3/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja .. cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.5.0/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel cmake --build . --target all --config Release --parallel
- name: install QT linux deploy - name: install QT linux deploy

View File

@ -23,7 +23,7 @@ jobs:
matrix: matrix:
include: include:
- qt_arch: win64_mingw - qt_arch: win64_mingw
qt_ver: 6.4.3 qt_ver: 6.5.0
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900" qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
qt_tools_mingw_install: mingw900_64 qt_tools_mingw_install: mingw900_64
env: env:
@ -62,7 +62,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.4.3\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja .. cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.5.0\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel cmake --build . --target all --config Release --parallel
- name: package - name: package

View File

@ -23,7 +23,7 @@ jobs:
matrix: matrix:
os: [windows-2019] os: [windows-2019]
include: include:
- qt_ver: 6.4.3 - qt_ver: 6.5.0
qt_arch: win64_msvc2019_64 qt_arch: win64_msvc2019_64
msvc_arch: x64 msvc_arch: x64
qt_arch_install: msvc2019_64 qt_arch_install: msvc2019_64
@ -42,7 +42,7 @@ jobs:
version: ${{ matrix.qt_ver }} version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
cache: ${{steps.cache-qt.outputs.cache-hit}} cache: ${{steps.cache-qt.outputs.cache-hit}}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats qtspeech'
- name: msvc-build - name: msvc-build
id: build id: build
@ -51,7 +51,7 @@ jobs:
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }} call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.4.3\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja .. cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.5.0\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel cmake --build . --target all --config Release --parallel
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV% echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV% echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%

View File

@ -2,9 +2,14 @@
#include "Def.h" #include "Def.h"
#include "FluColors.h" #include "FluColors.h"
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
#include <QStyleHints>
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)))
#include <QPalette> #include <QPalette>
#include <QtGui/qpa/qplatformtheme.h> #include <QtGui/qpa/qplatformtheme.h>
#include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qguiapplication_p.h>
#endif
#include <QGuiApplication> #include <QGuiApplication>
FluTheme* FluTheme::m_instance = nullptr; FluTheme* FluTheme::m_instance = nullptr;
@ -45,10 +50,15 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
bool FluTheme::systemDark() bool FluTheme::systemDark()
{ {
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
return (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark);
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)))
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) { if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
return (theme->appearance() == QPlatformTheme::Appearance::Dark); return (theme->appearance() == QPlatformTheme::Appearance::Dark);
} }
return false; return false;
#endif
return false;
} }
bool FluTheme::dark(){ bool FluTheme::dark(){