main
zhuzihcu 2023-04-27 09:38:57 +08:00
parent 2aef114969
commit c15470f723
136 changed files with 471 additions and 1080 deletions

View File

@ -2,14 +2,19 @@ name: MacOS
on:
push:
paths:
- '*.pro'
- '*.txt'
- 'example/**'
- 'src/**'
- 'scripts/**'
- '.github/workflows/macos.yml'
pull_request:
paths:
- '*.pro'
- '*.txt'
- 'example/**'
- 'src/**'
- 'scripts/**'
- '.github/workflows/macos.yml'
jobs:
build:
name: Build
@ -22,12 +27,11 @@ jobs:
env:
targetName: example
steps:
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
- name: Check out repository
uses: actions/checkout@v3
with:
path: ${{ runner.workspace }}/Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
@ -35,24 +39,30 @@ jobs:
cache: ${{steps.cache-qt.outputs.cache-hit}}
arch: ${{ matrix.qt_arch }}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- uses: actions/checkout@v2
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
with:
fetch-depth: 1
version: 1.10.2
- name: build macos
run: |
qmake
make
# 打包
cmake --version
mkdir build
cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel
- name: package
run: |
# 拷贝依赖
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
# 上传artifacts
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
- uses: actions/upload-artifact@v2
with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
path: bin/release/${{ env.targetName }}.app
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2

View File

@ -1,17 +1,21 @@
name: Ubuntu
# Qt官方没有linux平台的x86包
on:
workflow_dispatch:
push:
paths:
- '*.pro'
- '*.txt'
- 'src/**'
- 'example/**'
- 'scripts/**'
- '.github/workflows/ubuntu.yml'
pull_request:
paths:
- '*.pro'
- '*.txt'
- 'src/**'
- '.github/workflows/ubuntu.yml'
- 'example/**'
- 'scripts/**'
- '.github/workflows/ubuntu.yml'
jobs:
build:
name: Build
@ -24,12 +28,11 @@ jobs:
env:
targetName: example
steps:
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
- name: Check out repository
uses: actions/checkout@v3
with:
path: ${{ runner.workspace }}/Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
@ -37,22 +40,32 @@ jobs:
cache: ${{steps.cache-qt.outputs.cache-hit}}
arch: ${{ matrix.qt_arch }}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
with:
version: 1.10.2
- name: ubuntu install GL library
run: sudo apt-get install -y 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
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: build ubuntu
run: |
qmake
make
ninja --version
cmake --version
mkdir build
cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel
- name: install QT linux deploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage
- name: Check if svg file exists
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
# 打包
- name: package
run: |
# make sure Qt plugin finds QML sources so it can deploy the imported files
@ -60,12 +73,12 @@ jobs:
# 拷贝依赖
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/release/${targetName} --appdir bin/release/
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
# 上传artifacts
- uses: actions/upload-artifact@v2
with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
path: ${{ env.targetName }}.AppImage
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2

View File

@ -2,14 +2,19 @@ name: Windows MinGW
on:
push:
paths:
- '*.pro'
- '*.txt'
- 'src/**'
- 'example/**'
- 'scripts/**'
- '.github/workflows/windows-mingw.yml'
pull_request:
paths:
- '*.pro'
- '*.txt'
- 'example/**'
- 'src/**'
- '.github/workflows/windows-mingw.yml'
- 'scripts/**'
- '.github/workflows/windows-mingw.yml'
jobs:
build:
name: Build
@ -25,6 +30,11 @@ jobs:
targetName: example.exe
fileName: example
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
@ -32,26 +42,29 @@ jobs:
arch: ${{ matrix.qt_arch }}
cache: ${{steps.cache-qt.outputs.cache-hit}}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Qt6 environment configuration
if: ${{ startsWith( matrix.qt_ver, 6 ) }}
shell: pwsh
run: |
Write-Output "${{ env.Qt6_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Output "${{ env.Qt6_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: where is qmake & where is mingw32-make
- name: where is cmake & where is mingw32-make
shell: pwsh
run: |
Get-Command -Name 'qmake' | Format-List
Get-Command -Name 'cmake' | Format-List
Get-Command -Name 'mingw32-make' | Format-List
- name: mingw-build
id: build
shell: cmd
run: |
qmake
mingw32-make
mkdir build
cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel
- name: package
id: package
env:
@ -61,10 +74,12 @@ jobs:
& scripts\windows-mingw-publish.ps1 ${env:archiveName} ${env:targetName}
$name = ${env:archiveName}
echo "::set-output name=packageName::$name"
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }}
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2

View File

@ -1,24 +1,25 @@
name: Windows
on:
# push代码时触发workflow
push:
paths:
- '*.pro'
- '*.txt'
- 'src/**'
- 'example/**'
- 'scripts/**'
- '.github/workflows/windows.yml'
pull_request:
paths:
- '*.pro'
- '*.txt'
- 'example/**'
- 'src/**'
- '.github/workflows/windows.yml'
- 'scripts/**'
- '.github/workflows/windows.yml'
jobs:
build:
name: Build
# 运行平台, windows-latest目前是windows server 2019
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: ${{ matrix.os }}
strategy:
# 矩阵配置
matrix:
os: [windows-2019]
include:
@ -29,40 +30,34 @@ jobs:
env:
targetName: example.exe
fileName: example
# 步骤
steps:
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
- name: Check out repository
uses: actions/checkout@v3
with:
path: ${{ runner.workspace }}\Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
# 安装Qt
submodules: recursive
- name: Install Qt
# 使用外部action。这个action专门用来安装Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }}
cache: ${{steps.cache-qt.outputs.cache-hit}}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
# 拉取代码
- uses: actions/checkout@v2
with:
fetch-depth: 1
# msvc编译
- name: msvc-build
id: build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
qmake
nmake
mkdir build
cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
# 打包
- name: package
id: package
env:
@ -73,14 +68,13 @@ jobs:
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
# 记录packageName给后续step
$name = ${env:archiveName}
echo "::set-output name=packageName::$name"
# tag 查询github-Release
# 上传artifacts
echo "::set-output name=packageName::$name"
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }}
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2

3
.gitignore vendored
View File

@ -33,4 +33,5 @@ CMakeLists.txt.user*
src/build-preset/plugins.qmltypes
bin
.DS_Store
.DS_Store
build

View File

@ -1,6 +0,0 @@
TEMPLATE = subdirs
SUBDIRS += \
src/FluentUI.pro \
example
example.depends = src/FluentUI.pro

View File

@ -1,65 +1,54 @@
cmake_minimum_required(VERSION 3.16)
project(example)
project(example VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(platform 64)
else()
set(platform 32)
endif()
#
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin/debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin/release)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release)
endif()
find_package(Qt6 COMPONENTS Core Quick QuickControls2 Concurrent Network Multimedia REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
set(SOURCES
src/controller/ChatController.cpp
src/AppInfo.cpp
src/main.cpp
src/lang/Lang.cpp
src/lang/Zh.cpp
src/lang/En.cpp
src/tool/IPC.cpp
#Cpp
file(GLOB_RECURSE CPP_FILES *.cpp *.h)
foreach(filepath ${CPP_FILES})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND sources_files ${filename})
endforeach(filepath)
#qml
file(GLOB_RECURSE QML_PATHS *.qml)
foreach(filepath ${QML_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND qml_files ${filename})
endforeach(filepath)
#
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp)
foreach(filepath ${RES_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND resource_files ${filename})
endforeach(filepath)
#
qt_add_executable(example
${sources_files}
)
set(HEADERS
src/controller/ChatController.h
src/AppInfo.h
src/stdafx.h
src/lang/Lang.h
src/lang/Zh.h
src/lang/En.h
src/tool/IPC.h
)
set(RESOURCES
qml.qrc
)
set(RC_ICONS
favicon.ico
)
qt_add_resources(QT_RESOURCES ${RESOURCES})
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${QT_RESOURCES} ${RC_ICONS})
#
if(WIN32)
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
set(DLLPATH ${CMAKE_CURRENT_SOURCE_DIR}/../third/msvc/*.dll)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/msvc/*.dll)
else()
set(DLLPATH ${CMAKE_CURRENT_SOURCE_DIR}/../third/mingw/*.dll)
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll)
endif()
string(REPLACE "/" ${PATH_SEPARATOR} DLLPATH "${DLLPATH}")
file(GLOB DLL_FILES ${DLLPATH})
@ -70,27 +59,29 @@ if(WIN32)
)
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE
QT_DEPRECATED_WARNINGS
QT_NO_WARNING_OUTPUT
#qml
qt_add_qml_module(example
URI example
VERSION 1.0
QML_FILES ${qml_files} qml/global/qmldir
RESOURCES ${resource_files}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Core
Qt6::Quick
Qt6::QuickControls2
Qt6::Concurrent
Qt6::Network
Qt6::Multimedia
#
set_target_properties(example PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE UNICODE WIN32 _WINDOWS)
target_link_libraries(${PROJECT_NAME} PRIVATE dwmapi user32)
endif()
#
target_link_libraries(example
PRIVATE Qt6::Quick
)
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST Info.plist
)
endif()
#
install(TARGETS example
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleExecutable</key>
<string>example</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.zhuzichu.example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>

View File

@ -1,59 +0,0 @@
QT += quick concurrent network multimedia
CONFIG += c++17
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
HEADERS += \
src/lang/En.h \
src/lang/Lang.h \
src/lang/Zh.h \
src/stdafx.h \
src/controller/ChatController.h \
src/AppInfo.h \
src/tool/IPC.h
SOURCES += \
src/controller/ChatController.cpp \
src/AppInfo.cpp \
src/lang/En.cpp \
src/lang/Lang.cpp \
src/lang/Zh.cpp \
src/main.cpp \
src/tool/IPC.cpp
RESOURCES += qml.qrc
RC_ICONS = favicon.ico
QML_IMPORT_PATH =
QML_DESIGNER_IMPORT_PATH =
CONFIG(debug,debug|release) {
DESTDIR = $$absolute_path($${_PRO_FILE_PWD_}/../bin/debug)
} else {
DESTDIR = $$absolute_path($${_PRO_FILE_PWD_}/../bin/release)
}
win32 {
contains(QMAKE_CC, cl) {
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/msvc/*.dll) $$DESTDIR
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
} else {
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/mingw/*.dll) $$DESTDIR
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
}
}
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
mac: {
QMAKE_INFO_PLIST = Info.plist
}
#### 如果你正在使用静态库,请将将下面的配置注释取消掉
#DEFINES += STATICLIB
#INCLUDEPATH += $$OUT_PWD/../bin/FluentUI/
#LIBS += -L$$OUT_PWD/../bin/FluentUI/ -lFluentUI

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

View File

@ -1,173 +0,0 @@
<RCC>
<qresource prefix="/">
<file>res/image/image_huoyin.webp</file>
<file>res/svg/avatar_1.svg</file>
<file>res/svg/avatar_2.svg</file>
<file>res/svg/avatar_3.svg</file>
<file>res/svg/avatar_4.svg</file>
<file>res/svg/avatar_5.svg</file>
<file>res/svg/avatar_6.svg</file>
<file>res/svg/avatar_7.svg</file>
<file>res/svg/avatar_8.svg</file>
<file>res/svg/avatar_9.svg</file>
<file>res/svg/avatar_10.svg</file>
<file>res/svg/avatar_11.svg</file>
<file>res/svg/avatar_12.svg</file>
<file>res/image/banner_1.jpg</file>
<file>res/image/banner_2.jpg</file>
<file>res/image/banner_3.jpg</file>
<file>res/image/logo_openai.png</file>
<file>res/image/favicon.ico</file>
<file>res/image/bg_home_header.png</file>
<file>res/image/ic_home_github.png</file>
<file>res/image/control/Acrylic.png</file>
<file>res/image/control/AnimatedIcon.png</file>
<file>res/image/control/AnimatedVisualPlayer.png</file>
<file>res/image/control/AnimationInterop.png</file>
<file>res/image/control/AppBarButton.png</file>
<file>res/image/control/AppBarSeparator.png</file>
<file>res/image/control/AppBarToggleButton.png</file>
<file>res/image/control/AutomationProperties.png</file>
<file>res/image/control/AutoSuggestBox.png</file>
<file>res/image/control/Border.png</file>
<file>res/image/control/BreadcrumbBar.png</file>
<file>res/image/control/Button.png</file>
<file>res/image/control/CalendarDatePicker.png</file>
<file>res/image/control/CalendarView.png</file>
<file>res/image/control/Canvas.png</file>
<file>res/image/control/Checkbox.png</file>
<file>res/image/control/Clipboard.png</file>
<file>res/image/control/ColorPaletteResources.png</file>
<file>res/image/control/ColorPicker.png</file>
<file>res/image/control/ComboBox.png</file>
<file>res/image/control/CommandBar.png</file>
<file>res/image/control/CommandBarFlyout.png</file>
<file>res/image/control/CompactSizing.png</file>
<file>res/image/control/ConnectedAnimation.png</file>
<file>res/image/control/ContentDialog.png</file>
<file>res/image/control/CreateMultipleWindows.png</file>
<file>res/image/control/DataGrid.png</file>
<file>res/image/control/DatePicker.png</file>
<file>res/image/control/DropDownButton.png</file>
<file>res/image/control/EasingFunction.png</file>
<file>res/image/control/Expander.png</file>
<file>res/image/control/FilePicker.png</file>
<file>res/image/control/FlipView.png</file>
<file>res/image/control/Flyout.png</file>
<file>res/image/control/Grid.png</file>
<file>res/image/control/GridView.png</file>
<file>res/image/control/HyperlinkButton.png</file>
<file>res/image/control/IconElement.png</file>
<file>res/image/control/Image.png</file>
<file>res/image/control/ImplicitTransition.png</file>
<file>res/image/control/InfoBadge.png</file>
<file>res/image/control/InfoBar.png</file>
<file>res/image/control/InkCanvas.png</file>
<file>res/image/control/InkToolbar.png</file>
<file>res/image/control/InputValidation.png</file>
<file>res/image/control/ItemsRepeater.png</file>
<file>res/image/control/Line.png</file>
<file>res/image/control/ListBox.png</file>
<file>res/image/control/ListView.png</file>
<file>res/image/control/MediaPlayerElement.png</file>
<file>res/image/control/MenuBar.png</file>
<file>res/image/control/MenuFlyout.png</file>
<file>res/image/control/NavigationView.png</file>
<file>res/image/control/NumberBox.png</file>
<file>res/image/control/PageTransition.png</file>
<file>res/image/control/ParallaxView.png</file>
<file>res/image/control/PasswordBox.png</file>
<file>res/image/control/PersonPicture.png</file>
<file>res/image/control/PipsPager.png</file>
<file>res/image/control/Pivot.png</file>
<file>res/image/control/ProgressBar.png</file>
<file>res/image/control/ProgressRing.png</file>
<file>res/image/control/PullToRefresh.png</file>
<file>res/image/control/RadialGradientBrush.png</file>
<file>res/image/control/RadioButton.png</file>
<file>res/image/control/RadioButtons.png</file>
<file>res/image/control/RatingControl.png</file>
<file>res/image/control/RelativePanel.png</file>
<file>res/image/control/RepeatButton.png</file>
<file>res/image/control/RevealFocus.png</file>
<file>res/image/control/RichEditBox.png</file>
<file>res/image/control/RichTextBlock.png</file>
<file>res/image/control/ScrollViewer.png</file>
<file>res/image/control/SemanticZoom.png</file>
<file>res/image/control/Shape.png</file>
<file>res/image/control/Slider.png</file>
<file>res/image/control/Sound.png</file>
<file>res/image/control/SplitButton.png</file>
<file>res/image/control/SplitView.png</file>
<file>res/image/control/StackPanel.png</file>
<file>res/image/control/StandardUICommand.png</file>
<file>res/image/control/SwipeControl.png</file>
<file>res/image/control/TabView.png</file>
<file>res/image/control/TeachingTip.png</file>
<file>res/image/control/TextBlock.png</file>
<file>res/image/control/TextBox.png</file>
<file>res/image/control/ThemeTransition.png</file>
<file>res/image/control/TimePicker.png</file>
<file>res/image/control/TitleBar.png</file>
<file>res/image/control/ToggleButton.png</file>
<file>res/image/control/ToggleSplitButton.png</file>
<file>res/image/control/ToggleSwitch.png</file>
<file>res/image/control/ToolTip.png</file>
<file>res/image/control/TreeView.png</file>
<file>res/image/control/VariableSizedWrapGrid.png</file>
<file>res/image/control/Viewbox.png</file>
<file>res/image/control/WebView.png</file>
<file>res/image/control/XamlUICommand.png</file>
<file>res/svg/home.svg</file>
<file>res/svg/home_dark.svg</file>
<file>res/image/qrcode_wx.jpg</file>
<file>res/image/qrcode_zfb.jpg</file>
<file>qml/component/CodeExpander.qml</file>
<file>qml/global/ItemsFooter.qml</file>
<file>qml/global/ItemsOriginal.qml</file>
<file>qml/global/MainEvent.qml</file>
<file>qml/global/qmldir</file>
<file>qml/App.qml</file>
<file>qml/window/AboutWindow.qml</file>
<file>qml/window/ChatWindow.qml</file>
<file>qml/window/LoginWindow.qml</file>
<file>qml/window/MainWindow.qml</file>
<file>qml/window/MediaWindow.qml</file>
<file>qml/window/SingleInstanceWindow.qml</file>
<file>qml/window/SingleTaskWindow.qml</file>
<file>qml/window/StandardWindow.qml</file>
<file>qml/page/T_Awesome.qml</file>
<file>qml/page/T_Badge.qml</file>
<file>qml/page/T_Buttons.qml</file>
<file>qml/page/T_CalendarPicker.qml</file>
<file>qml/page/T_Carousel.qml</file>
<file>qml/page/T_CheckBox.qml</file>
<file>qml/page/T_ColorPicker.qml</file>
<file>qml/page/T_DatePicker.qml</file>
<file>qml/page/T_Dialog.qml</file>
<file>qml/page/T_Expander.qml</file>
<file>qml/page/T_FlipView.qml</file>
<file>qml/page/T_Home.qml</file>
<file>qml/page/T_InfoBar.qml</file>
<file>qml/page/T_MediaPlayer.qml</file>
<file>qml/page/T_Menu.qml</file>
<file>qml/page/T_MultiWindow.qml</file>
<file>qml/page/T_Pivot.qml</file>
<file>qml/page/T_Progress.qml</file>
<file>qml/page/T_RatingControl.qml</file>
<file>qml/page/T_Rectangle.qml</file>
<file>qml/page/T_Settings.qml</file>
<file>qml/page/T_Slider.qml</file>
<file>qml/page/T_StatusView.qml</file>
<file>qml/page/T_TableView.qml</file>
<file>qml/page/T_TabView.qml</file>
<file>qml/page/T_TextBox.qml</file>
<file>qml/page/T_Theme.qml</file>
<file>qml/page/T_TimePicker.qml</file>
<file>qml/page/T_ToggleSwitch.qml</file>
<file>qml/page/T_Tooltip.qml</file>
<file>qml/page/T_TreeView.qml</file>
<file>qml/page/T_Typography.qml</file>
<file>qml/page/T_BreadcrumbBar.qml</file>
</qresource>
</RCC>

View File

@ -11,14 +11,14 @@ Window {
FluTheme.frameless = ("windows" === Qt.platform.os)
FluTheme.darkMode = FluDarkMode.System
FluApp.routes = {
"/":"qrc:/qml/window/MainWindow.qml",
"/about":"qrc:/qml/window/AboutWindow.qml",
"/login":"qrc:/qml/window/LoginWindow.qml",
"/chat":"qrc:/qml/window/ChatWindow.qml",
"/media":"qrc:/qml/window/MediaWindow.qml",
"/singleTaskWindow":"qrc:/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/qml/window/StandardWindow.qml",
"/singleInstanceWindow":"qrc:/qml/window/SingleInstanceWindow.qml"
"/":"qrc:/example/qml/window/MainWindow.qml",
"/about":"qrc:/example/qml/window/AboutWindow.qml",
"/login":"qrc:/example/qml/window/LoginWindow.qml",
"/chat":"qrc:/example/qml/window/ChatWindow.qml",
"/media":"qrc:/example/qml/window/MediaWindow.qml",
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml"
}
FluApp.initialRoute = "/"
FluApp.run()

View File

@ -20,7 +20,7 @@ FluObject{
title:lang.settings
icon:FluentIcons.Settings
onTap:{
navigationView.push("qrc:/qml/page/T_Settings.qml")
navigationView.push("qrc:/example/qml/page/T_Settings.qml")
}
}
}

View File

@ -12,13 +12,13 @@ FluObject{
// icon:FluentIcons.Home
cusIcon: Image{
anchors.centerIn: parent
source: FluTheme.dark ? "qrc:/res/svg/home_dark.svg" : "qrc:/res/svg/home.svg"
source: FluTheme.dark ? "qrc:/example/res/svg/home_dark.svg" : "qrc:/example/res/svg/home.svg"
sourceSize: Qt.size(30,30)
width: 18
height: 18
}
onTap:{
navigationView.push("qrc:/qml/page/T_Home.qml")
navigationView.push("qrc:/example/qml/page/T_Home.qml")
}
}
@ -27,35 +27,35 @@ FluObject{
icon:FluentIcons.CheckboxComposite
FluPaneItem{
title:"Buttons"
image:"qrc:/res/image/control/Button.png"
image:"qrc:/example/res/image/control/Button.png"
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
onTap:{
navigationView.push("qrc:/qml/page/T_Buttons.qml")
navigationView.push("qrc:/example/qml/page/T_Buttons.qml")
}
}
FluPaneItem{
title:"Slider"
image:"qrc:/res/image/control/Slider.png"
image:"qrc:/example/res/image/control/Slider.png"
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
onTap:{
navigationView.push("qrc:/qml/page/T_Slider.qml")
navigationView.push("qrc:/example/qml/page/T_Slider.qml")
}
}
FluPaneItem{
title:"CheckBox"
image:"qrc:/res/image/control/Checkbox.png"
image:"qrc:/example/res/image/control/Checkbox.png"
recentlyUpdated:true
desc:"A control that a user can select or clear."
onTap:{
navigationView.push("qrc:/qml/page/T_CheckBox.qml")
navigationView.push("qrc:/example/qml/page/T_CheckBox.qml")
}
}
FluPaneItem{
title:"ToggleSwitch"
onTap:{
navigationView.push("qrc:/qml/page/T_ToggleSwitch.qml")
navigationView.push("qrc:/example/qml/page/T_ToggleSwitch.qml")
}
}
}
@ -66,31 +66,31 @@ FluObject{
FluPaneItem{
title:"TextBox"
onTap:{
navigationView.push("qrc:/qml/page/T_TextBox.qml")
navigationView.push("qrc:/example/qml/page/T_TextBox.qml")
}
}
FluPaneItem{
title:"TimePicker"
onTap:{
navigationView.push("qrc:/qml/page/T_TimePicker.qml")
navigationView.push("qrc:/example/qml/page/T_TimePicker.qml")
}
}
FluPaneItem{
title:"DatePicker"
onTap:{
navigationView.push("qrc:/qml/page/T_DatePicker.qml")
navigationView.push("qrc:/example/qml/page/T_DatePicker.qml")
}
}
FluPaneItem{
title:"CalendarPicker"
onTap:{
navigationView.push("qrc:/qml/page/T_CalendarPicker.qml")
navigationView.push("qrc:/example/qml/page/T_CalendarPicker.qml")
}
}
FluPaneItem{
title:"ColorPicker"
onTap:{
navigationView.push("qrc:/qml/page/T_ColorPicker.qml")
navigationView.push("qrc:/example/qml/page/T_ColorPicker.qml")
}
}
}
@ -100,53 +100,53 @@ FluObject{
icon:FluentIcons.SurfaceHub
FluPaneItem{
title:"InfoBar"
image:"qrc:/res/image/control/InfoBar.png"
image:"qrc:/example/res/image/control/InfoBar.png"
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
onTap:{
navigationView.push("qrc:/qml/page/T_InfoBar.qml")
navigationView.push("qrc:/example/qml/page/T_InfoBar.qml")
}
}
FluPaneItem{
title:"Progress"
onTap:{
navigationView.push("qrc:/qml/page/T_Progress.qml")
navigationView.push("qrc:/example/qml/page/T_Progress.qml")
}
}
FluPaneItem{
title:"RatingControl"
onTap:{
navigationView.push("qrc:/qml/page/T_RatingControl.qml")
navigationView.push("qrc:/example/qml/page/T_RatingControl.qml")
}
}
FluPaneItem{
title:"Badge"
onTap:{
navigationView.push("qrc:/qml/page/T_Badge.qml")
navigationView.push("qrc:/example/qml/page/T_Badge.qml")
}
}
FluPaneItem{
title:"Rectangle"
onTap:{
navigationView.push("qrc:/qml/page/T_Rectangle.qml")
navigationView.push("qrc:/example/qml/page/T_Rectangle.qml")
}
}
FluPaneItem{
title:"StatusView"
onTap:{
navigationView.push("qrc:/qml/page/T_StatusView.qml")
navigationView.push("qrc:/example/qml/page/T_StatusView.qml")
}
}
FluPaneItem{
title:"Carousel"
onTap:{
navigationView.push("qrc:/qml/page/T_Carousel.qml")
navigationView.push("qrc:/example/qml/page/T_Carousel.qml")
}
}
FluPaneItem{
title:"Expander"
onTap:{
navigationView.push("qrc:/qml/page/T_Expander.qml")
navigationView.push("qrc:/example/qml/page/T_Expander.qml")
}
}
}
@ -157,19 +157,19 @@ FluObject{
FluPaneItem{
title:"Dialog"
onTap:{
navigationView.push("qrc:/qml/page/T_Dialog.qml")
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
}
}
FluPaneItem{
title:"Tooltip"
onTap:{
navigationView.push("qrc:/qml/page/T_Tooltip.qml")
navigationView.push("qrc:/example/qml/page/T_Tooltip.qml")
}
}
FluPaneItem{
title:"Menu"
onTap:{
navigationView.push("qrc:/qml/page/T_Menu.qml")
navigationView.push("qrc:/example/qml/page/T_Menu.qml")
}
}
}
@ -179,60 +179,60 @@ FluObject{
icon:FluentIcons.AllApps
FluPaneItem{
title:"Pivot"
image:"qrc:/res/image/control/Pivot.png"
image:"qrc:/example/res/image/control/Pivot.png"
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
onTap:{
navigationView.push("qrc:/qml/page/T_Pivot.qml")
navigationView.push("qrc:/example/qml/page/T_Pivot.qml")
}
}
FluPaneItem{
title:"BreadcrumbBar"
onTap:{
navigationView.push("qrc:/qml/page/T_BreadcrumbBar.qml")
navigationView.push("qrc:/example/qml/page/T_BreadcrumbBar.qml")
}
}
FluPaneItem{
title:"TabView"
image:"qrc:/res/image/control/TabView.png"
image:"qrc:/example/res/image/control/TabView.png"
recentlyAdded:true
order:1
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
onTap:{
navigationView.push("qrc:/qml/page/T_TabView.qml")
navigationView.push("qrc:/example/qml/page/T_TabView.qml")
}
}
FluPaneItem{
title:"TreeView"
onTap:{
navigationView.push("qrc:/qml/page/T_TreeView.qml")
navigationView.push("qrc:/example/qml/page/T_TreeView.qml")
}
}
FluPaneItem{
title:"TableView"
image:"qrc:/res/image/control/DataGrid.png"
image:"qrc:/example/res/image/control/DataGrid.png"
recentlyAdded:true
order:4
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
onTap:{
navigationView.push("qrc:/qml/page/T_TableView.qml")
navigationView.push("qrc:/example/qml/page/T_TableView.qml")
}
}
FluPaneItem{
title:"MultiWindow"
onTap:{
navigationView.push("qrc:/qml/page/T_MultiWindow.qml")
navigationView.push("qrc:/example/qml/page/T_MultiWindow.qml")
}
}
FluPaneItem{
title:"FlipView"
image:"qrc:/res/image/control/FlipView.png"
image:"qrc:/example/res/image/control/FlipView.png"
recentlyAdded:true
order:2
desc:"Presents a collection of items that the user canflip through, one item at a time."
onTap:{
navigationView.push("qrc:/qml/page/T_FlipView.qml")
navigationView.push("qrc:/example/qml/page/T_FlipView.qml")
}
}
}
@ -243,19 +243,19 @@ FluObject{
FluPaneItem{
title:"Theme"
onTap:{
navigationView.push("qrc:/qml/page/T_Theme.qml")
navigationView.push("qrc:/example/qml/page/T_Theme.qml")
}
}
FluPaneItem{
title:"Typography"
onTap:{
navigationView.push("qrc:/qml/page/T_Typography.qml")
navigationView.push("qrc:/example/qml/page/T_Typography.qml")
}
}
FluPaneItem{
title:"Awesome"
onTap:{
navigationView.push("qrc:/qml/page/T_Awesome.qml")
navigationView.push("qrc:/example/qml/page/T_Awesome.qml")
}
}
}
@ -265,12 +265,12 @@ FluObject{
icon:FluentIcons.Media
FluPaneItem{
title:"MediaPlayer"
image:"qrc:/res/image/control/MediaPlayerElement.png"
image:"qrc:/example/res/image/control/MediaPlayerElement.png"
recentlyAdded:true
order:0
desc:"A control to display video and image content."
onTap:{
navigationView.push("qrc:/qml/page/T_MediaPlayer.qml")
navigationView.push("qrc:/example/qml/page/T_MediaPlayer.qml")
}
}
}

View File

@ -32,7 +32,7 @@ FluScrollablePage{
Layout.topMargin: 20
Layout.leftMargin: 5
Component.onCompleted: {
carousel.setData([{url:"qrc:/res/image/banner_1.jpg"},{url:"qrc:/res/image/banner_2.jpg"},{url:"qrc:/res/image/banner_3.jpg"}])
carousel.setData([{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}])
}
}
}
@ -44,7 +44,7 @@ FluScrollablePage{
width: 400
height: 300
Component.onCompleted: {
setData([{url:"qrc:/res/image/banner_1.jpg"},{url:"qrc:/res/image/banner_2.jpg"},{url:"qrc:/res/image/banner_3.jpg"}])
setData([{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}])
}
}'
}

View File

@ -25,17 +25,17 @@ FluScrollablePage{
}
FluFlipView{
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_2.jpg"
source: "qrc:/example/res/image/banner_2.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_3.jpg"
source: "qrc:/example/res/image/banner_3.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
@ -47,17 +47,17 @@ FluScrollablePage{
Layout.topMargin: -1
code:'FluFlipView{
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
@ -78,18 +78,18 @@ FluScrollablePage{
FluFlipView{
vertical:true
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
sourceSize: Qt.size(400,300)
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_2.jpg"
source: "qrc:/example/res/image/banner_2.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_3.jpg"
source: "qrc:/example/res/image/banner_3.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
@ -102,17 +102,17 @@ FluScrollablePage{
code:'FluFlipView{
vertical:true
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
source: "qrc:/example/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}

View File

@ -2,7 +2,7 @@
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import "qrc:///qml/global/"
import "qrc:///example/qml/global/"
import FluentUI
FluScrollablePage{
@ -15,7 +15,7 @@ FluScrollablePage{
ListModel{
id:model_header
ListElement{
icon:"qrc:/res/image/ic_home_github.png"
icon:"qrc:/example/res/image/ic_home_github.png"
title:"FluentUI GitHub"
desc:"The latest FluentUI controls and styles for your applications."
url:"https://github.com/zhuzichu520/FluentUI"
@ -30,7 +30,7 @@ FluScrollablePage{
fillMode:Image.PreserveAspectCrop
anchors.fill: parent
verticalAlignment: Qt.AlignTop
source: "qrc:/res/image/bg_home_header.png"
source: "qrc:/example/res/image/bg_home_header.png"
}
Rectangle{
anchors.fill: parent

View File

@ -79,7 +79,7 @@ FluScrollablePage{
Image {
asynchronous: true
anchors.fill: parent
source: "qrc:/res/svg/avatar_1.svg"
source: "qrc:/example/res/svg/avatar_1.svg"
sourceSize: Qt.size(width,height)
}
}
@ -91,7 +91,7 @@ FluScrollablePage{
asynchronous: true
anchors.fill: parent
sourceSize: Qt.size(width,height)
source: "qrc:/res/svg/avatar_2.svg"
source: "qrc:/example/res/svg/avatar_2.svg"
}
}
FluRectangle{
@ -102,7 +102,7 @@ FluScrollablePage{
asynchronous: true
anchors.fill: parent
sourceSize: Qt.size(width,height)
source: "qrc:/res/svg/avatar_3.svg"
source: "qrc:/example/res/svg/avatar_3.svg"
}
}
FluRectangle{
@ -113,7 +113,7 @@ FluScrollablePage{
asynchronous: true
anchors.fill: parent
sourceSize: Qt.size(width,height)
source: "qrc:/res/svg/avatar_4.svg"
source: "qrc:/example/res/svg/avatar_4.svg"
}
}
}
@ -123,7 +123,7 @@ FluScrollablePage{
radius:[25,25,25,25]
Image {
asynchronous: true
source: "qrc:/res/image/image_huoyin.webp"
source: "qrc:/example/res/image/image_huoyin.webp"
anchors.fill: parent
sourceSize: Qt.size(width,height)
}
@ -142,7 +142,7 @@ FluScrollablePage{
Image{
asynchronous: true
anchors.fill: parent
source: "qrc:/res/svg/avatar_4.svg"
source: "qrc:/example/res/svg/avatar_4.svg"
sourceSize: Qt.size(width,height)
}
}'

View File

@ -3,7 +3,7 @@ import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import FluentUI
import "qrc:///qml/global/"
import "qrc:///example/qml/global/"
import "../component"
FluScrollablePage{

View File

@ -24,7 +24,7 @@ FluScrollablePage{
}
function newTab(){
tab_view.appendTab("qrc:/res/image/favicon.ico","Document "+tab_view.count(),com_page,colors[Math.floor(Math.random() * 8)].dark)
tab_view.appendTab("qrc:/example/res/image/favicon.ico","Document "+tab_view.count(),com_page,colors[Math.floor(Math.random() * 8)].dark)
}
Component.onCompleted: {
@ -129,7 +129,7 @@ FluScrollablePage{
}
}
function newTab(){
tab_view.appendTab("qrc:/res/image/favicon.ico","Document 1",com_page,argument)
tab_view.appendTab("qrc:/example/res/image/favicon.ico","Document 1",com_page,argument)
}
}
'

View File

@ -128,12 +128,12 @@ FluWindow {
Image{
width: 164.55
height: 224.25
source: "qrc:/res/image/qrcode_wx.jpg"
source: "qrc:/example/res/image/qrcode_wx.jpg"
}
Image{
width: 162
height: 252
source: "qrc:/res/image/qrcode_zfb.jpg"
source: "qrc:/example/res/image/qrcode_zfb.jpg"
}
}
}

View File

@ -120,7 +120,7 @@ FluWindow {
asynchronous: true
anchors.fill: parent
sourceSize: Qt.size(100,100)
source: isMy ? "qrc:/res/svg/avatar_2.svg" : "qrc:/res/image/logo_openai.png"
source: isMy ? "qrc:/example/res/svg/avatar_2.svg" : "qrc:/example/res/image/logo_openai.png"
}
}

View File

@ -4,7 +4,8 @@ import QtQuick.Controls
import QtQuick.Layouts
import Qt.labs.platform
import FluentUI
import "qrc:///qml/global/"
import example
import "qrc:///example/qml/global/"
FluWindow {
@ -41,7 +42,7 @@ FluWindow {
SystemTrayIcon {
id:system_tray
visible: true
icon.source: "qrc:/res/image/favicon.ico"
icon.source: "qrc:/example/res/image/favicon.ico"
tooltip: "FluentUI"
menu: Menu {
MenuItem {
@ -88,7 +89,7 @@ FluWindow {
footerItems:ItemsFooter
z:11
displayMode:MainEvent.displayMode
logo: "qrc:/res/image/favicon.ico"
logo: "qrc:/example/res/image/favicon.ico"
title:"FluentUI"
autoSuggestBox:FluAutoSuggestBox{
width: 280

View File

@ -52,7 +52,7 @@ int main(int argc, char *argv[])
context->setContextProperty("lang",appInfo->lang());
});
context->setContextProperty("appInfo",appInfo);
const QUrl url(QStringLiteral("qrc:/qml/App.qml"));
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)

View File

@ -17,7 +17,7 @@ function Main() {
New-Item -ItemType Directory $archiveName
# 拷贝exe
Copy-Item bin\release\* $archiveName\
Copy-Item bin\release\* $archiveName\ -Force -Recurse | Out-Null
# 拷贝依赖
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName
# 删除不必要的文件

View File

@ -27,7 +27,7 @@ function Main() {
New-Item -ItemType Directory $archiveName
# 拷贝exe
Copy-Item bin\release\* $archiveName\
Copy-Item bin\release\* $archiveName\ -Force -Recurse | Out-Null
# 拷贝依赖
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName
# 删除不必要的文件

View File

@ -1,67 +1,59 @@
cmake_minimum_required(VERSION 3.16)
project(FluentUI)
project(fluentui LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 COMPONENTS Core Quick Svg REQUIRED)
set(QT_INSTALL_QML ${Qt6Core_DIR}/../../../qml)
set(TARGET_TYPE SHARED)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
if(WIN32)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release)
endif()
set(TARGET_RESOURCES res.qrc)
set(TARGET_SOURCES
Def.cpp
FluApp.cpp
FluColorSet.cpp
FluColors.cpp
FluRegister.cpp
FluTheme.cpp
Fluent.cpp
FluentUI.cpp
NativeEventFilter.cpp
WindowHelper.cpp
qml_plugin.cpp
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml)
file(GLOB_RECURSE CPP_FILES *.cpp *.h)
foreach(filepath ${CPP_FILES})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND sources_files ${filename})
endforeach(filepath)
file(GLOB_RECURSE QML_PATHS *.qml)
foreach(filepath ${QML_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND qml_files ${filename})
endforeach(filepath)
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp)
foreach(filepath ${RES_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND resource_files ${filename})
endforeach(filepath)
foreach(filepath IN LISTS qml_files resource_files)
string(REPLACE "imports/FluentUI/" "" filename ${filepath})
set_source_files_properties(${filepath} PROPERTIES QT_RESOURCE_ALIAS ${filename})
endforeach()
qt_add_qml_module(fluentui
OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FluentUI
VERSION 1.0
URI "FluentUI"
SOURCES ${sources_files}
QML_FILES ${qml_files}
RESOURCES ${resource_files}
)
set(TARGET_HEADERS
Def.h
FluApp.h
FluColorSet.h
FluColors.h
FluRegister.h
FluTheme.h
Fluent.h
FluentUI.h
NativeEventFilter.h
WindowHelper.h
qml_plugin.h
stdafx.h
set_target_properties(fluentui PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
add_definitions(-DVERSION_IN="1.0.0")
add_definitions(-DURI_STR="FluentUI")
add_library(${PROJECT_NAME} ${TARGET_TYPE} ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
target_link_libraries(fluentui PUBLIC
Qt::Core
Qt::Quick
Qt::Qml
)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE dwmapi user32)
else()
endif()
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick Qt6::Svg)
if(WIN32)
include(build_windows.cmake)
else()
include(build_macos.cmake)
target_link_libraries(fluentui PRIVATE dwmapi user32)
endif()

View File

@ -2,6 +2,7 @@
#define DEF_H
#include <QObject>
#include <QtQml/qqml.h>
namespace Fluent_DarkMode {
Q_NAMESPACE
@ -10,6 +11,7 @@ Q_NAMESPACE
Light = 0x1,
Dark = 0x2,
};
QML_NAMED_ELEMENT(FluDarkMode)
Q_ENUMS(Fluent_DarkModeType);
}
@ -1420,6 +1422,7 @@ enum class Fluent_AwesomeType {
SpeechSolidBold=0xf8b2,
ClickedOutLoudSolidBold=0xf8b3,
};
QML_NAMED_ELEMENT(FluentIcons)
Q_ENUMS(Fluent_AwesomeType)
}

View File

@ -1,4 +1,4 @@
#include "FluApp.h"
#include "FluApp.h"
#include <QQmlEngine>
#include <QGuiApplication>
@ -6,6 +6,7 @@
#include <QQuickItem>
#include <QTimer>
#include <QUuid>
#include <QFontDatabase>
#include <QClipboard>
#include "FluTheme.h"
#include "Def.h"
@ -24,29 +25,39 @@ static bool isCompositionEnabled()
}
#endif
FluApp* FluApp::m_instance = nullptr;
FluApp* FluApp::fluApp = nullptr;
FluTheme* FluApp::fluTheme = nullptr;
FluColors* FluApp::flutColors = nullptr;
FluApp *FluApp::getInstance()
{
if(FluApp::m_instance == nullptr){
FluApp::m_instance = new FluApp;
}
return FluApp::m_instance;
void FluApp::setFluApp(FluApp* val){
FluApp::fluApp = val;
}
void FluApp::setFluTheme(FluTheme* val){
FluApp::fluTheme = val;
}
void FluApp::setFluColors(FluColors* val){
FluApp::flutColors = val;
}
FluApp::FluApp(QObject *parent)
: QObject{parent}
{
QFontDatabase::addApplicationFont(":/FluentUI/Font/Segoe_Fluent_Icons.ttf");
}
void FluApp::init(QQuickWindow *window){
this->appWindow = window;
QQmlEngine *engine = qmlEngine(appWindow);
QQmlComponent component(engine, ":/FluentUI/Controls/FluSingleton.qml");
component.create();
nativeEvent = new NativeEventFilter();
qApp->installNativeEventFilter(nativeEvent);
}
void FluApp::run(){
#ifdef Q_OS_WIN
if(!isCompositionEnabled()){
FluTheme::getInstance()->frameless(false);
fluTheme->frameless(false);
}
#endif
navigate(initialRoute());
@ -66,7 +77,6 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
}
properties.insert("argument",argument);
QQuickWindow *view = qobject_cast<QQuickWindow*>(component.createWithInitialProperties(properties));
int launchMode = view->property("launchMode").toInt();
if(launchMode==1){
for (auto& pair : wnds) {
@ -88,8 +98,7 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
}
}
}
if(FluTheme::getInstance()->frameless()){
if(fluTheme->frameless()){
view->setFlag(Qt::FramelessWindowHint,true);
}
wnds.insert(view->winId(),view);

View File

@ -3,10 +3,14 @@
#include <QObject>
#include <QWindow>
#include <QtQml/qqml.h>
#include <QJsonArray>
#include <QQmlContext>
#include <QJsonObject>
#include <QQmlEngine>
#include "FluTheme.h"
#include "FluColors.h"
#include "NativeEventFilter.h"
#include "FluRegister.h"
#include "stdafx.h"
@ -15,31 +19,35 @@ class FluApp : public QObject
Q_OBJECT
Q_PROPERTY_AUTO(QString,initialRoute);
Q_PROPERTY_AUTO(QJsonObject,routes);
QML_NAMED_ELEMENT(FluApp)
QML_SINGLETON
public:
static FluApp *getInstance();
explicit FluApp(QObject *parent = nullptr);
~FluApp(){
if (nativeEvent != Q_NULLPTR) {
delete nativeEvent;
nativeEvent = Q_NULLPTR;
}
}
Q_INVOKABLE void run();
Q_INVOKABLE void navigate(const QString& route,const QJsonObject& argument = {},FluRegister* fluRegister = nullptr);
Q_INVOKABLE void init(QQuickWindow *window);
Q_INVOKABLE QJsonArray awesomelist(const QString& keyword = "");
Q_INVOKABLE void clipText(const QString& text);
Q_INVOKABLE QString uuid();
Q_INVOKABLE void closeApp();
Q_INVOKABLE void setFluApp(FluApp* val);
Q_INVOKABLE void setFluTheme(FluTheme* val);
Q_INVOKABLE void setFluColors(FluColors* val);
public:
QMap<quint64, QQuickWindow*> wnds;
static FluApp* fluApp;
static FluTheme* fluTheme;
static FluColors* flutColors;
private:
static FluApp* m_instance;
NativeEventFilter *nativeEvent = Q_NULLPTR;
QWindow *appWindow;
};

View File

@ -1,15 +1,5 @@
#include "FluColors.h"
FluColors* FluColors::m_instance = nullptr;
FluColors *FluColors::getInstance()
{
if(FluColors::m_instance == nullptr){
FluColors::m_instance = new FluColors;
}
return FluColors::m_instance;
}
FluColors::FluColors(QObject *parent)
: QObject{parent}
{

View File

@ -2,6 +2,7 @@
#define FLUCOLORS_H
#include <QObject>
#include <QtQml/qqml.h>
#include "FluColorSet.h"
#include "stdafx.h"
@ -41,13 +42,10 @@ class FluColors : public QObject
Q_PROPERTY_AUTO(FluColorSet*,Blue);
Q_PROPERTY_AUTO(FluColorSet*,Teal);
Q_PROPERTY_AUTO(FluColorSet*,Green);
QML_NAMED_ELEMENT(FluColors)
QML_SINGLETON
public:
explicit FluColors(QObject *parent = nullptr);
static FluColors *getInstance();
private:
static FluColors* m_instance;
};
#endif // FLUCOLORS_H

View File

@ -12,7 +12,7 @@ FluRegister::FluRegister(QObject *parent)
}
void FluRegister::launch(const QJsonObject& argument){
FluApp::getInstance()->navigate(path(),argument,this);
FluApp::fluApp->navigate(path(),argument,this);
}
void FluRegister::onResult(const QJsonObject& data){

View File

@ -1,27 +1,17 @@
#include "FluTheme.h"
#include "FluColors.h"
#include "Def.h"
#include <QPalette>
#include "FluApp.h"
#include <QGuiApplication>
FluTheme* FluTheme::m_instance = nullptr;
FluTheme *FluTheme::getInstance()
{
if(FluTheme::m_instance == nullptr){
FluTheme::m_instance = new FluTheme;
}
return FluTheme::m_instance;
}
FluTheme::FluTheme(QObject *parent)
: QObject{parent}
{
connect(this,&FluTheme::darkModeChanged,this,[=]{
Q_EMIT darkChanged();
});
primaryColor(FluColors::getInstance()->Blue());
primaryColor(FluApp::flutColors->Blue());
textSize(13);
nativeText(false);
frameless(true);

View File

@ -2,6 +2,7 @@
#define FLUTHEME_H
#include <QObject>
#include <QtQml/qqml.h>
#include "FluColorSet.h"
#include "stdafx.h"
@ -14,13 +15,13 @@ class FluTheme : public QObject
Q_PROPERTY_AUTO(int,darkMode);
Q_PROPERTY_AUTO(bool,nativeText);
Q_PROPERTY_AUTO(int,textSize);
QML_NAMED_ELEMENT(FluTheme)
QML_SINGLETON
public:
explicit FluTheme(QObject *parent = nullptr);
static FluTheme *getInstance();
bool dark();
Q_SIGNAL void darkChanged();
private:
static FluTheme* m_instance;
bool _dark;
bool eventFilter(QObject *obj, QEvent *event);
bool systemDark();

View File

@ -1,121 +0,0 @@
#include "Fluent.h"
#include <QFontDatabase>
#include <QQmlContext>
#include <QGuiApplication>
#include <QQuickWindow>
#include "FluColors.h"
#include "NativeEventFilter.h"
#include "FluTheme.h"
#include "WindowHelper.h"
#include "FluApp.h"
#include "Def.h"
Fluent* Fluent::m_instance = nullptr;
Fluent *Fluent::getInstance()
{
if(Fluent::m_instance == nullptr){
Fluent::m_instance = new Fluent;
}
return Fluent::m_instance;
}
QString Fluent::version() const
{
return QStringLiteral(VERSION_IN);
}
void Fluent::registerTypes(const char *uri){
Q_INIT_RESOURCE(res);
int major = 1;
int minor = 0;
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBreadcrumbBar.qml"),uri,major,minor,"FluBreadcrumbBar");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluRatingControl.qml"),uri,major,minor,"FluRatingControl");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluStatusView.qml"),uri,major,minor,"FluStatusView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPagination.qml"),uri,major,minor,"FluPagination");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluToggleButton.qml"),uri,major,minor,"FluToggleButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTableView.qml"),uri,major,minor,"FluTableView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivotItem.qml"),uri,major,minor,"FluPivotItem");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivot.qml"),uri,major,minor,"FluPivot");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFlipView.qml"),uri,major,minor,"FluFlipView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemExpander.qml"),uri,major,minor,"FluPaneItemExpander");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMediaPlayer.qml"),uri,major,minor,"FluMediaPlayer");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluContentPage.qml"),uri,major,minor,"FluContentPage");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluScrollablePage.qml"),uri,major,minor,"FluScrollablePage");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemHeader.qml"),uri,major,minor,"FluPaneItemHeader");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItem.qml"),uri,major,minor,"FluPaneItem");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemSeparator.qml"),uri,major,minor,"FluPaneItemSeparator");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluNavigationView.qml"),uri,major,minor,"FluNavigationView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCalendarPicker.qml"),uri,major,minor,"FluCalendarPicker");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCalendarView.qml"),uri,major,minor,"FluCalendarView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDatePicker.qml"),uri,major,minor,"FluDatePicker");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTimePicker.qml"),uri,major,minor,"FluTimePicker");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluColorView.qml"),uri,major,minor,"FluColorView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluColorPicker.qml"),uri,major,minor,"FluColorPicker");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCarousel.qml"),uri,major,minor,"FluCarousel");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluAutoSuggestBox.qml"),uri,major,minor,"FluAutoSuggestBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluExpander.qml"),uri,major,minor,"FluExpander");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTreeView.qml"),uri,major,minor,"FluTreeView");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluContentDialog.qml"),uri,major,minor,"FluContentDialog");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenuItem.qml"),uri,major,minor,"FluMenuItem");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenu.qml"),uri,major,minor,"FluMenu");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluScrollBar.qml"),uri,major,minor,"FluScrollBar");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTextButton.qml"),uri,major,minor,"FluTextButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMultilineTextBox.qml"),uri,major,minor,"FluMultilineTextBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTooltip.qml"),uri,major,minor,"FluTooltip");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDivider.qml"),uri,major,minor,"FluDivider");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluIcon.qml"),uri,major,minor,"FluIcon");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluObject.qml"),uri,major,minor,"FluObject");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluInfoBar.qml"),uri,major,minor,"FluInfoBar");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluWindow.qml"),uri,major,minor,"FluWindow");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluRectangle.qml"),uri,major,minor,"FluRectangle");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluAppBar.qml"),uri,major,minor,"FluAppBar");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluButton.qml"),uri,major,minor,"FluButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCheckBox.qml"),uri,major,minor,"FluCheckBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluComboBox.qml"),uri,major,minor,"FluComboBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDropDownButton.qml"),uri,major,minor,"FluDropDownButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFilledButton.qml"),uri,major,minor,"FluFilledButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluIconButton.qml"),uri,major,minor,"FluIconButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluProgressBar.qml"),uri,major,minor,"FluProgressBar");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluProgressRing.qml"),uri,major,minor,"FluProgressRing");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluRadioButton.qml"),uri,major,minor,"FluRadioButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluSlider.qml"),uri,major,minor,"FluSlider");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTextBox.qml"),uri,major,minor,"FluTextBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPasswordBox.qml"),uri,major,minor,"FluPasswordBox");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluText.qml"),uri,major,minor,"FluText");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFilledButton.qml"),uri,major,minor,"FluFilledButton");
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluToggleSwitch.qml"),uri,major,minor,"FluToggleSwitch");
qmlRegisterUncreatableMetaObject(Fluent_Awesome::staticMetaObject, uri,major,minor,"FluentIcons", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(Fluent_DarkMode::staticMetaObject, uri,major,minor,"FluDarkMode", "Access to enums & flags only");
}
void Fluent::initializeEngine(QQmlEngine *engine, const char *uri)
{
nativeEvent = new NativeEventFilter();
qApp->installNativeEventFilter(nativeEvent);
Q_UNUSED(engine)
Q_UNUSED(uri)
#ifdef Q_OS_WIN
QFont font;
font.setFamily("Microsoft YaHei");
QGuiApplication::setFont(font);
// QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
#endif
QFontDatabase::addApplicationFont(":/com.zhuzichu/res/font/Segoe_Fluent_Icons.ttf");
FluApp* app = FluApp::getInstance();
engine->rootContext()->setContextProperty("FluApp",app);
FluColors* colors = FluColors::getInstance();
engine->rootContext()->setContextProperty("FluColors",colors);
FluTheme* theme = FluTheme::getInstance();
engine->rootContext()->setContextProperty("FluTheme",theme);
}

View File

@ -1,27 +0,0 @@
#ifndef FLUENT_H
#define FLUENT_H
#include <QObject>
#include <QQmlEngine>
#include "NativeEventFilter.h"
class Fluent: public QObject
{
Q_OBJECT
public:
Q_INVOKABLE QString version() const;
~Fluent(){
if (nativeEvent != Q_NULLPTR) {
delete nativeEvent;
nativeEvent = Q_NULLPTR;
}
}
void registerTypes(const char *uri);
void initializeEngine(QQmlEngine *engine, const char *uri);
static Fluent *getInstance();
private:
static Fluent* m_instance;
NativeEventFilter *nativeEvent = Q_NULLPTR;
};
#endif // FLUENT_H

View File

@ -1,15 +0,0 @@
#include "FluentUI.h"
#include "Fluent.h"
void FluentUI::registerTypes(const char *uri){
Fluent::getInstance()->registerTypes(uri);
}
void FluentUI::initializeEngine(QQmlEngine *engine, const char *uri){
Fluent::getInstance()->initializeEngine(engine,uri);
}
void FluentUI::initialize(QQmlEngine *engine){
Fluent::getInstance()->registerTypes(URI_STR);
Fluent::getInstance()->initializeEngine(engine,URI_STR);
}

View File

@ -1,15 +0,0 @@
#ifndef FLUENTUI_H
#define FLUENTUI_H
#include <QQmlEngine>
class Q_DECL_EXPORT FluentUI
{
public:
static void registerTypes(const char *uri) ;
static void initializeEngine(QQmlEngine *engine, const char *uri);
static void initialize(QQmlEngine *engine);
};
#endif // FLUENTUI_H

View File

@ -1,51 +0,0 @@
QT += qml quick svg
CONFIG += plugin c++17
TEMPLATE = lib
TARGET = FluentUI
TARGET = $$qtLibraryTarget($$TARGET)
uri = FluentUI
CONFIG += sharedlib # staticlib or sharedlib
RESOURCES += \
res.qrc
HEADERS += \
Def.h \
FluApp.h \
FluColorSet.h \
FluColors.h \
FluRegister.h \
FluTheme.h \
Fluent.h \
FluentUI.h \
NativeEventFilter.h \
WindowHelper.h \
qml_plugin.h \
stdafx.h
SOURCES += \
Def.cpp \
FluApp.cpp \
FluColorSet.cpp \
FluColors.cpp \
FluRegister.cpp \
FluTheme.cpp \
Fluent.cpp \
FluentUI.cpp \
NativeEventFilter.cpp \
WindowHelper.cpp \
qml_plugin.cpp \
win32 {
LIBS += -ldwmapi -luser32
}
DEFINES += VERSION_IN=\\\"1.0.0\\\"
DEFINES += URI_STR=\\\"$$uri\\\"
contains(QMAKE_HOST.os,Windows) {
include(./build_windows.pri)
}else{
include(./build_macos.pri)
}

View File

@ -11,11 +11,11 @@
bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
{
#ifdef Q_OS_WIN
if (eventType == "windows_generic_MSG" && FluTheme::getInstance()->frameless()) {
if (eventType == "windows_generic_MSG" && FluApp::fluTheme->frameless()) {
MSG* msg = static_cast<MSG *>(message);
if (msg == Q_NULLPTR)
return false;
if(!FluApp::getInstance()->wnds.contains((WId)msg->hwnd)){
if(!FluApp::fluApp->wnds.contains((WId)msg->hwnd)){
return false;
}
switch(msg->message) {
@ -27,7 +27,7 @@ bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *mes
return true;
}
case WM_NCHITTEST: {
auto view = FluApp::getInstance()->wnds[(WId)msg->hwnd];
auto view = FluApp::fluApp->wnds[(WId)msg->hwnd];
bool isResize = !(view->maximumWidth()==view->minimumWidth()&&view->maximumHeight()==view->minimumHeight());
const LONG borderWidth = 8;
RECT winrect;

View File

@ -30,7 +30,7 @@ void WindowHelper::initWindow(QQuickWindow* window){
void WindowHelper::firstUpdate(){
if(isFisrt){
#ifdef Q_OS_WIN
if(FluTheme::getInstance()->frameless()){
if(FluApp::fluTheme->frameless()){
HWND wnd = (HWND)window->winId();
SetWindowLongPtr(wnd, GWL_STYLE, static_cast<LONG>(Style::aero_borderless));
const MARGINS shadow_on = { 1, 1, 1, 1 };
@ -54,7 +54,7 @@ QVariant WindowHelper::createRegister(QQuickWindow* window,const QString& path){
void WindowHelper::destoryWindow(){
if(this->window){
FluApp::getInstance()->wnds.remove(this->window->winId());
FluApp::fluApp->wnds.remove(this->window->winId());
this->window->deleteLater();
}
}

View File

@ -3,6 +3,7 @@
#include <QObject>
#include <QQuickWindow>
#include <QtQml/qqml.h>
#include <QQuickItem>
#include <QWindow>
#include <QJsonObject>
@ -10,14 +11,13 @@
class WindowHelper : public QObject
{
Q_OBJECT
QML_NAMED_ELEMENT(WindowHelper)
public:
explicit WindowHelper(QObject *parent = nullptr);
Q_INVOKABLE void initWindow(QQuickWindow* window);
Q_INVOKABLE void destoryWindow();
Q_INVOKABLE QVariant createRegister(QQuickWindow* window,const QString& path);
Q_INVOKABLE void firstUpdate();
private:

View File

@ -1,4 +0,0 @@
module FluentUI
plugin FluentUI
classname FluentUIQmlPlugin
typeinfo plugin.qmltypes

View File

@ -1,32 +0,0 @@
set(OUTP ${CMAKE_BINARY_DIR}/bin/FluentUI/)
add_definitions(-DMACOS)
set(CMAKE_INSTALL_PREFIX ${OUTP})
set(CMAKE_INSTALL_DESTDIR ${OUTP})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(QMAKE_MOC_OPTIONS -Muri=${uri})
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND chmod -R 777 ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh
)
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh PRESET ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP}
)
if(${TARGET_TYPE} STREQUAL "SHARED")
set(INST_QMLPATH ${QT_INSTALL_QML}/FluentUI)
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh INSTALL ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP} ${INST_QMLPATH}
)
endif()

View File

@ -1,17 +0,0 @@
OUTP = $$OUT_PWD/../bin/FluentUI/
DESTDIR += $$OUTP
QMAKE_MOC_OPTIONS += -Muri=$$uri
QMAKE_PRE_LINK += chmod -R 777 $$PWD/macos_install.sh;
QMAKE_PRE_LINK += $$PWD/macos_install.sh PRESET $$PWD/ $$OUTP;
CONFIG(sharedlib){
INST_QMLPATH = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
QMAKE_POST_LINK += $$PWD/macos_install.sh INSTALL $$PWD/ $$OUTP $$INST_QMLPATH;
exists($$PWD/../../dev.pri){
include($$PWD/../../dev.pri)
}
}

View File

@ -1,27 +0,0 @@
set(OUTP "${CMAKE_BINARY_DIR}/bin/FluentUI")
set(BUILDBIN_PATH "${OUTP}")
set(QTQMLFLUENT_PATH "${QT_INSTALL_QML}/FluentUI")
set(PRESET_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-preset")
set(SOLIBFILE_PATH "${CMAKE_BINARY_DIR}/libFluentUI.so")
set(ANDROID NO)
if (ANDROID)
set(ANDROID YES)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTP})
else()
set(CMAKE_INSTALL_PREFIX "${OUTP}")
endif()
set(SHAREDSCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/win_install.bat SHARED ${CMAKE_CURRENT_SOURCE_DIR} ${PRESET_PATH} ${BUILDBIN_PATH} ${QTQMLFLUENT_PATH} ${ANDROID} ${SOLIBFILE_PATH})
set(STATICSCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/win_install.bat STATIC ${CMAKE_CURRENT_SOURCE_DIR} ${PRESET_PATH} ${BUILDBIN_PATH} ${QTQMLFLUENT_PATH} ${ANDROID} ${SOLIBFILE_PATH})
string(REPLACE "/" "\\" SHAREDSCRIPT "${SHAREDSCRIPT}")
string(REPLACE "/" "\\" STATICSCRIPT "${STATICSCRIPT}")
if (${TARGET_TYPE} STREQUAL "SHARED")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${SHAREDSCRIPT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
else()
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${STATICSCRIPT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif()

View File

@ -1,20 +0,0 @@
OUTP = $$OUT_PWD/../bin/FluentUI
BUILDBIN_PATH = $$replace(OUTP, src/../bin, bin)
QTQMLFLUENT_PATH = $$[QT_INSTALL_QML]/FluentUI
PRESET_PATH = $$PWD/build-preset
SOLIBFILE_PATH = $$OUT_PWD/libFluentUI.so
ANDROID = NO
android{
ANDROID=YES
QMAKE_PRE_LINK *= md $$replace(OUTP, /, \\)
}else{
DESTDIR += $$OUTP
}
SHAREDSCRIPT = "$$PWD\win_install.bat" SHARED "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
STATICSCRIPT = "$$PWD\win_install.bat" STATIC "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
CONFIG(sharedlib){
QMAKE_POST_LINK *= $$replace(SHAREDSCRIPT, /, \\)
}
else{
QMAKE_POST_LINK *= $$replace(STATICSCRIPT, /, \\)
}

View File

@ -1,7 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "content"
import "Content"
Rectangle {
id: colorPicker

View File

@ -1,4 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
Rectangle{

View File

@ -1,5 +1,7 @@
import QtQuick
import "../colorpicker"
import QtQuick.Controls
import FluentUI
import "ColorPicker"
Item {

View File

@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Controls
import FluentUI
Item {

View File

@ -2,6 +2,7 @@
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Window
import FluentUI
Popup {
id: popup

View File

@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Controls
import FluentUI
Item {

View File

@ -1,4 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
Text {

View File

@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Controls
import FluentUI
FluObject {

View File

@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import FluentUI
Menu {

View File

@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
Item {
@ -16,7 +17,6 @@ Item {
}
height: 32
Rectangle{
anchors.centerIn: parent
width: control.width-40

View File

@ -1,4 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
QtObject {
id:flu_object;

View File

@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Controls
import FluentUI
QtObject {

View File

@ -1,4 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
QtObject {
readonly property string key : FluApp.uuid()

View File

@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Controls
import FluentUI
FluObject {

View File

@ -1,4 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
QtObject {
readonly property string key : FluApp.uuid()

View File

@ -1,4 +1,6 @@
import QtQuick
import QtQuick.Controls
import FluentUI
QtObject {
readonly property string key : FluApp.uuid()

Some files were not shown because too many files have changed in this diff Show More