Compare commits

..

81 Commits

Author SHA1 Message Date
ef65183320 Merge branch '1.7.6-dev' 2024-06-04 17:53:17 +08:00
2e379fcd7e Merge pull request #518 from ArcticLampyrid/patch-1
Make static lib available (#509)
2024-05-31 12:51:28 +05:30
0a8732c91b Merge pull request #519 from ArcticLampyrid/patch-2
remove `registerForWindowResult` which is not used (#506)
2024-05-31 12:50:24 +05:30
b98c5d327a remove registerForWindowResult which is not used (#506) 2024-05-31 14:02:33 +08:00
7163c739c2 make static lib available (#509) 2024-05-31 13:59:36 +08:00
5cfd9824a8 update 2024-05-19 13:40:36 +08:00
a27554bfb2 update 2024-05-17 21:27:41 +08:00
7a67ccc1e1 update 2024-05-17 21:19:10 +08:00
39f58278ff update 2024-05-16 01:26:59 +08:00
354f7f2e3e add hotkey 2024-05-16 00:35:04 +08:00
876b230141 update 2024-05-13 18:28:28 +08:00
2367c6978a update 2024-05-11 22:21:11 +08:00
6b941697b0 update 2024-05-11 21:45:45 +08:00
4997b991db update 2024-05-10 19:23:30 +08:00
cd3abc01e9 fix bug 2024-05-10 19:20:01 +08:00
e6c4b79298 Merge branch 'main' into 1.7.6-dev
# Conflicts:
#	src/Qt5/imports/FluentUI/Controls/FluRadioButtons.qml
#	src/Qt6/imports/FluentUI/Controls/FluRadioButtons.qml
2024-05-10 12:26:14 +08:00
f830d5a9bf Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2024-05-09 19:41:15 +08:00
ed49e3f6af Merge pull request #499 from gao-xiangyang/main
info提示语支持主动调用函数关闭,支持关闭所有info框的函数
2024-05-09 17:10:34 +05:30
9aa6615189 FluRadioButtons 组件支持 disabled、manuallyDisabled选项
disabled: true // 禁用所有FluRadioButton子组件
        manuallyDisabled: true // 是否指定每个FluRadioButton上的disabled选项
2024-05-08 21:10:00 +08:00
c36515f19c info提示语支持主动调用函数关闭,支持关闭所有info框的函数 2024-05-08 20:35:31 +08:00
402579f32a update 2024-05-08 18:58:22 +08:00
655eff4f62 update 2024-05-07 22:16:42 +08:00
b916221d9f update 2024-05-07 21:47:40 +08:00
4cca680029 update 2024-05-05 22:05:18 +08:00
fe2543ab4d fix bug 2024-05-05 22:03:41 +08:00
394a42cb94 update 2024-05-05 21:33:47 +08:00
ac253a3de5 fix bug 2024-05-05 20:32:48 +08:00
0d61e33ef1 update 2024-05-05 15:52:46 +08:00
132ab12c32 update 2024-05-05 00:06:01 +08:00
af270951da update 2024-05-04 23:56:20 +08:00
18685b17ec update 2024-05-03 16:56:40 +08:00
0eb4d9f346 update 2024-05-03 01:54:38 +08:00
8015dcc2f1 update 2024-05-02 23:52:30 +08:00
0b1755e9eb update 2024-05-01 01:11:25 +08:00
e471d5a230 update 2024-04-30 19:38:05 +08:00
f922978338 update 2024-04-30 19:27:57 +08:00
91bda2a22c update 2024-04-30 13:07:46 +08:00
6638fe2e06 update 2024-04-30 13:06:27 +08:00
bf001d99d2 update 2024-04-30 12:59:09 +08:00
30531079b5 update 2024-04-29 10:12:34 +08:00
a746bc2684 update 2024-04-28 21:05:43 +08:00
96a6d0e7fa update 2024-04-28 20:22:05 +08:00
c733f3c60e update 2024-04-28 18:38:37 +08:00
effd9f3058 update 2024-04-28 18:19:21 +08:00
d93aac3518 update 2024-04-28 15:56:37 +08:00
5f6745b630 udpate 2024-04-28 13:03:20 +08:00
4f202831b8 Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2024-04-28 10:51:29 +08:00
29cee84edd update 2024-04-28 10:51:13 +08:00
2d4e61445e Merge pull request #488 from yanhuacuo/path-for-insertRow
Add the functionality to insert new rows into the table
2024-04-28 10:47:28 +08:00
cc79854191 Merge pull request #489 from w-jt/main
FluPagination.qml 添加自定义控件,通过header和footer属性添加控件
2024-04-28 10:46:47 +08:00
500efa6298 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:54:42 +08:00
355332da96 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:53:57 +08:00
a0d662a8a5 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:49:29 +08:00
aecc3fe3b4 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:48:19 +08:00
3554fb99cd Add the functionality to insert new rows into the table 2024-04-27 09:40:37 +08:00
24fdff7e35 fix bug 2024-04-25 00:08:18 +08:00
d2fdd08604 update 2024-04-24 17:24:31 +08:00
1f5d6ce1aa update 2024-04-24 17:12:00 +08:00
5fd7c7d10e update 2024-04-24 10:37:15 +08:00
83507a6ed5 update 2024-04-24 09:57:28 +08:00
789d9164a1 Merge branch '1.7.5-dev' 2024-04-24 09:53:59 +08:00
cb44759978 update 2024-04-23 22:38:39 +08:00
04c52b1b25 fix bug 2024-04-23 21:19:32 +08:00
b8ef9169b9 update 2024-04-23 19:33:05 +08:00
c7de653ba2 update 2024-04-23 13:41:26 +08:00
2ddb7e3290 update 2024-04-23 00:32:15 +08:00
e8d79e3c7b update 2024-04-23 00:31:20 +08:00
bc4510077f update 2024-04-19 01:04:13 +08:00
179bc8b21f update 2024-04-19 00:42:35 +08:00
8fe4e3b047 update 2024-04-17 22:05:49 +08:00
a443f3a9ba update 2024-04-17 21:39:55 +08:00
1a0f2afee0 update 2024-04-17 15:11:14 +08:00
c9c737f2fc update 2024-04-16 12:36:41 +08:00
f0f00b9eba Merge pull request #483 from mariuszmaximus/main
fix for msys2
2024-04-15 12:39:47 +08:00
956f2e0ad0 fix for msys2 2024-04-14 19:38:52 +02:00
ecd13a9cca update 2024-04-15 00:11:41 +08:00
17bfff2346 update 2024-04-14 23:58:15 +08:00
295dcf02c4 update 2024-04-14 23:09:41 +08:00
f701f97756 update 2024-04-14 11:43:32 +08:00
2c4cf82f63 update 2024-04-13 22:00:15 +08:00
e8c47e0fd8 update 2024-04-13 21:30:23 +08:00
119 changed files with 6809 additions and 3650 deletions

View File

@ -91,14 +91,14 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: zhuzichu520/inno-setup-action@v1.0.1 uses: zhuzichu520/inno-setup-action@v1.0.1
with: with:
filepath: ./action-cli/InstallerScript.iss filepath: ./package/InstallerScript.iss
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./action-cli/installer.exe file: ./package/installer.exe
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

View File

@ -78,14 +78,14 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: zhuzichu520/inno-setup-action@v1.0.1 uses: zhuzichu520/inno-setup-action@v1.0.1
with: with:
filepath: ./action-cli/InstallerScript.iss filepath: ./package/InstallerScript.iss
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./action-cli/installer.exe file: ./package/installer.exe
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

View File

@ -85,14 +85,14 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: zhuzichu520/inno-setup-action@v1.0.1 uses: zhuzichu520/inno-setup-action@v1.0.1
with: with:
filepath: ./action-cli/InstallerScript.iss filepath: ./package/InstallerScript.iss
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./action-cli/installer.exe file: ./package/installer.exe
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

4
.gitignore vendored
View File

@ -36,10 +36,8 @@ bin
build build
cmake-build-* cmake-build-*
.idea .idea
package
example/Version.h example/Version.h
action-cli
dist dist
*.qm *.qm

View File

@ -13,7 +13,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.cmake/)
include(GetGitRevisionDescription) include(GetGitRevisionDescription)
option(FLUENTUI_BUILD_EXAMPLES "Build FluentUI demo applications." ON) option(FLUENTUI_BUILD_EXAMPLES "Build FluentUI demo applications." ON)
set(FLUENTUI_BUILD_STATIC_LIB OFF) option(FLUENTUI_BUILD_STATIC_LIB "Build static library." OFF)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)

View File

@ -34,6 +34,38 @@ providing powerful tools and support for this project.
For more information about the Qt project, For more information about the Qt project,
please visit the official Qt website (https://www.qt.io/). please visit the official Qt website (https://www.qt.io/).
************************************************************************************
QHotkey
Copyright (c) 2016, Felix Barz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of QHotkey nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
************************************************************************************ ************************************************************************************
framelesshelper framelesshelper

View File

@ -28,8 +28,8 @@ find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network)
#添加国际化脚本 #添加国际化脚本
find_program(QT_LUPDATE NAMES lupdate) find_program(QT_LUPDATE NAMES lupdate lupdate-qt6)
find_program(QT_LRELEASE NAMES lrelease) find_program(QT_LRELEASE NAMES lrelease lrelease-qt6)
file(GLOB TS_FILE_PATHS ${CMAKE_CURRENT_LIST_DIR}/ *.ts) file(GLOB TS_FILE_PATHS ${CMAKE_CURRENT_LIST_DIR}/ *.ts)
add_custom_target(Script-UpdateTranslations add_custom_target(Script-UpdateTranslations
COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
@ -69,7 +69,7 @@ if (WIN32)
) )
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/.cmake/InstallerScript.iss.in ${CMAKE_SOURCE_DIR}/.cmake/InstallerScript.iss.in
${CMAKE_SOURCE_DIR}/action-cli/InstallerScript.iss ${CMAKE_SOURCE_DIR}/package/InstallerScript.iss
) )
endif () endif ()

View File

@ -180,7 +180,6 @@
<file>qml/window/PageWindow.qml</file> <file>qml/window/PageWindow.qml</file>
<file>qml/page/T_StaggeredLayout.qml</file> <file>qml/page/T_StaggeredLayout.qml</file>
<file>qml/page/T_Clip.qml</file> <file>qml/page/T_Clip.qml</file>
<file>qml/page/T_3D.qml</file>
<file>qml/page/T_Network.qml</file> <file>qml/page/T_Network.qml</file>
<file>qml/page/T_ShortcutPicker.qml</file> <file>qml/page/T_ShortcutPicker.qml</file>
<file>qml/chart/T_BarChart.qml</file> <file>qml/chart/T_BarChart.qml</file>
@ -210,6 +209,7 @@
<file>qml/window/FluentInitializrWindow.qml</file> <file>qml/window/FluentInitializrWindow.qml</file>
<file>qml/page/T_OpenGL.qml</file> <file>qml/page/T_OpenGL.qml</file>
<file>qml/page/T_Icons.qml</file> <file>qml/page/T_Icons.qml</file>
<file>qml/window/HotkeyWindow.qml</file>
</qresource> </qresource>
<qresource prefix="/"/> <qresource prefix="/"/>
</RCC> </RCC>

View File

@ -1,6 +1,54 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1" language="en_US"> <TS version="2.1" language="en_US">
<context>
<name>App</name>
<message>
<location filename="qml/App.qml" line="61"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="68"/>
<source>Test1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="75"/>
<source>Test2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="82"/>
<source>Test3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="89"/>
<source>Test4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="96"/>
<source>Test5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="103"/>
<source>Test6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="110"/>
<source>Test7</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/App.qml" line="117"/>
<source>Test8</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>CodeExpander</name> <name>CodeExpander</name>
<message> <message>
@ -71,6 +119,14 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>HotkeyWindow</name>
<message>
<location filename="qml/window/HotkeyWindow.qml" line="11"/>
<source>Hotkey</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>HotloadWindow</name> <name>HotloadWindow</name>
<message> <message>
@ -515,11 +571,6 @@
</message> </message>
<message> <message>
<location filename="qml/global/ItemsOriginal.qml" line="487"/> <location filename="qml/global/ItemsOriginal.qml" line="487"/>
<source>3D</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/global/ItemsOriginal.qml" line="493"/>
<source>Test Crash</source> <source>Test Crash</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -551,104 +602,104 @@
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="83"/> <location filename="qml/window/MainWindow.qml" line="87"/>
<location filename="qml/window/MainWindow.qml" line="91"/> <location filename="qml/window/MainWindow.qml" line="95"/>
<source>Quit</source> <source>Quit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="84"/> <location filename="qml/window/MainWindow.qml" line="88"/>
<source>Are you sure you want to exit the program?</source> <source>Are you sure you want to exit the program?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="85"/> <location filename="qml/window/MainWindow.qml" line="89"/>
<source>Minimize</source> <source>Minimize</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="88"/> <location filename="qml/window/MainWindow.qml" line="92"/>
<source>Friendly Reminder</source> <source>Friendly Reminder</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="88"/> <location filename="qml/window/MainWindow.qml" line="92"/>
<source>FluentUI is hidden from the tray, click on the tray to activate the window again</source> <source>FluentUI is hidden from the tray, click on the tray to activate the window again</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="92"/> <location filename="qml/window/MainWindow.qml" line="96"/>
<location filename="qml/window/MainWindow.qml" line="336"/> <location filename="qml/window/MainWindow.qml" line="340"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="103"/> <location filename="qml/window/MainWindow.qml" line="107"/>
<source>Open in Separate Window</source> <source>Open in Separate Window</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="200"/> <location filename="qml/window/MainWindow.qml" line="204"/>
<source>Click Time</source> <source>Click Time</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="210"/> <location filename="qml/window/MainWindow.qml" line="214"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="301"/> <location filename="qml/window/MainWindow.qml" line="305"/>
<source>Finish</source> <source>Finish</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="302"/> <location filename="qml/window/MainWindow.qml" line="306"/>
<source>Next</source> <source>Next</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="303"/> <location filename="qml/window/MainWindow.qml" line="307"/>
<source>Previous</source> <source>Previous</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="307"/> <location filename="qml/window/MainWindow.qml" line="311"/>
<source>Dark Mode</source> <source>Dark Mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="307"/> <location filename="qml/window/MainWindow.qml" line="311"/>
<source>Here you can switch to night mode.</source> <source>Here you can switch to night mode.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="309"/> <location filename="qml/window/MainWindow.qml" line="313"/>
<source>Hide Easter eggs</source> <source>Hide Easter eggs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="309"/> <location filename="qml/window/MainWindow.qml" line="313"/>
<source>Try a few more clicks!!</source> <source>Try a few more clicks!!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="333"/> <location filename="qml/window/MainWindow.qml" line="337"/>
<source>Upgrade Tips</source> <source>Upgrade Tips</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="334"/> <location filename="qml/window/MainWindow.qml" line="338"/>
<source>FluentUI is currently up to date </source> <source>FluentUI is currently up to date </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="334"/> <location filename="qml/window/MainWindow.qml" line="338"/>
<source> -- The current app version</source> <source> -- The current app version</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="334"/> <location filename="qml/window/MainWindow.qml" line="338"/>
<source> <source>
Now go and download the new version Now go and download the new version
@ -657,17 +708,17 @@ Updated content:
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="337"/> <location filename="qml/window/MainWindow.qml" line="341"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="364"/> <location filename="qml/window/MainWindow.qml" line="368"/>
<source>The current version is already the latest</source> <source>The current version is already the latest</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="371"/> <location filename="qml/window/MainWindow.qml" line="375"/>
<source>The network is abnormal</source> <source>The network is abnormal</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1089,46 +1140,6 @@ Updated content:
<source>Click to Select a Color - &gt;</source> <source>Click to Select a Color - &gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="22"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="23"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="24"/>
<source>Color Picker</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="25"/>
<source>Edit Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="26"/>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="27"/>
<source>Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="28"/>
<source>Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="29"/>
<source>Opacity</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_ComboBox</name> <name>T_ComboBox</name>
@ -1318,47 +1329,53 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="17"/> <location filename="qml/page/T_GroupBox.qml" line="17"/>
<location filename="qml/page/T_GroupBox.qml" line="27"/> <location filename="qml/page/T_GroupBox.qml" line="35"/>
<source>E-mail</source> <source>E-mail</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="18"/> <location filename="qml/page/T_GroupBox.qml" line="18"/>
<location filename="qml/page/T_GroupBox.qml" line="28"/> <location filename="qml/page/T_GroupBox.qml" line="36"/>
<source>Calendar</source> <source>Calendar</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="19"/> <location filename="qml/page/T_GroupBox.qml" line="19"/>
<location filename="qml/page/T_GroupBox.qml" line="29"/> <location filename="qml/page/T_GroupBox.qml" line="37"/>
<source>Contacts</source> <source>Contacts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="24"/> <location filename="qml/page/T_GroupBox.qml" line="24"/>
<source>RadioButton Group</source> <source>RadioButton Group</source>
<oldsource>RadioButton Group111111111111111111111111</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_GroupBox.qml" line="46"/>
<source>Disabled</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context> <context>
<name>T_Home</name> <name>T_Home</name>
<message> <message>
<location filename="qml/page/T_Home.qml" line="23"/> <location filename="qml/page/T_Home.qml" line="19"/>
<source>FluentUI GitHub</source> <source>FluentUI GitHub</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Home.qml" line="24"/> <location filename="qml/page/T_Home.qml" line="20"/>
<source>The latest FluentUI controls and styles for your applications.</source> <source>The latest FluentUI controls and styles for your applications.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Home.qml" line="32"/> <location filename="qml/page/T_Home.qml" line="28"/>
<source>FluentUI Initializr</source> <source>FluentUI Initializr</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Home.qml" line="33"/> <location filename="qml/page/T_Home.qml" line="29"/>
<source>FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.</source> <source>FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1376,12 +1393,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Icons.qml" line="20"/> <location filename="qml/page/T_Icons.qml" line="51"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="60"/>
<source>You Copied </source> <source>You Copied </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1407,51 +1419,82 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="23"/> <location filename="qml/page/T_InfoBar.qml" line="27"/>
<source>Info</source> <source>Info</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="25"/> <location filename="qml/page/T_InfoBar.qml" line="29"/>
<location filename="qml/page/T_InfoBar.qml" line="49"/> <location filename="qml/page/T_InfoBar.qml" line="53"/>
<source>This is an InfoBar in the Info Style</source> <source>This is an InfoBar in the Info Style</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="29"/> <location filename="qml/page/T_InfoBar.qml" line="33"/>
<source>Warning</source> <source>Warning</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="31"/> <location filename="qml/page/T_InfoBar.qml" line="35"/>
<source>This is an InfoBar in the Warning Style</source> <source>This is an InfoBar in the Warning Style</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="37"/> <location filename="qml/page/T_InfoBar.qml" line="41"/>
<source>This is an InfoBar in the Error Style</source> <source>This is an InfoBar in the Error Style</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="43"/> <location filename="qml/page/T_InfoBar.qml" line="47"/>
<source>This is an InfoBar in the Success Style</source> <source>This is an InfoBar in the Success Style</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="47"/> <location filename="qml/page/T_InfoBar.qml" line="51"/>
<source>InfoBar that needs to be turned off manually</source> <source>InfoBar that needs to be turned off manually</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="49"/> <location filename="qml/page/T_InfoBar.qml" line="53"/>
<source>Manual shutdown is supported</source> <source>Manual shutdown is supported</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="59"/>
<source>Manually close the info message box</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="64"/>
<location filename="qml/page/T_InfoBar.qml" line="74"/>
<location filename="qml/page/T_InfoBar.qml" line="84"/>
<source>close &apos;%1&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="64"/>
<location filename="qml/page/T_InfoBar.qml" line="74"/>
<location filename="qml/page/T_InfoBar.qml" line="84"/>
<source>show &apos;%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="70"/>
<location filename="qml/page/T_InfoBar.qml" line="80"/>
<location filename="qml/page/T_InfoBar.qml" line="90"/>
<source>This is an &apos;%1&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="94"/>
<source>clear all info</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_LineChart</name> <name>T_LineChart</name>
<message> <message>
<location filename="qml/chart/T_LineChart.qml" line="10"/> <location filename="qml/chart/T_LineChart.qml" line="11"/>
<source>Line Chart</source> <source>Line Chart</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1749,22 +1792,30 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="38"/> <location filename="qml/page/T_RadioButton.qml" line="38"/>
<location filename="qml/page/T_RadioButton.qml" line="80"/> <location filename="qml/page/T_RadioButton.qml" line="79"/>
<location filename="qml/page/T_RadioButton.qml" line="130"/>
<location filename="qml/page/T_RadioButton.qml" line="181"/>
<source>Disabled</source> <source>Disabled</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="63"/> <location filename="qml/page/T_RadioButton.qml" line="64"/>
<location filename="qml/page/T_RadioButton.qml" line="115"/>
<location filename="qml/page/T_RadioButton.qml" line="166"/>
<source>Radio Button_1</source> <source>Radio Button_1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="67"/> <location filename="qml/page/T_RadioButton.qml" line="67"/>
<location filename="qml/page/T_RadioButton.qml" line="118"/>
<location filename="qml/page/T_RadioButton.qml" line="169"/>
<source>Radio Button_2</source> <source>Radio Button_2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="71"/> <location filename="qml/page/T_RadioButton.qml" line="70"/>
<location filename="qml/page/T_RadioButton.qml" line="121"/>
<location filename="qml/page/T_RadioButton.qml" line="172"/>
<source>Radio Button_3</source> <source>Radio Button_3</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1970,26 +2021,6 @@ Some contents...</source>
<source>StatusLayout</source> <source>StatusLayout</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="63"/>
<source>Loading...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="64"/>
<source>Empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="65"/>
<source>The page went wrong...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="66"/>
<source>Reload</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_TabView</name> <name>T_TabView</name>
@ -2012,101 +2043,111 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="73"/> <location filename="qml/page/T_TableView.qml" line="72"/>
<source>Modify the column name</source> <source>Modify the column name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="74"/> <location filename="qml/page/T_TableView.qml" line="73"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="92"/> <location filename="qml/page/T_TableView.qml" line="91"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="134"/> <location filename="qml/page/T_TableView.qml" line="133"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="177"/> <location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="478"/> <location filename="qml/page/T_TableView.qml" line="508"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="211"/> <location filename="qml/page/T_TableView.qml" line="210"/>
<source>Delete</source> <source>Delete</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="218"/> <location filename="qml/page/T_TableView.qml" line="217"/>
<source>Edit</source> <source>Edit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="237"/> <location filename="qml/page/T_TableView.qml" line="236"/>
<source>Select All</source> <source>Select All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="337"/> <location filename="qml/page/T_TableView.qml" line="364"/>
<source>Age</source> <source>Age</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="412"/> <location filename="qml/page/T_TableView.qml" line="439"/>
<source>Clear All</source> <source>Clear All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="473"/> <location filename="qml/page/T_TableView.qml" line="446"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="491"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="498"/>
<source>Nickname</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="505"/>
<source>Long String</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="513"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="532"/>
<source>&lt;Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="533"/>
<source>Next&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="419"/>
<source>Delete Selection</source> <source>Delete Selection</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="443"/> <location filename="qml/page/T_TableView.qml" line="469"/>
<source>Add a row of Data</source> <source>Add a row of Data</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_TableView.qml" line="475"/>
<source>Insert a Row</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="482"/>
<source>Focus not acquired: Please click any item in the form as the target for insertion!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="513"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="527"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="535"/>
<source>Nickname</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="542"/>
<source>Long String</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="550"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="568"/>
<source>&lt;Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="569"/>
<source>Next&gt;</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_Text</name> <name>T_Text</name>
@ -2258,12 +2299,12 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Timeline.qml" line="115"/> <location filename="qml/page/T_Timeline.qml" line="114"/>
<source>Append</source> <source>Append</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Timeline.qml" line="121"/> <location filename="qml/page/T_Timeline.qml" line="120"/>
<source>clear</source> <source>clear</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2394,25 +2435,25 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="230"/> <location filename="qml/page/T_TreeView.qml" line="183"/>
<source>Title</source> <source>Title</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="238"/> <location filename="qml/page/T_TreeView.qml" line="187"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="191"/>
<source>Avatar</source> <source>Avatar</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="242"/> <location filename="qml/page/T_TreeView.qml" line="195"/>
<source>Address</source> <source>Address</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_TreeView.qml" line="234"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_Typography</name> <name>T_Typography</name>

View File

@ -1,6 +1,54 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1" language="zh_CN"> <TS version="2.1" language="zh_CN">
<context>
<name>App</name>
<message>
<location filename="qml/App.qml" line="61"/>
<source>Quit</source>
<translation type="unfinished">退</translation>
</message>
<message>
<location filename="qml/App.qml" line="68"/>
<source>Test1</source>
<translation type="unfinished">1</translation>
</message>
<message>
<location filename="qml/App.qml" line="75"/>
<source>Test2</source>
<translation type="unfinished">2</translation>
</message>
<message>
<location filename="qml/App.qml" line="82"/>
<source>Test3</source>
<translation type="unfinished">3</translation>
</message>
<message>
<location filename="qml/App.qml" line="89"/>
<source>Test4</source>
<translation type="unfinished">4</translation>
</message>
<message>
<location filename="qml/App.qml" line="96"/>
<source>Test5</source>
<translation type="unfinished">5</translation>
</message>
<message>
<location filename="qml/App.qml" line="103"/>
<source>Test6</source>
<translation type="unfinished">6</translation>
</message>
<message>
<location filename="qml/App.qml" line="110"/>
<source>Test7</source>
<translation type="unfinished">7</translation>
</message>
<message>
<location filename="qml/App.qml" line="117"/>
<source>Test8</source>
<translation type="unfinished">8</translation>
</message>
</context>
<context> <context>
<name>CodeExpander</name> <name>CodeExpander</name>
<message> <message>
@ -71,6 +119,14 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>HotkeyWindow</name>
<message>
<location filename="qml/window/HotkeyWindow.qml" line="11"/>
<source>Hotkey</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>HotloadWindow</name> <name>HotloadWindow</name>
<message> <message>
@ -514,12 +570,11 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
<source>3D</source> <source>3D</source>
<translation type="unfinished">3D</translation> <translation type="obsolete">3D</translation>
</message> </message>
<message> <message>
<location filename="qml/global/ItemsOriginal.qml" line="493"/> <location filename="qml/global/ItemsOriginal.qml" line="487"/>
<source>Test Crash</source> <source>Test Crash</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -551,104 +606,104 @@
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="307"/> <location filename="qml/window/MainWindow.qml" line="311"/>
<source>Dark Mode</source> <source>Dark Mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="83"/> <location filename="qml/window/MainWindow.qml" line="87"/>
<location filename="qml/window/MainWindow.qml" line="91"/> <location filename="qml/window/MainWindow.qml" line="95"/>
<source>Quit</source> <source>Quit</source>
<translation type="unfinished">退</translation> <translation type="unfinished">退</translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="84"/> <location filename="qml/window/MainWindow.qml" line="88"/>
<source>Are you sure you want to exit the program?</source> <source>Are you sure you want to exit the program?</source>
<translation type="unfinished">退</translation> <translation type="unfinished">退</translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="85"/> <location filename="qml/window/MainWindow.qml" line="89"/>
<source>Minimize</source> <source>Minimize</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="88"/> <location filename="qml/window/MainWindow.qml" line="92"/>
<source>Friendly Reminder</source> <source>Friendly Reminder</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="88"/> <location filename="qml/window/MainWindow.qml" line="92"/>
<source>FluentUI is hidden from the tray, click on the tray to activate the window again</source> <source>FluentUI is hidden from the tray, click on the tray to activate the window again</source>
<translation type="unfinished">FluentUI </translation> <translation type="unfinished">FluentUI </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="92"/> <location filename="qml/window/MainWindow.qml" line="96"/>
<location filename="qml/window/MainWindow.qml" line="336"/> <location filename="qml/window/MainWindow.qml" line="340"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="103"/> <location filename="qml/window/MainWindow.qml" line="107"/>
<source>Open in Separate Window</source> <source>Open in Separate Window</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="200"/> <location filename="qml/window/MainWindow.qml" line="204"/>
<source>Click Time</source> <source>Click Time</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="210"/> <location filename="qml/window/MainWindow.qml" line="214"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="301"/> <location filename="qml/window/MainWindow.qml" line="305"/>
<source>Finish</source> <source>Finish</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="302"/> <location filename="qml/window/MainWindow.qml" line="306"/>
<source>Next</source> <source>Next</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="303"/> <location filename="qml/window/MainWindow.qml" line="307"/>
<source>Previous</source> <source>Previous</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="307"/> <location filename="qml/window/MainWindow.qml" line="311"/>
<source>Here you can switch to night mode.</source> <source>Here you can switch to night mode.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="309"/> <location filename="qml/window/MainWindow.qml" line="313"/>
<source>Hide Easter eggs</source> <source>Hide Easter eggs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="309"/> <location filename="qml/window/MainWindow.qml" line="313"/>
<source>Try a few more clicks!!</source> <source>Try a few more clicks!!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="333"/> <location filename="qml/window/MainWindow.qml" line="337"/>
<source>Upgrade Tips</source> <source>Upgrade Tips</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="334"/> <location filename="qml/window/MainWindow.qml" line="338"/>
<source>FluentUI is currently up to date </source> <source>FluentUI is currently up to date </source>
<translation type="unfinished">FluentUI </translation> <translation type="unfinished">FluentUI </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="334"/> <location filename="qml/window/MainWindow.qml" line="338"/>
<source> -- The current app version</source> <source> -- The current app version</source>
<translation type="unfinished"> -- </translation> <translation type="unfinished"> -- </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="334"/> <location filename="qml/window/MainWindow.qml" line="338"/>
<source> <source>
Now go and download the new version Now go and download the new version
@ -661,17 +716,17 @@ Updated content:
</translation> </translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="337"/> <location filename="qml/window/MainWindow.qml" line="341"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="364"/> <location filename="qml/window/MainWindow.qml" line="368"/>
<source>The current version is already the latest</source> <source>The current version is already the latest</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="371"/> <location filename="qml/window/MainWindow.qml" line="375"/>
<source>The network is abnormal</source> <source>The network is abnormal</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1113,44 +1168,36 @@ Updated content:
<translation type="unfinished"> - &gt;</translation> <translation type="unfinished"> - &gt;</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="22"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="23"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="24"/>
<source>Color Picker</source> <source>Color Picker</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="25"/>
<source>Edit Color</source> <source>Edit Color</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="26"/>
<source>Red</source> <source>Red</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="27"/>
<source>Green</source> <source>Green</source>
<translation type="unfinished">绿</translation> <translation type="obsolete">绿</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="28"/>
<source>Blue</source> <source>Blue</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="29"/>
<source>Opacity</source> <source>Opacity</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
</context> </context>
<context> <context>
@ -1368,47 +1415,53 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="17"/> <location filename="qml/page/T_GroupBox.qml" line="17"/>
<location filename="qml/page/T_GroupBox.qml" line="27"/> <location filename="qml/page/T_GroupBox.qml" line="35"/>
<source>E-mail</source> <source>E-mail</source>
<translation type="unfinished">邮箱</translation> <translation type="unfinished">邮箱</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="18"/> <location filename="qml/page/T_GroupBox.qml" line="18"/>
<location filename="qml/page/T_GroupBox.qml" line="28"/> <location filename="qml/page/T_GroupBox.qml" line="36"/>
<source>Calendar</source> <source>Calendar</source>
<translation type="unfinished">日历</translation> <translation type="unfinished">日历</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="19"/> <location filename="qml/page/T_GroupBox.qml" line="19"/>
<location filename="qml/page/T_GroupBox.qml" line="29"/> <location filename="qml/page/T_GroupBox.qml" line="37"/>
<source>Contacts</source> <source>Contacts</source>
<translation type="unfinished">联系人</translation> <translation type="unfinished">联系人</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_GroupBox.qml" line="24"/> <location filename="qml/page/T_GroupBox.qml" line="24"/>
<source>RadioButton Group</source> <source>RadioButton Group</source>
<oldsource>RadioButton Group111111111111111111111111</oldsource>
<translation type="unfinished">单选框分组</translation> <translation type="unfinished">单选框分组</translation>
</message> </message>
<message>
<location filename="qml/page/T_GroupBox.qml" line="46"/>
<source>Disabled</source>
<translation type="unfinished">禁用</translation>
</message>
</context> </context>
<context> <context>
<name>T_Home</name> <name>T_Home</name>
<message> <message>
<location filename="qml/page/T_Home.qml" line="23"/> <location filename="qml/page/T_Home.qml" line="19"/>
<source>FluentUI GitHub</source> <source>FluentUI GitHub</source>
<translation type="unfinished">FluentUI GitHub</translation> <translation type="unfinished">FluentUI GitHub</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Home.qml" line="24"/> <location filename="qml/page/T_Home.qml" line="20"/>
<source>The latest FluentUI controls and styles for your applications.</source> <source>The latest FluentUI controls and styles for your applications.</source>
<translation type="unfinished">最新的 FluentUI 控件和样式</translation> <translation type="unfinished">最新的 FluentUI 控件和样式</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Home.qml" line="32"/> <location filename="qml/page/T_Home.qml" line="28"/>
<source>FluentUI Initializr</source> <source>FluentUI Initializr</source>
<translation type="unfinished">FluentUI脚手架</translation> <translation type="unfinished">FluentUI脚手架</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Home.qml" line="33"/> <location filename="qml/page/T_Home.qml" line="29"/>
<source>FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.</source> <source>FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.</source>
<translation type="unfinished">FluentUI 脚手架是一个快速创建项目工具,可帮助您创建和自定义具有各种选项的 Fluent UI 项目</translation> <translation type="unfinished">FluentUI 脚手架是一个快速创建项目工具,可帮助您创建和自定义具有各种选项的 Fluent UI 项目</translation>
</message> </message>
@ -1426,12 +1479,11 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<translation type="unfinished">请输入关键字</translation> <translation type="unfinished">请输入关键字</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Icons.qml" line="20"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished">搜索</translation> <translation type="obsolete">搜索</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Icons.qml" line="60"/> <location filename="qml/page/T_Icons.qml" line="51"/>
<source>You Copied </source> <source>You Copied </source>
<translation type="unfinished">您复制</translation> <translation type="unfinished">您复制</translation>
</message> </message>
@ -1461,46 +1513,77 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<translation type="unfinished">信息栏</translation> <translation type="unfinished">信息栏</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="23"/> <location filename="qml/page/T_InfoBar.qml" line="27"/>
<source>Info</source> <source>Info</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="25"/> <location filename="qml/page/T_InfoBar.qml" line="29"/>
<location filename="qml/page/T_InfoBar.qml" line="49"/> <location filename="qml/page/T_InfoBar.qml" line="53"/>
<source>This is an InfoBar in the Info Style</source> <source>This is an InfoBar in the Info Style</source>
<translation type="unfinished">这是一个Info样式的信息栏</translation> <translation type="unfinished">这是一个Info样式的信息栏</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="29"/> <location filename="qml/page/T_InfoBar.qml" line="33"/>
<source>Warning</source> <source>Warning</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="31"/> <location filename="qml/page/T_InfoBar.qml" line="35"/>
<source>This is an InfoBar in the Warning Style</source> <source>This is an InfoBar in the Warning Style</source>
<translation type="unfinished">这是一个Warning样式的信息栏</translation> <translation type="unfinished">这是一个Warning样式的信息栏</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="37"/> <location filename="qml/page/T_InfoBar.qml" line="41"/>
<source>This is an InfoBar in the Error Style</source> <source>This is an InfoBar in the Error Style</source>
<translation type="unfinished">这是一个Error样式的信息栏</translation> <translation type="unfinished">这是一个Error样式的信息栏</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="43"/> <location filename="qml/page/T_InfoBar.qml" line="47"/>
<source>This is an InfoBar in the Success Style</source> <source>This is an InfoBar in the Success Style</source>
<translation type="unfinished">这是一个Success样式的信息栏</translation> <translation type="unfinished">这是一个Success样式的信息栏</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="47"/> <location filename="qml/page/T_InfoBar.qml" line="51"/>
<source>InfoBar that needs to be turned off manually</source> <source>InfoBar that needs to be turned off manually</source>
<translation type="unfinished">需要手动关闭的信息栏</translation> <translation type="unfinished">需要手动关闭的信息栏</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="49"/> <location filename="qml/page/T_InfoBar.qml" line="53"/>
<source>Manual shutdown is supported</source> <source>Manual shutdown is supported</source>
<translation type="unfinished">支持手动关闭</translation> <translation type="unfinished">支持手动关闭</translation>
</message> </message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="59"/>
<source>Manually close the info message box</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="64"/>
<location filename="qml/page/T_InfoBar.qml" line="74"/>
<location filename="qml/page/T_InfoBar.qml" line="84"/>
<source>close &apos;%1&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="64"/>
<location filename="qml/page/T_InfoBar.qml" line="74"/>
<location filename="qml/page/T_InfoBar.qml" line="84"/>
<source>show &apos;%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="70"/>
<location filename="qml/page/T_InfoBar.qml" line="80"/>
<location filename="qml/page/T_InfoBar.qml" line="90"/>
<source>This is an &apos;%1&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="94"/>
<source>clear all info</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Loading...</source> <source>Loading...</source>
<translation type="obsolete">加载中...</translation> <translation type="obsolete">加载中...</translation>
@ -1509,7 +1592,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<context> <context>
<name>T_LineChart</name> <name>T_LineChart</name>
<message> <message>
<location filename="qml/chart/T_LineChart.qml" line="10"/> <location filename="qml/chart/T_LineChart.qml" line="11"/>
<source>Line Chart</source> <source>Line Chart</source>
<translation type="unfinished">线型图</translation> <translation type="unfinished">线型图</translation>
</message> </message>
@ -1817,22 +1900,30 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="38"/> <location filename="qml/page/T_RadioButton.qml" line="38"/>
<location filename="qml/page/T_RadioButton.qml" line="80"/> <location filename="qml/page/T_RadioButton.qml" line="79"/>
<location filename="qml/page/T_RadioButton.qml" line="130"/>
<location filename="qml/page/T_RadioButton.qml" line="181"/>
<source>Disabled</source> <source>Disabled</source>
<translation type="unfinished">禁用</translation> <translation type="unfinished">禁用</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="63"/> <location filename="qml/page/T_RadioButton.qml" line="64"/>
<location filename="qml/page/T_RadioButton.qml" line="115"/>
<location filename="qml/page/T_RadioButton.qml" line="166"/>
<source>Radio Button_1</source> <source>Radio Button_1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="67"/> <location filename="qml/page/T_RadioButton.qml" line="67"/>
<location filename="qml/page/T_RadioButton.qml" line="118"/>
<location filename="qml/page/T_RadioButton.qml" line="169"/>
<source>Radio Button_2</source> <source>Radio Button_2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_RadioButton.qml" line="71"/> <location filename="qml/page/T_RadioButton.qml" line="70"/>
<location filename="qml/page/T_RadioButton.qml" line="121"/>
<location filename="qml/page/T_RadioButton.qml" line="172"/>
<source>Radio Button_3</source> <source>Radio Button_3</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2008,6 +2099,10 @@ Some contents...</source>
<source>ShortcutPicker</source> <source>ShortcutPicker</source>
<translation type="unfinished">快捷键选择器</translation> <translation type="unfinished">快捷键选择器</translation>
</message> </message>
<message>
<source>Quit</source>
<translation type="obsolete">退出</translation>
</message>
<message> <message>
<source>Activate the Shortcut</source> <source>Activate the Shortcut</source>
<translation type="obsolete">激活快捷键</translation> <translation type="obsolete">激活快捷键</translation>
@ -2061,24 +2156,20 @@ Some contents...</source>
<translation type="unfinished">状态布局</translation> <translation type="unfinished">状态布局</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_StatusLayout.qml" line="63"/>
<source>Loading...</source> <source>Loading...</source>
<translation type="unfinished">正在加载...</translation> <translation type="obsolete">正在加载...</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_StatusLayout.qml" line="64"/>
<source>Empty</source> <source>Empty</source>
<translation type="unfinished">空空如也</translation> <translation type="obsolete">空空如也</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_StatusLayout.qml" line="65"/>
<source>The page went wrong...</source> <source>The page went wrong...</source>
<translation type="unfinished">页面出错了...</translation> <translation type="obsolete">页面出错了...</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_StatusLayout.qml" line="66"/>
<source>Reload</source> <source>Reload</source>
<translation type="unfinished">重新加载</translation> <translation type="obsolete">重新加载</translation>
</message> </message>
</context> </context>
<context> <context>
@ -2102,98 +2193,108 @@ Some contents...</source>
<translation type="unfinished">表格</translation> <translation type="unfinished">表格</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="73"/> <location filename="qml/page/T_TableView.qml" line="72"/>
<source>Modify the column name</source> <source>Modify the column name</source>
<translation type="unfinished">修改列名</translation> <translation type="unfinished">修改列名</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="74"/> <location filename="qml/page/T_TableView.qml" line="73"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished">取消</translation> <translation type="unfinished">取消</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="92"/> <location filename="qml/page/T_TableView.qml" line="91"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished">确定</translation> <translation type="unfinished">确定</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="134"/> <location filename="qml/page/T_TableView.qml" line="133"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished">搜索</translation> <translation type="unfinished">搜索</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="177"/> <location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="478"/> <location filename="qml/page/T_TableView.qml" line="508"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished">名称</translation> <translation type="unfinished">名称</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="211"/> <location filename="qml/page/T_TableView.qml" line="210"/>
<source>Delete</source> <source>Delete</source>
<translation type="unfinished">删除</translation> <translation type="unfinished">删除</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="218"/> <location filename="qml/page/T_TableView.qml" line="217"/>
<source>Edit</source> <source>Edit</source>
<translation type="unfinished">编辑</translation> <translation type="unfinished">编辑</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="237"/> <location filename="qml/page/T_TableView.qml" line="236"/>
<source>Select All</source> <source>Select All</source>
<translation type="unfinished">全选</translation> <translation type="unfinished">全选</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="337"/> <location filename="qml/page/T_TableView.qml" line="364"/>
<source>Age</source> <source>Age</source>
<translation type="unfinished">年龄</translation> <translation type="unfinished">年龄</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="412"/> <location filename="qml/page/T_TableView.qml" line="439"/>
<source>Clear All</source> <source>Clear All</source>
<translation type="unfinished">清除所有</translation> <translation type="unfinished">清除所有</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="473"/> <location filename="qml/page/T_TableView.qml" line="475"/>
<source>Insert a Row</source>
<translation type="unfinished">插入一行</translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="482"/>
<source>Focus not acquired: Please click any item in the form as the target for insertion!</source>
<translation type="unfinished">焦点未获取:请点击表格中的任意一项,作为插入的靶点!</translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="513"/>
<source>Avatar</source> <source>Avatar</source>
<translation type="unfinished">头像</translation> <translation type="unfinished">头像</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="491"/> <location filename="qml/page/T_TableView.qml" line="527"/>
<source>Address</source> <source>Address</source>
<translation type="unfinished">地址</translation> <translation type="unfinished">地址</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="498"/> <location filename="qml/page/T_TableView.qml" line="535"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished">昵称</translation> <translation type="unfinished">昵称</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="505"/> <location filename="qml/page/T_TableView.qml" line="542"/>
<source>Long String</source> <source>Long String</source>
<translation type="unfinished">长字符串</translation> <translation type="unfinished">长字符串</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="513"/> <location filename="qml/page/T_TableView.qml" line="550"/>
<source>Options</source> <source>Options</source>
<translation type="unfinished">操作</translation> <translation type="unfinished">操作</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="532"/> <location filename="qml/page/T_TableView.qml" line="568"/>
<source>&lt;Previous</source> <source>&lt;Previous</source>
<translation type="unfinished">&lt;上一页</translation> <translation type="unfinished">&lt;上一页</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="533"/> <location filename="qml/page/T_TableView.qml" line="569"/>
<source>Next&gt;</source> <source>Next&gt;</source>
<translation type="unfinished">下一页&gt;</translation> <translation type="unfinished">下一页&gt;</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="419"/> <location filename="qml/page/T_TableView.qml" line="446"/>
<source>Delete Selection</source> <source>Delete Selection</source>
<translation type="unfinished">删除选中</translation> <translation type="unfinished">删除选中</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="443"/> <location filename="qml/page/T_TableView.qml" line="469"/>
<source>Add a row of Data</source> <source>Add a row of Data</source>
<translation type="unfinished">添加一行数据</translation> <translation type="unfinished">添加一行数据</translation>
</message> </message>
@ -2348,12 +2449,12 @@ Some contents...</source>
<translation type="unfinished">时间轴</translation> <translation type="unfinished">时间轴</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Timeline.qml" line="115"/> <location filename="qml/page/T_Timeline.qml" line="114"/>
<source>Append</source> <source>Append</source>
<translation type="unfinished">追加</translation> <translation type="unfinished">追加</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Timeline.qml" line="121"/> <location filename="qml/page/T_Timeline.qml" line="120"/>
<source>clear</source> <source>clear</source>
<translation type="unfinished">清空</translation> <translation type="unfinished">清空</translation>
</message> </message>
@ -2504,22 +2605,22 @@ Some contents...</source>
<translation type="obsolete">共计选中%1条数据</translation> <translation type="obsolete">共计选中%1条数据</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="230"/> <location filename="qml/page/T_TreeView.qml" line="183"/>
<source>Title</source> <source>Title</source>
<translation type="unfinished">标题</translation> <translation type="unfinished">标题</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="242"/> <location filename="qml/page/T_TreeView.qml" line="195"/>
<source>Address</source> <source>Address</source>
<translation type="unfinished">地址</translation> <translation type="unfinished">地址</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="238"/> <location filename="qml/page/T_TreeView.qml" line="191"/>
<source>Avatar</source> <source>Avatar</source>
<translation type="unfinished">头像</translation> <translation type="unfinished">头像</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="234"/> <location filename="qml/page/T_TreeView.qml" line="187"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished">名称</translation> <translation type="unfinished">名称</translation>
</message> </message>

View File

@ -43,7 +43,8 @@ FluLauncher {
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml", "/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml", "/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml", "/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml",
"/pageWindow":"qrc:/example/qml/window/PageWindow.qml" "/pageWindow":"qrc:/example/qml/window/PageWindow.qml",
"/hotkey":"qrc:/example/qml/window/HotkeyWindow.qml"
} }
var args = Qt.application.arguments var args = Qt.application.arguments
if(args.length>=2 && args[1].startsWith("-crashed=")){ if(args.length>=2 && args[1].startsWith("-crashed=")){
@ -52,4 +53,73 @@ FluLauncher {
FluRouter.navigate("/") FluRouter.navigate("/")
} }
} }
property alias hotkeys: object_hotkey
FluObject{
id: object_hotkey
FluHotkey{
name: qsTr("Quit")
sequence: "Ctrl+Alt+Q"
onActivated: {
FluRouter.exit()
}
}
FluHotkey{
name: qsTr("Test1")
sequence: "Alt+A"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
FluHotkey{
name: qsTr("Test2")
sequence: "Alt+B"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
FluHotkey{
name: qsTr("Test3")
sequence: "Alt+C"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
FluHotkey{
name: qsTr("Test4")
sequence: "Alt+D"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
FluHotkey{
name: qsTr("Test5")
sequence: "Alt+E"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
FluHotkey{
name: qsTr("Test6")
sequence: "Alt+F"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
FluHotkey{
name: qsTr("Test7")
sequence: "Alt+G"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
FluHotkey{
name: qsTr("Test8")
sequence: "Alt+H"
onActivated: {
FluRouter.navigate("/hotkey",{sequence:sequence})
}
}
}
} }

View File

@ -7,7 +7,9 @@ import "../component"
FluScrollablePage{ FluScrollablePage{
id: root
title: qsTr("Line Chart") title: qsTr("Line Chart")
property var data : []
FluFrame{ FluFrame{
Layout.preferredWidth: 500 Layout.preferredWidth: 500
@ -15,13 +17,14 @@ FluScrollablePage{
padding: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
id: chart
anchors.fill: parent anchors.fill: parent
chartType: 'line' chartType: 'line'
chartData: { return { chartData: { return {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{ datasets: [{
label: 'My First Dataset', label: 'My First Dataset',
data: [65, 59, 80, 81, 56, 55, 40], data: root.data,
fill: false, fill: false,
borderColor: 'rgb(75, 192, 192)', borderColor: 'rgb(75, 192, 192)',
tension: 0.1 tension: 0.1
@ -41,5 +44,20 @@ FluScrollablePage{
} }
} }
} }
Timer{
id: timer
interval: 300
repeat: true
onTriggered: {
root.data.push(Math.random()*100)
if(root.data.length>7){
root.data.shift()
}
chart.animateToNewData()
}
}
Component.onCompleted: {
timer.restart()
}
} }
} }

View File

@ -483,12 +483,6 @@ FluObject{
FluRouter.navigate("/hotload") FluRouter.navigate("/hotload")
} }
} }
FluPaneItem{
title: qsTr("3D")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_3D.qml"
onTap: { navigationView.push(url) }
}
FluPaneItem{ FluPaneItem{
title: qsTr("Test Crash") title: qsTr("Test Crash")
onTapListener: function(){ onTapListener: function(){

View File

@ -1,116 +0,0 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import Qt3D.Core 2.15
import Qt3D.Render 2.15
import Qt3D.Input 2.12
import Qt3D.Extras 2.15
import QtQuick.Scene3D 2.15
import Qt.labs.platform 1.1
import FluentUI 1.0
import "../component"
FluContentPage{
id:root
title:"3D"
Scene3D{
id:scene_3d
anchors.fill: parent
focus: true
aspects: ["input", "logic"]
cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
Entity {
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 22.5
aspectRatio: scene_3d.width / scene_3d.height
nearPlane: 1
farPlane: 1000.0
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
position: Qt.vector3d( 0.0, 0.0, 15.0 )
}
FirstPersonCameraController {
linearSpeed: 100
lookSpeed: 50
camera: camera
}
components: [
RenderSettings{
activeFrameGraph: ForwardRenderer{
clearColor: Qt.rgba(0,0,0,0);
camera: camera
}
},
InputSettings{}
]
Mesh {
id: mesh
source: "https://zhu-zichu.gitee.io/test.obj"
}
PhongMaterial {
id: material
ambient: color_picker.current
}
Transform{
id:transform
scale: 1.0
translation: Qt.vector3d(0, 0, 0)
rotation: fromEulerAngles(0, 0, 0)
property real hAngle:0.0
NumberAnimation on hAngle{
from:0
to:360.0
duration: 5000
loops: Animation.Infinite
}
matrix:{
var m=Qt.matrix4x4();
m.rotate(hAngle,Qt.vector3d(0,1,0));
m.translate(Qt.vector3d(0,0,0));
return m;
}
}
Entity {
id: entity
components: [mesh, material,transform]
}
}
}
ColumnLayout{
RowLayout{
spacing: 10
Layout.topMargin: 20
FluText{
text:"tintColor:"
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
id:color_picker
current: "gray"
}
}
FluButton{
text:"选择obj资源"
onClicked: {
file_dialog.open()
}
}
}
FileDialog {
id: file_dialog
nameFilters: ["Obj files (*.obj)"]
folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
onAccepted: {
var fileUrl = file_dialog.currentFile
mesh.source = fileUrl
}
}
}

View File

@ -18,16 +18,7 @@ FluScrollablePage{
text: qsTr("Click to Select a Color - >") text: qsTr("Click to Select a Color - >")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
FluColorPicker{ FluColorPicker{}
cancelText: qsTr("Cancel")
okText: qsTr("OK")
titleText: qsTr("Color Picker")
editText: qsTr("Edit Color")
redText: qsTr("Red")
greenText: qsTr("Green")
blueText: qsTr("Blue")
opacityText: qsTr("Opacity")
}
} }
} }
CodeExpander{ CodeExpander{

View File

@ -22,18 +22,37 @@ FluScrollablePage{
FluGroupBox { FluGroupBox {
title: qsTr("RadioButton Group") title: qsTr("RadioButton Group")
Layout.fillWidth: true
Layout.preferredHeight: 150
Layout.topMargin: 20
FluRadioButtons { FluRadioButtons {
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
spacing: 10 spacing: 10
disabled: radio_button_switch.checked
FluRadioButton { text: qsTr("E-mail") } FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") } FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") } FluRadioButton { text: qsTr("Contacts") }
} }
FluToggleSwitch{
id: radio_button_switch
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
} }
text: qsTr("Disabled")
}
}
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 4 Layout.topMargin: 4
code:'FluGroupBox { code:`
FluGroupBox {
title: qsTr("CheckBox Group") title: qsTr("CheckBox Group")
ColumnLayout { ColumnLayout {
spacing: 10 spacing: 10
@ -42,7 +61,20 @@ FluScrollablePage{
FluCheckBox { text: qsTr("Calendar") } FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") } FluCheckBox { text: qsTr("Contacts") }
} }
}' }
FluGroupBox {
title: qsTr("RadioButton Group")
FluRadioButtons {
spacing: 10
disabled: true // 禁用所有FluRadioButton子组件
manuallyDisabled: true // 是否指定每个FluRadioButton上的disabled选项
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
}
`
} }
} }

View File

@ -12,10 +12,6 @@ FluScrollablePage{
animationEnabled: false animationEnabled: false
header: Item{} header: Item{}
FluentInitializrWindow{
id:fluent_Initializr
}
ListModel{ ListModel{
id: model_header id: model_header
ListElement{ ListElement{

View File

@ -14,17 +14,8 @@ FluContentPage {
anchors{ anchors{
top: parent.top top: parent.top
} }
} onTextChanged: {
grid_view.model = FluApp.iconData(text_box.text)
FluFilledButton{
text: qsTr("Search")
anchors{
left: text_box.right
verticalCenter: text_box.verticalCenter
leftMargin: 14
}
onClicked: {
grid_view.model = FluTheme.awesomeList(text_box.text)
} }
} }
GridView{ GridView{
@ -33,7 +24,7 @@ FluContentPage {
cellHeight: 110 cellHeight: 110
clip: true clip: true
boundsBehavior: GridView.StopAtBounds boundsBehavior: GridView.StopAtBounds
model:FluTheme.awesomeList() model: FluApp.iconData()
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
anchors{ anchors{
topMargin: 10 topMargin: 10

View File

@ -9,9 +9,13 @@ FluScrollablePage{
title: qsTr("InfoBar") title: qsTr("InfoBar")
property var info1
property var info2
property var info3
FluFrame{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 270 Layout.preferredHeight: 350
padding: 10 padding: 10
ColumnLayout{ ColumnLayout{
spacing: 14 spacing: 14
@ -49,6 +53,51 @@ FluScrollablePage{
showInfo(qsTr("This is an InfoBar in the Info Style"),0,qsTr("Manual shutdown is supported")) showInfo(qsTr("This is an InfoBar in the Info Style"),0,qsTr("Manual shutdown is supported"))
} }
} }
FluText{
wrapMode: Text.WrapAnywhere
width: parent.width
text: qsTr("Manually close the info message box")
}
Row{
spacing: 5
FluButton{
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info1")
onClicked: {
if(info1) {
info1.close()
return
}
info1 = showInfo(qsTr("This is an '%1'").arg("info1"), 0)
}
}
FluButton{
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info2")
onClicked: {
if(info2) {
info2.close()
return
}
info2 = showInfo(qsTr("This is an '%1'").arg("info2"), 0)
}
}
FluButton{
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info3")
onClicked: {
if(info3) {
info3.close()
return
}
info3 = showInfo(qsTr("This is an '%1'").arg("info3"), 0)
}
}
FluButton{
text: qsTr("clear all info")
onClicked: {
clearAllInfo()
}
}
}
FluButton{ FluButton{
text:"Loading" text:"Loading"
onClicked: { onClicked: {
@ -60,12 +109,17 @@ FluScrollablePage{
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -6 Layout.topMargin: -6
code:'showInfo(qsTr("This is an InfoBar in the Info Style")) code:`
showInfo(qsTr("This is an InfoBar in the Info Style"))
showWarning(qsTr("This is an InfoBar in the Warning Style")) showWarning(qsTr("This is an InfoBar in the Warning Style"))
showError(qsTr("This is an InfoBar in the Error Style")) showError(qsTr("This is an InfoBar in the Error Style"))
showSuccess(qsTr("This is an InfoBar in the Success Style"))' showSuccess(qsTr("This is an InfoBar in the Success Style"))
var info1 = showInfo(qsTr("This is an 'Info1'"), 0)
info1.close()
`
} }
} }

View File

@ -53,21 +53,20 @@ FluScrollablePage{
Layout.topMargin: 20 Layout.topMargin: 20
FluRadioButtons{ FluRadioButtons{
spacing: 8 spacing: 8
disabled: radio_button_switch2.checked
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: parent.left
} }
currentIndex: 1
FluRadioButton{ FluRadioButton{
disabled: radio_button_switch2.checked
text: qsTr("Radio Button_1") text: qsTr("Radio Button_1")
} }
FluRadioButton{ FluRadioButton{
disabled: radio_button_switch2.checked
text: qsTr("Radio Button_2") text: qsTr("Radio Button_2")
} }
FluRadioButton{ FluRadioButton{
disabled: radio_button_switch2.checked
text: qsTr("Radio Button_3") text: qsTr("Radio Button_3")
} }
} }
@ -97,4 +96,106 @@ FluScrollablePage{
}' }'
} }
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 60
padding: 10
Layout.topMargin: 20
FluRadioButtons{
spacing: 8
anchors.verticalCenter: parent.verticalCenter
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
disabled: radio_button_switch3.checked
orientation: Qt.Horizontal
currentIndex: 1
FluRadioButton{
text: qsTr("Radio Button_1")
}
FluRadioButton{
text: qsTr("Radio Button_2")
}
FluRadioButton{
text: qsTr("Radio Button_3")
}
}
FluToggleSwitch{
id: radio_button_switch3
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluRadioButtons{
spacing: 8
orientation: Qt.Horizontal
FluRadioButton{
text:"Radio Button_1"
}
FluRadioButton{
text:"Radio Button_2"
}
FluRadioButton{
text:"Radio Button_3"
}
}'
}
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
FluRadioButtons{
spacing: 8
anchors.verticalCenter: parent.verticalCenter
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
disabled: radio_button_switch4.checked
currentIndex: -1
FluCheckBox{
text: qsTr("Radio Button_1")
}
FluCheckBox{
text: qsTr("Radio Button_2")
}
FluCheckBox{
text: qsTr("Radio Button_3")
}
}
FluToggleSwitch{
id: radio_button_switch4
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluRadioButtons{
spacing: 8
FluCheckBox{
text:"Radio Button_1"
}
FluCheckBox{
text:"Radio Button_2"
}
FluCheckBox{
text:"Radio Button_3"
}
}'
}
} }

View File

@ -11,12 +11,26 @@ FluScrollablePage{
FluFrame{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 100 Layout.preferredHeight: childrenRect.height
padding: 10 ColumnLayout{
FluShortcutPicker{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Item{
Layout.preferredHeight: 15
}
Repeater{
model: FluApp.launcher.hotkeys.children
delegate: FluShortcutPicker{
text: model.name
syncHotkey: FluApp.launcher.hotkeys.children[index]
Layout.leftMargin: 15
} }
} }
Item{
Layout.preferredHeight: 15
}
}
}
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -6 Layout.topMargin: -6
@ -26,5 +40,3 @@ FluScrollablePage{
} }
} }

View File

@ -60,12 +60,8 @@ FluScrollablePage{
FluStatusLayout{ FluStatusLayout{
id:status_view id:status_view
anchors.fill: parent anchors.fill: parent
loadingText: qsTr("Loading...")
emptyText: qsTr("Empty")
errorText: qsTr("The page went wrong...")
errorButtonText: qsTr("Reload")
onErrorClicked:{ onErrorClicked:{
showError("Click Reload") status_view.statusMode = FluStatusLayoutType.Loading
} }
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent

View File

@ -11,9 +11,8 @@ FluContentPage{
title: qsTr("TableView") title: qsTr("TableView")
signal checkBoxChanged signal checkBoxChanged
property var dataSource : []
property int sortType: 0 property int sortType: 0
property bool seletedAll: true property bool selectedAll: true
property string nameKeyword: "" property string nameKeyword: ""
onNameKeywordChanged: { onNameKeywordChanged: {
@ -32,11 +31,11 @@ FluContentPage{
onCheckBoxChanged: { onCheckBoxChanged: {
for(var i =0;i< table_view.rows ;i++){ for(var i =0;i< table_view.rows ;i++){
if(false === table_view.getRow(i).checkbox.options.checked){ if(false === table_view.getRow(i).checkbox.options.checked){
root.seletedAll = false root.selectedAll = false
return return
} }
} }
root.seletedAll = true root.selectedAll = true
} }
onSortTypeChanged: { onSortTypeChanged: {
@ -238,13 +237,15 @@ FluContentPage{
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
FluCheckBox{ FluCheckBox{
checked: true === root.seletedAll checked: true === root.selectedAll
animationEnabled: false animationEnabled: false
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
clickListener: function(){ clickListener: function(){
root.seletedAll = !root.seletedAll root.selectedAll = !root.selectedAll
var checked = root.seletedAll var checked = root.selectedAll
itemModel.display = table_view.customItem(com_column_checbox,{"checked":checked}) var columnModel = model.display
columnModel.title = table_view.customItem(com_column_checbox,{"checked":checked})
model.display = columnModel
for(var i =0;i< table_view.rows ;i++){ for(var i =0;i< table_view.rows ;i++){
var rowData = table_view.getRow(i) var rowData = table_view.getRow(i)
rowData.checkbox = table_view.customItem(com_checbox,{"checked":checked}) rowData.checkbox = table_view.customItem(com_checbox,{"checked":checked})
@ -271,7 +272,8 @@ FluContentPage{
} }
Component.onCompleted: { Component.onCompleted: {
currentIndex=["100","300","500","1000"].findIndex((element) => element === display) currentIndex=["100","300","500","1000"].findIndex((element) => element === display)
selectAll() textBox.forceActiveFocus()
textBox.selectAll()
} }
onCommit: { onCommit: {
editTextChaged(editText) editTextChaged(editText)
@ -280,6 +282,29 @@ FluContentPage{
} }
} }
Component{
id:com_auto_suggestbox
FluAutoSuggestBox {
id: textbox
anchors.fill: parent
focus: true
Component.onCompleted: {
var data = ["傲来国界花果山水帘洞","傲来国界坎源山脏水洞","大唐国界黑风山黑风洞","大唐国界黄风岭黄风洞","大唐国界骷髅山白骨洞","宝象国界碗子山波月洞","宝象国界平顶山莲花洞","宝象国界压龙山压龙洞","乌鸡国界号山枯松涧火云洞","乌鸡国界衡阳峪黑水河河神府"]
var result = data.map(function(item) {
return {title: item};
});
items = result
textbox.text= String(display)
forceActiveFocus()
selectAll()
}
onCommit: {
editTextChaged(textbox.text)
tableView.closeEditor()
}
}
}
Component{ Component{
id:com_avatar id:com_avatar
Item{ Item{
@ -323,7 +348,9 @@ FluContentPage{
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
custom_update_dialog.showDialog(options.title,function(text){ custom_update_dialog.showDialog(options.title,function(text){
itemModel.display = table_view.customItem(com_column_update_title,{"title":text}) var columnModel = model.display
columnModel.title = table_view.customItem(com_column_update_title,{"title":text})
model.display = columnModel
}) })
} }
} }
@ -421,15 +448,15 @@ FluContentPage{
var data = [] var data = []
var rows = [] var rows = []
for (var i = 0; i < table_view.rows; i++) { for (var i = 0; i < table_view.rows; i++) {
var item = table_view.getRow(i); var item = table_view.getRow(i)
rows.push(item) rows.push(item)
if (!item.checkbox.options.checked) { if (!item.checkbox.options.checked) {
data.push(item); data.push(item);
} }
} }
var sourceModel = table_view.sourceModel; var sourceModel = table_view.sourceModel
for (i = 0; i < sourceModel.rowCount; i++) { for (i = 0; i < sourceModel.rowCount; i++) {
var sourceItem = sourceModel.getRow(i); var sourceItem = sourceModel.getRow(i)
const foundItem = rows.find(item=> item._key === sourceItem._key) const foundItem = rows.find(item=> item._key === sourceItem._key)
if (!foundItem) { if (!foundItem) {
data.push(sourceItem); data.push(sourceItem);
@ -438,14 +465,24 @@ FluContentPage{
table_view.dataSource = data table_view.dataSource = data
} }
} }
FluButton{ FluButton{
text: qsTr("Add a row of Data") text: qsTr("Add a row of Data")
onClicked: { onClicked: {
table_view.appendRow(genTestObject()) table_view.appendRow(genTestObject())
} }
} }
FluButton{
text: qsTr("Insert a Row")
onClicked: {
var index = table_view.currentIndex()
if(index !== -1){
var testObj = genTestObject()
table_view.insertRow(index,testObj)
}else{
showWarning(qsTr("Focus not acquired: Please click any item in the form as the target for insertion!"))
}
}
}
} }
} }
@ -465,20 +502,19 @@ FluContentPage{
{ {
title: table_view.customItem(com_column_checbox,{checked:true}), title: table_view.customItem(com_column_checbox,{checked:true}),
dataIndex: 'checkbox', dataIndex: 'checkbox',
width:100, frozen: true
minimumWidth:100,
maximumWidth:100
},
{
title: table_view.customItem(com_column_update_title,{title:qsTr("Avatar")}),
dataIndex: 'avatar',
width:100
}, },
{ {
title: table_view.customItem(com_column_filter_name,{title:qsTr("Name")}), title: table_view.customItem(com_column_filter_name,{title:qsTr("Name")}),
dataIndex: 'name', dataIndex: 'name',
readOnly:true readOnly:true
}, },
{
title: table_view.customItem(com_column_update_title,{title:qsTr("Avatar")}),
dataIndex: 'avatar',
width:100,
frozen:true
},
{ {
title: table_view.customItem(com_column_sort_age,{sort:0}), title: table_view.customItem(com_column_sort_age,{sort:0}),
dataIndex: 'age', dataIndex: 'age',
@ -490,6 +526,7 @@ FluContentPage{
{ {
title: qsTr("Address"), title: qsTr("Address"),
dataIndex: 'address', dataIndex: 'address',
editDelegate: com_auto_suggestbox,
width:200, width:200,
minimumWidth:100, minimumWidth:100,
maximumWidth:250 maximumWidth:250
@ -513,8 +550,7 @@ FluContentPage{
title: qsTr("Options"), title: qsTr("Options"),
dataIndex: 'action', dataIndex: 'action',
width:160, width:160,
minimumWidth:160, frozen:true
maximumWidth:160
} }
] ]
} }
@ -566,7 +602,7 @@ FluContentPage{
return avatars[randomIndex]; return avatars[randomIndex];
} }
return { return {
checkbox: table_view.customItem(com_checbox,{checked:root.seletedAll}), checkbox: table_view.customItem(com_checbox,{checked:root.selectedAll}),
avatar:table_view.customItem(com_avatar,{avatar:getAvatar()}), avatar:table_view.customItem(com_avatar,{avatar:getAvatar()}),
name: getRandomName(), name: getRandomName(),
age:getRandomAge(), age:getRandomAge(),
@ -579,12 +615,11 @@ FluContentPage{
} }
} }
function loadData(page,count){ function loadData(page,count){
root.seletedAll = true root.selectedAll = true
const dataSource = [] const dataSource = []
for(var i=0;i<count;i++){ for(var i=0;i<count;i++){
dataSource.push(genTestObject()) dataSource.push(genTestObject())
} }
root.dataSource = dataSource table_view.dataSource = dataSource
table_view.dataSource = root.dataSource
} }
} }

View File

@ -13,7 +13,7 @@ FluScrollablePage{
FluFrame{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 400 Layout.preferredHeight: 408
padding: 10 padding: 10
ColumnLayout{ ColumnLayout{

View File

@ -44,7 +44,6 @@ FluScrollablePage{
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
font.bold: true
linkColor: FluTheme.dark ? FluColors.Teal.lighter : FluColors.Teal.dark linkColor: FluTheme.dark ? FluColors.Teal.lighter : FluColors.Teal.dark
onLinkActivated: onLinkActivated:
(link)=> { (link)=> {

View File

@ -10,7 +10,6 @@ FluContentPage {
title: qsTr("TreeView") title: qsTr("TreeView")
function treeData(){ function treeData(){
const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"] const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
function getRandomName(){ function getRandomName(){
@ -29,7 +28,7 @@ FluContentPage {
} }
const dig = (path = '0', level = 5) => { const dig = (path = '0', level = 5) => {
const list = []; const list = [];
for (let i = 0; i < 5; i += 1) { for (let i = 0; i < 4; i += 1) {
const key = `${path}-${i}`; const key = `${path}-${i}`;
const treeNode = { const treeNode = {
title: key, title: key,
@ -48,67 +47,6 @@ FluContentPage {
return dig(); return dig();
} }
// Row{
// id: layout_column
// spacing: 12
// width: 340
// anchors{
// top:parent.top
// left: parent.left
// leftMargin: 10
// bottom:parent.bottom
// bottomMargin: 20
// }
// RowLayout{
// spacing: 10
// FluText{
// text: "cellHeight:"
// Layout.alignment: Qt.AlignVCenter
// }
// FluSlider{
// id: slider_cell_height
// value: 30
// from: 30
// to:100
// }
// }
// RowLayout{
// spacing: 10
// FluText{
// text: "depthPadding:"
// Layout.alignment: Qt.AlignVCenter
// }
// FluSlider{
// id: slider_depth_padding
// value: 15
// from: 15
// to:100
// }
// }
// FluToggleSwitch{
// id: switch_showline
// text:"showLine"
// checked: false
// }
// FluToggleSwitch{
// id: switch_checkable
// text:"checkable"
// checked: false
// }
// FluButton{
// text: "all expand"
// onClicked: {
// tree_view.allExpand()
// }
// }
// FluButton{
// text: "all collapse"
// onClicked: {
// tree_view.allCollapse()
// }
// }
// }
Component{ Component{
id:com_avatar id:com_avatar
Item{ Item{
@ -206,11 +144,26 @@ FluContentPage {
} }
} }
} }
FluButton{
text: "print selection model"
onClicked: {
var printData = []
var data = tree_view.selectionModel();
console.debug(data.length)
for(var i = 0; i <= data.length-1 ; i++){
const newObj = Object.assign({}, data[i].data);
delete newObj["__parent"];
delete newObj["children"];
printData.push(newObj)
}
console.debug(JSON.stringify(printData))
}
}
} }
} }
FluFrame{ FluTreeView{
id:tree_view
anchors{ anchors{
left: parent.left left: parent.left
top: layout_controls.bottom top: layout_controls.bottom
@ -218,13 +171,13 @@ FluContentPage {
bottom: parent.bottom bottom: parent.bottom
right: parent.right right: parent.right
} }
FluTreeView{
id:tree_view
anchors.fill: parent
cellHeight: slider_cell_height.value cellHeight: slider_cell_height.value
showLine: switch_showline.checked showLine: switch_showline.checked
checkable:switch_checkable.checked checkable:switch_checkable.checked
depthPadding: slider_depth_padding.value depthPadding: slider_depth_padding.value
onCurrentChanged: {
showInfo(current.data.title)
}
columnSource:[ columnSource:[
{ {
title: qsTr("Title"), title: qsTr("Title"),
@ -250,4 +203,3 @@ FluContentPage {
} }
} }
} }
}

View File

@ -20,7 +20,7 @@ FluWindowDialog {
showError(message) showError(message)
} }
function onSuccess(path){ function onSuccess(path){
FluTools.showFileInFolder(path+"/CMakeLists.txt") FluTools.showFileInFolder(path)
window.close() window.close()
} }
} }

View File

@ -0,0 +1,26 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
import "../component"
FluWindow {
id: window
property string sequence: ""
title: qsTr("Hotkey")
width: 250
height: 250
fixSize: true
launchMode: FluWindowType.SingleInstance
onInitArgument:
(argument)=>{
window.sequence = argument.sequence
}
FluText{
anchors.centerIn: parent
color: FluTheme.primaryColor
font: FluTextStyle.Title
text: window.sequence
}
}

View File

@ -14,9 +14,9 @@ FluWindow {
id:window id:window
title: "FluentUI" title: "FluentUI"
width: 1000 width: 1000
height: 680 height: 668
minimumWidth: 520 minimumWidth: 668
minimumHeight: 200 minimumHeight: 320
launchMode: FluWindowType.SingleTask launchMode: FluWindowType.SingleTask
fitsAppBarWindows: true fitsAppBarWindows: true
appBar: FluAppBar { appBar: FluAppBar {
@ -28,6 +28,10 @@ FluWindow {
z:7 z:7
} }
FluentInitializrWindow{
id:fluent_Initializr
}
FluEvent{ FluEvent{
name: "checkUpdate" name: "checkUpdate"
onTriggered: { onTriggered: {

View File

@ -15,7 +15,7 @@ public:
void paint(QPainter *painter) override; void paint(QPainter *painter) override;
Q_INVOKABLE [[maybe_unused]] void start(int w, int h, const QPoint &center, int radius); [[maybe_unused]] Q_INVOKABLE void start(int w, int h, const QPoint &center, int radius);
Q_SIGNAL void imageChanged(); Q_SIGNAL void imageChanged();

View File

@ -2,6 +2,7 @@
#include <QOpenGLFramebufferObjectFormat> #include <QOpenGLFramebufferObjectFormat>
#include <QOpenGLShaderProgram> #include <QOpenGLShaderProgram>
#include <QQuickWindow>
class FBORenderer : public QQuickFramebufferObject::Renderer, protected QOpenGLFunctions { class FBORenderer : public QQuickFramebufferObject::Renderer, protected QOpenGLFunctions {
public: public:
@ -47,6 +48,7 @@ QOpenGLFramebufferObject *FBORenderer::createFramebufferObject(const QSize &size
} }
void FBORenderer::render() { void FBORenderer::render() {
auto pixelRatio = item->window()->devicePixelRatio();
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@ -61,7 +63,7 @@ void FBORenderer::render() {
glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0);
program.setAttributeArray(0, GL_FLOAT, values, 2); program.setAttributeArray(0, GL_FLOAT, values, 2);
program.setUniformValue("t", (float) item->t()); program.setUniformValue("t", (float) item->t());
glViewport(0, 0, qRound(item->width()), qRound(item->height())); glViewport(0, 0, qRound(item->width()*pixelRatio), qRound(item->height()*pixelRatio));
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBlendFunc(GL_SRC_ALPHA, GL_ONE);

View File

@ -97,5 +97,5 @@ void InitializrHelper::copyFile(const QString &source, const QString &dest) {
copyFile(":/example/res/template/src/qml.qrc.in", projectDir.filePath("src/qml.qrc")); copyFile(":/example/res/template/src/qml.qrc.in", projectDir.filePath("src/qml.qrc"));
copyFile(":/example/res/template/src/logo.ico.in", projectDir.filePath("src/logo.ico")); copyFile(":/example/res/template/src/logo.ico.in", projectDir.filePath("src/logo.ico"));
copyFile(":/example/res/template/src/README.md.in", projectDir.filePath("src/README.md")); copyFile(":/example/res/template/src/README.md.in", projectDir.filePath("src/README.md"));
return this->success(projectPath); return this->success(projectPath+"/CMakeLists.txt");
} }

View File

@ -22,7 +22,7 @@ SINGLETON(InitializrHelper)
~InitializrHelper() override; ~InitializrHelper() override;
Q_INVOKABLE [[maybe_unused]] void generate(const QString &name, const QString &path); [[maybe_unused]] Q_INVOKABLE void generate(const QString &name, const QString &path);
Q_SIGNAL void error(const QString &message); Q_SIGNAL void error(const QString &message);

View File

@ -54,7 +54,7 @@ int main(int argc, char *argv[])
QGuiApplication::setOrganizationName("ZhuZiChu"); QGuiApplication::setOrganizationName("ZhuZiChu");
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io"); QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
QGuiApplication::setApplicationName("FluentUI"); QGuiApplication::setApplicationName("FluentUI");
QGuiApplication::setApplicationDisplayName("FluentUI Exmaple"); QGuiApplication::setApplicationDisplayName("FluentUI Example");
QGuiApplication::setApplicationVersion(APPLICATION_VERSION); QGuiApplication::setApplicationVersion(APPLICATION_VERSION);
QGuiApplication::setQuitOnLastWindowClosed(false); QGuiApplication::setQuitOnLastWindowClosed(false);
SettingsHelper::getInstance()->init(argv); SettingsHelper::getInstance()->init(argv);

View File

@ -11,6 +11,13 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.cmake/)
#配置通用编译 #配置通用编译
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (QT_VERSION VERSION_GREATER_EQUAL "6.3")
qt_standard_project_setup()
else ()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif ()
#设置版本号 #设置版本号
add_definitions(-DFLUENTUI_VERSION=1,7,5,0) add_definitions(-DFLUENTUI_VERSION=1,7,5,0)
@ -35,14 +42,6 @@ if (NOT FLUENTUI_QML_PLUGIN_DIRECTORY)
set(FLUENTUI_QML_PLUGIN_DIRECTORY ${QT_SDK_DIR}/qml/FluentUI) set(FLUENTUI_QML_PLUGIN_DIRECTORY ${QT_SDK_DIR}/qml/FluentUI)
endif () endif ()
if (QT_VERSION VERSION_GREATER_EQUAL "6.3")
qt_standard_project_setup()
else ()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif ()
#国际化 #国际化
find_program(QT_LUPDATE NAMES lupdate) find_program(QT_LUPDATE NAMES lupdate)
find_program(QT_LRELEASE NAMES lrelease) find_program(QT_LRELEASE NAMES lrelease)
@ -62,9 +61,28 @@ file(COPY ${QM_FILE_PATHS} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/Qt${QT_VERSI
file(GLOB_RECURSE CPP_FILES *.cpp *.h *.cxx) file(GLOB_RECURSE CPP_FILES *.cpp *.h *.cxx)
foreach (filepath ${CPP_FILES}) foreach (filepath ${CPP_FILES})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
message(${filename})
list(APPEND sources_files ${filename}) list(APPEND sources_files ${filename})
endforeach (filepath) endforeach (filepath)
list(REMOVE_ITEM sources_files qhotkey/qhotkey_mac.cpp qhotkey/qhotkey_win.cpp qhotkey/qhotkey_x11.cpp)
if (WIN32)
list(APPEND sources_files qhotkey/qhotkey_win.cpp)
elseif (APPLE)
list(APPEND sources_files qhotkey/qhotkey_mac.cpp)
elseif (UNIX)
list(APPEND sources_files qhotkey/qhotkey_x11.cpp)
endif()
if (WIN32)
set(FLUENTUI_VERSION_RC_PATH ${CMAKE_CURRENT_BINARY_DIR}/version_${PROJECT_NAME}.rc)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/.cmake/version_dll.rc.in
${FLUENTUI_VERSION_RC_PATH}
)
endif ()
if (QT_VERSION VERSION_GREATER_EQUAL "6.2") if (QT_VERSION VERSION_GREATER_EQUAL "6.2")
#删除fluentuiplugin.cpp与fluentuiplugin.h这些只要Qt5使用Qt6不需要 #删除fluentuiplugin.cpp与fluentuiplugin.h这些只要Qt5使用Qt6不需要
list(REMOVE_ITEM sources_files fluentuiplugin.h fluentuiplugin.cpp) list(REMOVE_ITEM sources_files fluentuiplugin.h fluentuiplugin.cpp)
@ -179,6 +197,34 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::Qml Qt${QT_VERSION_MAJOR}::Qml
) )
if(APPLE)
find_library(CARBON_LIBRARY Carbon)
target_link_libraries(${PROJECT_NAME} PRIVATE ${CARBON_LIBRARY})
elseif(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE user32)
elseif(UNIX)
if(QT_VERSION_MAJOR STREQUAL "6")
if(QT_VERSION VERSION_LESS "6.2.0")
message(FATAL_ERROR "Qt 6.2.0 or greater is required when using Qt6")
endif()
else()
if(QT_VERSION_MAJOR LESS "6")
find_package(Qt5 REQUIRED COMPONENTS X11Extras)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::X11Extras)
endif()
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE X11)
endif()
if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release"))
find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)
add_custom_target(Script-Generate-QmlTypes
COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
COMMENT "Generate qmltypes........."
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()
#安装 #安装
install(DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX}/imports) install(DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX}/imports)

View File

@ -1,5 +1,4 @@
#include "FluAccentColor.h" #include "FluAccentColor.h"
FluAccentColor::FluAccentColor(QObject *parent) : QObject{parent} { FluAccentColor::FluAccentColor(QObject *parent) : QObject{parent} {
} }

View File

@ -1,6 +1,5 @@
#include "FluApp.h" #include "FluApp.h"
#include <QQmlEngine>
#include <QGuiApplication> #include <QGuiApplication>
#include <QQuickItem> #include <QQuickItem>
#include <QTimer> #include <QTimer>
@ -9,6 +8,7 @@
#include <QClipboard> #include <QClipboard>
#include <QTranslator> #include <QTranslator>
#include <utility> #include <utility>
#include "FluentIconDef.h"
FluApp::FluApp(QObject *parent) : QObject{parent} { FluApp::FluApp(QObject *parent) : QObject{parent} {
_useSystemAppBar = false; _useSystemAppBar = false;
@ -16,9 +16,10 @@ FluApp::FluApp(QObject *parent) : QObject{parent} {
FluApp::~FluApp() = default; FluApp::~FluApp() = default;
void FluApp::init(QObject *target, QLocale locale) { void FluApp::init(QObject *launcher, QLocale locale) {
this->launcher(launcher);
_locale = std::move(locale); _locale = std::move(locale);
_engine = qmlEngine(target); _engine = qmlEngine(launcher);
_translator = new QTranslator(this); _translator = new QTranslator(this);
QGuiApplication::installTranslator(_translator); QGuiApplication::installTranslator(_translator);
const QStringList uiLanguages = _locale.uiLanguages(); const QStringList uiLanguages = _locale.uiLanguages();
@ -30,3 +31,19 @@ void FluApp::init(QObject *target, QLocale locale) {
} }
} }
} }
[[maybe_unused]] QJsonArray FluApp::iconData(const QString &keyword) {
QJsonArray arr;
QMetaEnum enumType = FluentIcons::staticMetaObject.enumerator(FluentIcons::staticMetaObject.indexOfEnumerator("Type"));
for (int i = 0; i <= enumType.keyCount() - 1; ++i) {
QString name = enumType.key(i);
int icon = enumType.value(i);
if (keyword.isEmpty() || name.contains(keyword)) {
QJsonObject obj;
obj.insert("name", name);
obj.insert("icon", icon);
arr.append(obj);
}
}
return arr;
}

View File

@ -8,6 +8,7 @@
#include <QQmlEngine> #include <QQmlEngine>
#include <QTranslator> #include <QTranslator>
#include <QQuickWindow> #include <QQuickWindow>
#include <QJsonArray>
#include "stdafx.h" #include "stdafx.h"
#include "singleton.h" #include "singleton.h"
@ -20,6 +21,7 @@ Q_OBJECT
Q_PROPERTY_AUTO(bool, useSystemAppBar) Q_PROPERTY_AUTO(bool, useSystemAppBar)
Q_PROPERTY_AUTO(QString, windowIcon) Q_PROPERTY_AUTO(QString, windowIcon)
Q_PROPERTY_AUTO(QLocale, locale) Q_PROPERTY_AUTO(QLocale, locale)
Q_PROPERTY_AUTO_P(QObject*,launcher)
QML_NAMED_ELEMENT(FluApp) QML_NAMED_ELEMENT(FluApp)
QML_SINGLETON QML_SINGLETON
@ -33,7 +35,9 @@ SINGLETON(FluApp)
static FluApp *create(QQmlEngine *, QJSEngine *) { return getInstance(); } static FluApp *create(QQmlEngine *, QJSEngine *) { return getInstance(); }
Q_INVOKABLE void init(QObject *target, QLocale locale = QLocale::system()); Q_INVOKABLE void init(QObject *launcher, QLocale locale = QLocale::system());
[[maybe_unused]] Q_INVOKABLE static QJsonArray iconData(const QString &keyword = "");
private: private:
QQmlEngine *_engine{}; QQmlEngine *_engine{};

View File

@ -4,8 +4,10 @@
#include <QGuiApplication> #include <QGuiApplication>
#include <QScreen> #include <QScreen>
#include <QDateTime> #include <QDateTime>
#include "FluTools.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#pragma comment (lib, "user32.lib") #pragma comment (lib, "user32.lib")
#pragma comment (lib, "dwmapi.lib") #pragma comment (lib, "dwmapi.lib")
@ -33,15 +35,28 @@ static inline bool isCompositionEnabled() {
return false; return false;
} }
static inline void setShadow(HWND hwnd) {
const MARGINS shadow = {1, 0, 0, 0};
typedef HRESULT (WINAPI *DwmExtendFrameIntoClientAreaPtr)(HWND hWnd, const MARGINS *pMarInset);
HMODULE module = LoadLibraryW(L"dwmapi.dll");
if (module) {
DwmExtendFrameIntoClientAreaPtr dwm_extendframe_into_client_area_;
dwm_extendframe_into_client_area_ = reinterpret_cast<DwmExtendFrameIntoClientAreaPtr>(GetProcAddress(module, "DwmExtendFrameIntoClientArea"));
if (dwm_extendframe_into_client_area_) {
dwm_extendframe_into_client_area_(hwnd, &shadow);
}
}
}
#endif #endif
bool containsCursorToItem(QQuickItem *item) { bool containsCursorToItem(QQuickItem *item) {
if (!item || !item->isVisible()) { if (!item || !item->isVisible()) {
return false; return false;
} }
auto point = QCursor::pos(); auto point = item->window()->mapFromGlobal(QCursor::pos());
auto rect = QRectF(item->mapToGlobal(QPoint(0, 0)), item->size()); auto rect = QRectF(item->mapToItem(item->window()->contentItem(), QPointF(0, 0)), item->size());
if (point.x() > rect.x() && point.x() < (rect.x() + rect.width()) && point.y() > rect.y() && point.y() < (rect.y() + rect.height())) { if (rect.contains(point)) {
return true; return true;
} }
return false; return false;
@ -55,6 +70,7 @@ FluFrameless::FluFrameless(QQuickItem *parent) : QQuickItem{parent} {
_closeButton = nullptr; _closeButton = nullptr;
_topmost = false; _topmost = false;
_disabled = false; _disabled = false;
_isWindows11OrGreater = FluTools::getInstance()->isWindows11OrGreater();
} }
FluFrameless::~FluFrameless() = default; FluFrameless::~FluFrameless() = default;
@ -67,13 +83,10 @@ void FluFrameless::componentComplete() {
if (_disabled) { if (_disabled) {
return; return;
} }
int w = window()->width();
int h = window()->height();
_current = window()->winId(); _current = window()->winId();
window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint); window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (QQuickWindow::sceneGraphBackend() == "software") {
window()->setFlag(Qt::FramelessWindowHint, false);
}
#endif
if (!_fixSize) { if (!_fixSize) {
window()->setFlag(Qt::WindowMaximizeButtonHint); window()->setFlag(Qt::WindowMaximizeButtonHint);
} }
@ -92,21 +105,42 @@ void FluFrameless::componentComplete() {
HWND hwnd = reinterpret_cast<HWND>(window()->winId()); HWND hwnd = reinterpret_cast<HWND>(window()->winId());
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE); DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
if (_fixSize) { if (_fixSize) {
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME); #if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME);;
#else
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_CAPTION);
#endif
for (int i = 0; i <= QGuiApplication::screens().count() - 1; ++i) { for (int i = 0; i <= QGuiApplication::screens().count() - 1; ++i) {
connect(QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] { connect(QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] {
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED); SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
}); });
} }
} else { } else {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME);
#else
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CAPTION);
#endif
} }
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
connect(window(), &QQuickWindow::screenChanged, this, [hwnd] { connect(window(), &QQuickWindow::screenChanged, this, [hwnd] {
::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOOWNERZORDER); ::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOOWNERZORDER);
::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
}); });
if (!window()->property("_hideShadow").toBool()) {
setShadow(hwnd);
}
#endif #endif
auto appBarHeight = _appbar->height();
h = qRound(h + appBarHeight);
if (_fixSize) {
window()->setMaximumSize(QSize(w, h));
window()->setMinimumSize(QSize(w, h));
} else {
window()->setMinimumHeight(window()->minimumHeight() + appBarHeight);
window()->setMaximumHeight(window()->maximumHeight() + appBarHeight);
}
window()->resize(QSize(w, h));
connect(this, &FluFrameless::topmostChanged, this, [this] { connect(this, &FluFrameless::topmostChanged, this, [this] {
_setWindowTopmost(topmost()); _setWindowTopmost(topmost());
}); });
@ -130,54 +164,52 @@ void FluFrameless::componentComplete() {
const auto uMsg = msg->message; const auto uMsg = msg->message;
const auto wParam = msg->wParam; const auto wParam = msg->wParam;
const auto lParam = msg->lParam; const auto lParam = msg->lParam;
static QPoint offsetXY;
if (uMsg == WM_WINDOWPOSCHANGING) { if (uMsg == WM_WINDOWPOSCHANGING) {
auto *wp = reinterpret_cast<WINDOWPOS *>(lParam); auto *wp = reinterpret_cast<WINDOWPOS *>(lParam);
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) { if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) {
wp->flags |= SWP_NOCOPYBITS; wp->flags |= SWP_NOCOPYBITS;
*result = ::DefWindowProcW(hwnd, uMsg, wParam, lParam); *result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(::DefWindowProcW(hwnd, uMsg, wParam, lParam));
return true; return true;
} }
return false; return false;
} else if (uMsg == WM_NCCALCSIZE) { } else if (uMsg == WM_NCCALCSIZE && wParam == TRUE) {
const auto clientRect = ((wParam == FALSE) ? reinterpret_cast<LPRECT>(lParam) : &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]); const auto clientRect = &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0];
const LONG originalTop = clientRect->top; const LONG originalTop = clientRect->top;
const LONG originalLeft = clientRect->left; const LONG originalLeft = clientRect->left;
const LONG originalRight = clientRect->right;
const LONG originalBottom = clientRect->bottom; const LONG originalBottom = clientRect->bottom;
const LONG originalRight = clientRect->right;
const LRESULT hitTestResult = ::DefWindowProcW(hwnd, WM_NCCALCSIZE, wParam, lParam); const LRESULT hitTestResult = ::DefWindowProcW(hwnd, WM_NCCALCSIZE, wParam, lParam);
if ((hitTestResult != HTERROR) && (hitTestResult != HTNOWHERE)) { if ((hitTestResult != HTERROR) && (hitTestResult != HTNOWHERE)) {
*result = hitTestResult; *result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(hitTestResult);
return true; return true;
} }
int offsetSize; #if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
bool isMaximum = ::IsZoomed(hwnd); clientRect->top = originalTop;
offsetXY = QPoint(abs(clientRect->left - originalLeft), abs(clientRect->top - originalTop)); clientRect->bottom = originalBottom;
if (isMaximum || _isFullScreen()) { clientRect->left = originalLeft;
offsetSize = 0; clientRect->right = originalRight;
} else {
offsetSize = 1;
}
if (!isCompositionEnabled()) {
offsetSize = 0;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (!isMaximum) {
clientRect->top = originalTop + offsetSize;
clientRect->bottom = originalBottom - offsetSize;
clientRect->left = originalLeft + offsetSize;
clientRect->right = originalRight - offsetSize;
}
#else #else
clientRect->top = originalTop + offsetSize; bool isMaximum = ::IsZoomed(hwnd);
clientRect->bottom = originalBottom - offsetSize; if (isMaximum) {
clientRect->left = originalLeft + offsetSize; auto geometry = window()->screen()->geometry();
clientRect->right = originalRight - offsetSize; auto offsetX = qAbs(geometry.left() - originalLeft);
auto offsetY = qAbs(geometry.top() - originalTop);
clientRect->top = originalTop + offsetY;
clientRect->bottom = originalBottom - offsetY;
clientRect->left = originalLeft + offsetX;
clientRect->right = originalRight - offsetX;
} else {
clientRect->top = originalTop;
clientRect->bottom = originalBottom;
clientRect->left = originalLeft;
clientRect->right = originalRight;
}
#endif #endif
_setMaximizeHovered(false); _setMaximizeHovered(false);
*result = WVR_REDRAW; *result = WVR_REDRAW;
return true; return true;
} else if (uMsg == WM_NCHITTEST) { } else if (uMsg == WM_NCHITTEST) {
if (_isWindows11OrGreater) {
if (_hitMaximizeButton()) { if (_hitMaximizeButton()) {
if (*result == HTNOWHERE) { if (*result == HTNOWHERE) {
*result = HTZOOM; *result = HTZOOM;
@ -187,6 +219,7 @@ void FluFrameless::componentComplete() {
} }
_setMaximizeHovered(false); _setMaximizeHovered(false);
_setMaximizePressed(false); _setMaximizePressed(false);
}
*result = 0; *result = 0;
POINT nativeGlobalPos{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)}; POINT nativeGlobalPos{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
POINT nativeLocalPos = nativeGlobalPos; POINT nativeLocalPos = nativeGlobalPos;
@ -228,40 +261,52 @@ void FluFrameless::componentComplete() {
} }
*result = HTCLIENT; *result = HTCLIENT;
return true; return true;
} else if (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN) { } else if (uMsg == WM_NCPAINT) {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
*result = FALSE;
return true;
#else
if (isCompositionEnabled()) {
return false;
}
*result = FALSE;
return true;
#endif
} else if (uMsg == WM_NCACTIVATE) {
*result = TRUE;
return true;
} else if (uMsg == WM_GETMINMAXINFO) {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
auto pixelRatio = window()->devicePixelRatio();
auto geometry = window()->screen()->availableGeometry();
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
minmaxInfo->ptMaxPosition.x = rect.left;
minmaxInfo->ptMaxPosition.y = rect.top;
minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio);
minmaxInfo->ptMaxSize.y = qRound(geometry.height() * pixelRatio);
#endif
return false;
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
if (_hitMaximizeButton()) { if (_hitMaximizeButton()) {
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QGuiApplication::sendEvent(_maximizeButton, &event); QGuiApplication::sendEvent(_maximizeButton, &event);
_setMaximizePressed(true); _setMaximizePressed(true);
return true; return true;
} }
} else if (uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP) { } else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP)) {
if (_hitMaximizeButton()) { if (_hitMaximizeButton()) {
QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QGuiApplication::sendEvent(_maximizeButton, &event); QGuiApplication::sendEvent(_maximizeButton, &event);
_setMaximizePressed(false); _setMaximizePressed(false);
return true; return true;
} }
} else if (uMsg == WM_NCPAINT) {
*result = FALSE;
return true;
} else if (uMsg == WM_NCACTIVATE) {
*result = ::DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1);
return true;
} else if (uMsg == WM_GETMINMAXINFO) {
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
auto pixelRatio = window()->devicePixelRatio();
auto geometry = window()->screen()->availableGeometry();
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
minmaxInfo->ptMaxPosition.x = rect.left - offsetXY.x();
minmaxInfo->ptMaxPosition.y = rect.top - offsetXY.x();
minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio) + offsetXY.x() * 2;
minmaxInfo->ptMaxSize.y = qRound(geometry.height() * pixelRatio) + offsetXY.y() * 2;
return false;
} else if (uMsg == WM_NCRBUTTONDOWN) { } else if (uMsg == WM_NCRBUTTONDOWN) {
if (wParam == HTCAPTION) { if (wParam == HTCAPTION) {
_showSystemMenu(QCursor::pos()); auto pos = window()->position();
auto offset = window()->mapFromGlobal(QCursor::pos());
_showSystemMenu(QPoint(pos.x() + offset.x(), pos.y() + offset.y()));
} }
} else if (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN) { } else if (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN) {
const bool altPressed = ((wParam == VK_MENU) || (::GetKeyState(VK_MENU) < 0)); const bool altPressed = ((wParam == VK_MENU) || (::GetKeyState(VK_MENU) < 0));
@ -273,9 +318,11 @@ void FluFrameless::componentComplete() {
} else if (uMsg == WM_SYSCOMMAND) { } else if (uMsg == WM_SYSCOMMAND) {
if (wParam == SC_MINIMIZE) { if (wParam == SC_MINIMIZE) {
if (window()->transientParent()) { if (window()->transientParent()) {
window()->transientParent()->showMinimized(); auto _hwnd = reinterpret_cast<HWND>(window()->transientParent()->winId());
::ShowWindow(_hwnd, 2);
} else { } else {
window()->showMinimized(); auto _hwnd = reinterpret_cast<HWND>(window()->winId());
::ShowWindow(_hwnd, 2);
} }
return true; return true;
} }
@ -297,9 +344,16 @@ bool FluFrameless::_isFullScreen() {
void FluFrameless::_showSystemMenu(QPoint point) { void FluFrameless::_showSystemMenu(QPoint point) {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QScreen *screen = window()->screen();
if (!screen) {
screen = QGuiApplication::primaryScreen();
}
if (!screen) {
return;
}
const QPoint origin = screen->geometry().topLeft();
auto nativePos = QPointF(QPointF(point - origin) * window()->devicePixelRatio()).toPoint() + origin;
HWND hwnd = reinterpret_cast<HWND>(window()->winId()); HWND hwnd = reinterpret_cast<HWND>(window()->winId());
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_SYSMENU);
auto hMenu = ::GetSystemMenu(hwnd, FALSE); auto hMenu = ::GetSystemMenu(hwnd, FALSE);
if (_isMaximized() || _isFullScreen()) { if (_isMaximized() || _isFullScreen()) {
::EnableMenuItem(hMenu, SC_MOVE, MFS_DISABLED); ::EnableMenuItem(hMenu, SC_MOVE, MFS_DISABLED);
@ -315,12 +369,11 @@ void FluFrameless::_showSystemMenu(QPoint point) {
::EnableMenuItem(hMenu, SC_SIZE, MFS_DISABLED); ::EnableMenuItem(hMenu, SC_SIZE, MFS_DISABLED);
::EnableMenuItem(hMenu, SC_MAXIMIZE, MFS_DISABLED); ::EnableMenuItem(hMenu, SC_MAXIMIZE, MFS_DISABLED);
} }
const int result = ::TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)), qRound(point.x() * window()->devicePixelRatio()), const int result = ::TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)), nativePos.x(),
qRound(point.y() * window()->devicePixelRatio()), 0, hwnd, nullptr); nativePos.y(), 0, hwnd, nullptr);
if (result != FALSE) { if (result) {
::PostMessageW(hwnd, WM_SYSCOMMAND, result, 0); ::PostMessageW(hwnd, WM_SYSCOMMAND, result, 0);
} }
::SetWindowLongPtr(hwnd, GWL_STYLE, style & ~WS_SYSMENU);
#endif #endif
} }
@ -345,12 +398,16 @@ bool FluFrameless::_hitMaximizeButton() {
} }
void FluFrameless::_setMaximizePressed(bool val) { void FluFrameless::_setMaximizePressed(bool val) {
if (_maximizeButton) {
_maximizeButton->setProperty("down", val); _maximizeButton->setProperty("down", val);
} }
}
void FluFrameless::_setMaximizeHovered(bool val) { void FluFrameless::_setMaximizeHovered(bool val) {
if (_maximizeButton) {
_maximizeButton->setProperty("hover", val); _maximizeButton->setProperty("hover", val);
} }
}
void FluFrameless::_updateCursor(int edges) { void FluFrameless::_updateCursor(int edges) {
switch (edges) { switch (edges) {
@ -387,16 +444,21 @@ void FluFrameless::showMaximized() {
HWND hwnd = reinterpret_cast<HWND>(window()->winId()); HWND hwnd = reinterpret_cast<HWND>(window()->winId());
::ShowWindow(hwnd, 3); ::ShowWindow(hwnd, 3);
#else #else
window()->showMaximized(); window()->setVisibility(QQuickWindow::Maximized);
#endif #endif
} }
[[maybe_unused]] void FluFrameless::showMinimized() { [[maybe_unused]] void FluFrameless::showMinimized() {
window()->showMinimized(); #ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
::ShowWindow(hwnd, 2);
#else
window()->setVisibility(QQuickWindow::Minimized);
#endif
} }
void FluFrameless::showNormal() { void FluFrameless::showNormal() {
window()->showNormal(); window()->setVisibility(QQuickWindow::Windowed);
} }
void FluFrameless::setHitTestVisible(QQuickItem *val) { void FluFrameless::setHitTestVisible(QQuickItem *val) {
@ -405,7 +467,6 @@ void FluFrameless::setHitTestVisible(QQuickItem *val) {
} }
} }
void FluFrameless::_setWindowTopmost(bool topmost) { void FluFrameless::_setWindowTopmost(bool topmost) {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(window()->winId()); HWND hwnd = reinterpret_cast<HWND>(window()->winId());

View File

@ -3,6 +3,7 @@
#include <QObject> #include <QObject>
#include <QQuickItem> #include <QQuickItem>
#include <QAbstractNativeEventFilter> #include <QAbstractNativeEventFilter>
#include <QQmlProperty>
#include "stdafx.h" #include "stdafx.h"
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
@ -72,5 +73,6 @@ private:
int _edges = 0; int _edges = 0;
int _margins = 8; int _margins = 8;
quint64 _clickTimer = 0; quint64 _clickTimer = 0;
bool _isWindows11OrGreater = false;
QList<QPointer<QQuickItem>> _hitTestList; QList<QPointer<QQuickItem>> _hitTestList;
}; };

32
src/FluHotkey.cpp Normal file
View File

@ -0,0 +1,32 @@
#include "FluHotkey.h"
#include "QGuiApplication"
FluHotkey::FluHotkey(QObject *parent)
: QObject{parent}
{
_sequence = "";
_isRegistered = false;
connect(this,&FluHotkey::sequenceChanged,this,[=]{
if(_hotkey){
delete _hotkey;
_hotkey = nullptr;
}
_hotkey = new QHotkey(QKeySequence(_sequence), true, qApp);
this->isRegistered(_hotkey->isRegistered());
QObject::connect(_hotkey, &QHotkey::activated, qApp, [=](){
Q_EMIT this->activated();
});
QObject::connect(_hotkey, &QHotkey::registeredChanged, qApp, [=](){
this->isRegistered(_hotkey->isRegistered());
});
});
}
FluHotkey::~FluHotkey(){
if(_hotkey){
delete _hotkey;
_hotkey = nullptr;
}
}

24
src/FluHotkey.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef FLUHOTKEY_H
#define FLUHOTKEY_H
#include <QObject>
#include <QQuickItem>
#include "qhotkey/qhotkey.h"
#include "stdafx.h"
class FluHotkey : public QObject
{
Q_OBJECT
Q_PROPERTY_AUTO(QString,sequence)
Q_PROPERTY_AUTO(QString,name)
Q_PROPERTY_READONLY_AUTO(bool,isRegistered)
QML_NAMED_ELEMENT(FluHotkey)
public:
explicit FluHotkey(QObject *parent = nullptr);
~FluHotkey();
Q_SIGNAL void activated();
private:
QHotkey* _hotkey = nullptr;
};
#endif // FLUHOTKEY_H

63
src/FluTableModel.cpp Normal file
View File

@ -0,0 +1,63 @@
#include "FluTableModel.h"
FluTableModel::FluTableModel(QObject *parent) : QAbstractTableModel{parent} {
}
int FluTableModel::rowCount(const QModelIndex &parent) const {
return _rows.count();
}
int FluTableModel::columnCount(const QModelIndex &parent) const {
return this->_columnSource.size();
}
QVariant FluTableModel::data(const QModelIndex &index, int role) const {
switch (role) {
case FluTableModel::RowModel:
return QVariant::fromValue(_rows.at(index.row()));
case FluTableModel::ColumnModel:
return QVariant::fromValue(_columnSource.at(index.column()));
default:
break;
}
return {};
}
QHash<int, QByteArray> FluTableModel::roleNames() const {
return {
{FluTableModel::RowModel, "rowModel"},
{FluTableModel::ColumnModel, "columnModel"}
};
}
void FluTableModel::clear() {
beginResetModel();
this->_rows.clear();
endResetModel();
}
QVariant FluTableModel::getRow(int rowIndex) {
return _rows.at(rowIndex);
}
void FluTableModel::setRow(int rowIndex, QVariant row) {
_rows.replace(rowIndex, row.toMap());
Q_EMIT dataChanged(index(rowIndex, 0), index(rowIndex, columnCount() - 1));
}
void FluTableModel::insertRow(int rowIndex, QVariant row) {
beginInsertRows(QModelIndex(), rowIndex, rowIndex);
_rows.insert(rowIndex, row.toMap());
endInsertRows();
}
void FluTableModel::removeRow(int rowIndex, int rows) {
beginRemoveRows(QModelIndex(), rowIndex, rowIndex + rows - 1);
_rows = _rows.mid(0, rowIndex) + _rows.mid(rowIndex + rows);
endRemoveRows();
}
void FluTableModel::appendRow(QVariant row) {
insertRow(rowCount(), row);
}

46
src/FluTableModel.h Normal file
View File

@ -0,0 +1,46 @@
#ifndef FLUTABLEMODEL_H
#define FLUTABLEMODEL_H
#include <QObject>
#include <QAbstractItemModel>
#include <QtQml/qqml.h>
#include "stdafx.h"
class FluTableModel : public QAbstractTableModel {
Q_OBJECT
Q_PROPERTY_AUTO(QList<QVariantMap>, columnSource)
Q_PROPERTY_AUTO(QList<QVariantMap>, rows)
Q_PROPERTY(int rowCount READ rowCount CONSTANT)
QML_NAMED_ELEMENT(FluTableModel)
public:
enum TableModelRoles {
RowModel = 0x0101,
ColumnModel = 0x0102
};
explicit FluTableModel(QObject *parent = nullptr);
[[nodiscard]] int rowCount(const QModelIndex &parent = {}) const override;
[[nodiscard]] int columnCount(const QModelIndex &parent = {}) const override;
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
Q_INVOKABLE void clear();
Q_INVOKABLE QVariant getRow(int rowIndex);
Q_INVOKABLE void setRow(int rowIndex, QVariant row);
Q_INVOKABLE void insertRow(int rowIndex, QVariant row);
Q_INVOKABLE void removeRow(int rowIndex, int rows = 1);
Q_INVOKABLE void appendRow(QVariant row);
};
#endif // FLUTABLEMODEL_H

View File

@ -3,9 +3,8 @@
#include <QJSValueList> #include <QJSValueList>
FluTableSortProxyModel::FluTableSortProxyModel(QSortFilterProxyModel *parent) : QSortFilterProxyModel{parent} { FluTableSortProxyModel::FluTableSortProxyModel(QSortFilterProxyModel *parent) : QSortFilterProxyModel{parent} {
_model = nullptr;
connect(this, &FluTableSortProxyModel::modelChanged, this, [=] { connect(this, &FluTableSortProxyModel::modelChanged, this, [=] {
setSourceModel(this->model()); setSourceModel(this->model().value<QAbstractTableModel *>());
}); });
} }
@ -59,15 +58,18 @@ bool FluTableSortProxyModel::lessThan(const QModelIndex &source_left, const QMod
[[maybe_unused]] QVariant FluTableSortProxyModel::getRow(int rowIndex) { [[maybe_unused]] QVariant FluTableSortProxyModel::getRow(int rowIndex) {
QVariant result; QVariant result;
QMetaObject::invokeMethod(_model, "getRow", Q_RETURN_ARG(QVariant, result), Q_ARG(int, mapToSource(index(rowIndex, 0)).row())); QMetaObject::invokeMethod(_model.value<QAbstractTableModel *>(), "getRow", Q_RETURN_ARG(QVariant, result), Q_ARG(int, mapToSource(index(rowIndex, 0)).row()));
return result; return result;
} }
[[maybe_unused]] void FluTableSortProxyModel::setRow(int rowIndex, const QVariant &val) { [[maybe_unused]] void FluTableSortProxyModel::setRow(int rowIndex, const QVariant &val) {
QMetaObject::invokeMethod(_model, "setRow", Q_ARG(int, mapToSource(index(rowIndex, 0)).row()), Q_ARG(QVariant, val)); QMetaObject::invokeMethod(_model.value<QAbstractTableModel *>(), "setRow", Q_ARG(int, mapToSource(index(rowIndex, 0)).row()), Q_ARG(QVariant, val));
}
[[maybe_unused]] void FluTableSortProxyModel::insertRow(int rowIndex, const QVariant &val) {
QMetaObject::invokeMethod(_model.value<QAbstractTableModel *>(), "insertRow", Q_ARG(int, mapToSource(index(rowIndex, 0)).row()), Q_ARG(QVariant, val));
} }
[[maybe_unused]] void FluTableSortProxyModel::removeRow(int rowIndex, int rows) { [[maybe_unused]] void FluTableSortProxyModel::removeRow(int rowIndex, int rows) {
QMetaObject::invokeMethod(_model, "removeRow", Q_ARG(int, mapToSource(index(rowIndex, 0)).row()), Q_ARG(int, rows)); QMetaObject::invokeMethod(_model.value<QAbstractTableModel *>(), "removeRow", Q_ARG(int, mapToSource(index(rowIndex, 0)).row()), Q_ARG(int, rows));
} }

View File

@ -8,7 +8,7 @@
class FluTableSortProxyModel : public QSortFilterProxyModel { class FluTableSortProxyModel : public QSortFilterProxyModel {
Q_OBJECT Q_OBJECT
Q_PROPERTY_AUTO_P(QAbstractTableModel*, model) Q_PROPERTY_AUTO_P(QVariant, model)
QML_NAMED_ELEMENT(FluTableSortProxyModel) QML_NAMED_ELEMENT(FluTableSortProxyModel)
public: public:
explicit FluTableSortProxyModel(QSortFilterProxyModel *parent = nullptr); explicit FluTableSortProxyModel(QSortFilterProxyModel *parent = nullptr);
@ -23,6 +23,8 @@ public:
[[maybe_unused]] Q_INVOKABLE void setRow(int rowIndex, const QVariant &val); [[maybe_unused]] Q_INVOKABLE void setRow(int rowIndex, const QVariant &val);
[[maybe_unused]] Q_INVOKABLE void insertRow(int rowIndex, const QVariant &val);
[[maybe_unused]] Q_INVOKABLE void removeRow(int rowIndex, int rows); [[maybe_unused]] Q_INVOKABLE void removeRow(int rowIndex, int rows);
[[maybe_unused]] Q_INVOKABLE void setComparator(const QJSValue &comparator); [[maybe_unused]] Q_INVOKABLE void setComparator(const QJSValue &comparator);

View File

@ -3,8 +3,8 @@
#include <QGuiApplication> #include <QGuiApplication>
#include <QPalette> #include <QPalette>
#include <QImage> #include <QImage>
#include <QThreadPool>
#include "Def.h" #include "Def.h"
#include "FluentIconDef.h"
#include "FluColors.h" #include "FluColors.h"
#include "FluTools.h" #include "FluTools.h"
@ -24,7 +24,6 @@ FluTheme::FluTheme(QObject *parent) : QObject{parent} {
_blurBehindWindowEnabled = false; _blurBehindWindowEnabled = false;
QGuiApplication::instance()->installEventFilter(this); QGuiApplication::instance()->installEventFilter(this);
refreshColors(); refreshColors();
updateDesktopImage();
connect(this, &FluTheme::darkModeChanged, this, [=] { connect(this, &FluTheme::darkModeChanged, this, [=] {
Q_EMIT darkChanged(); Q_EMIT darkChanged();
}); });
@ -33,6 +32,7 @@ FluTheme::FluTheme(QObject *parent) : QObject{parent} {
connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path) { connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path) {
Q_EMIT desktopImagePathChanged(); Q_EMIT desktopImagePathChanged();
}); });
connect(this, &FluTheme::blurBehindWindowEnabledChanged, this, [=] { checkUpdateDesktopImage(); });
startTimer(1000); startTimer(1000);
} }
@ -47,8 +47,8 @@ void FluTheme::refreshColors() {
fontSecondaryColor(isDark ? QColor(222, 222, 222, 255) : QColor(102, 102, 102, 255)); fontSecondaryColor(isDark ? QColor(222, 222, 222, 255) : QColor(102, 102, 102, 255));
fontTertiaryColor(isDark ? QColor(200, 200, 200, 255) : QColor(153, 153, 153, 255)); fontTertiaryColor(isDark ? QColor(200, 200, 200, 255) : QColor(153, 153, 153, 255));
itemNormalColor(isDark ? QColor(255, 255, 255, 0) : QColor(0, 0, 0, 0)); itemNormalColor(isDark ? QColor(255, 255, 255, 0) : QColor(0, 0, 0, 0));
frameColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.12)) : QColor(0, 0, 0, qRound(255 * 0.09))); frameColor(isDark ? QColor(56, 56, 56, qRound(255 * 0.8)) : QColor(243, 243, 243, qRound(255 * 0.8)));
frameActiveColor(isDark ? QColor(32, 32, 32, qRound(255 * 0.8)) : QColor(255, 255, 255, qRound(255 * 0.6))); frameActiveColor(isDark ? QColor(48, 48, 48, qRound(255 * 0.8)) : QColor(255, 255, 255, qRound(255 * 0.8)));
itemHoverColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.06)) : QColor(0, 0, 0, qRound(255 * 0.03))); itemHoverColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.06)) : QColor(0, 0, 0, qRound(255 * 0.03)));
itemPressColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.09)) : QColor(0, 0, 0, qRound(255 * 0.06))); itemPressColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.09)) : QColor(0, 0, 0, qRound(255 * 0.06)));
itemCheckColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.12)) : QColor(0, 0, 0, qRound(255 * 0.09))); itemCheckColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.12)) : QColor(0, 0, 0, qRound(255 * 0.09)));
@ -64,22 +64,6 @@ bool FluTheme::eventFilter(QObject *, QEvent *event) {
return false; return false;
} }
[[maybe_unused]] QJsonArray FluTheme::awesomeList(const QString &keyword) {
QJsonArray arr;
QMetaEnum enumType = Fluent_Icons::staticMetaObject.enumerator(Fluent_Icons::staticMetaObject.indexOfEnumerator("Fluent_IconType"));
for (int i = 0; i <= enumType.keyCount() - 1; ++i) {
QString name = enumType.key(i);
int icon = enumType.value(i);
if (keyword.isEmpty() || name.contains(keyword)) {
QJsonObject obj;
obj.insert("name", name);
obj.insert("icon", icon);
arr.append(obj);
}
}
return arr;
}
bool FluTheme::dark() const { bool FluTheme::dark() const {
if (_darkMode == FluThemeType::DarkMode::Dark) { if (_darkMode == FluThemeType::DarkMode::Dark) {
return true; return true;
@ -90,7 +74,12 @@ bool FluTheme::dark() const {
} }
} }
void FluTheme::updateDesktopImage(){ void FluTheme::checkUpdateDesktopImage() {
if (!_blurBehindWindowEnabled) {
return;
}
QThreadPool::globalInstance()->start([=]() {
_mutex.lock();
auto path = FluTools::getInstance()->getWallpaperFilePath(); auto path = FluTools::getInstance()->getWallpaperFilePath();
if (_desktopImagePath != path) { if (_desktopImagePath != path) {
if (!_desktopImagePath.isEmpty()) { if (!_desktopImagePath.isEmpty()) {
@ -99,9 +88,10 @@ void FluTheme::updateDesktopImage(){
desktopImagePath(path); desktopImagePath(path);
_watcher.addPath(path); _watcher.addPath(path);
} }
_mutex.unlock();
});
} }
void FluTheme::timerEvent(QTimerEvent *event) void FluTheme::timerEvent(QTimerEvent *event) {
{ checkUpdateDesktopImage();
updateDesktopImage();
} }

View File

@ -1,5 +1,4 @@
#ifndef FLUTHEME_H #pragma once
#define FLUTHEME_H
#include <QObject> #include <QObject>
#include <QtQml/qqml.h> #include <QtQml/qqml.h>
@ -8,6 +7,7 @@
#include <QColor> #include <QColor>
#include <QTimer> #include <QTimer>
#include <QFileSystemWatcher> #include <QFileSystemWatcher>
#include <QMutex>
#include "FluAccentColor.h" #include "FluAccentColor.h"
#include "stdafx.h" #include "stdafx.h"
#include "singleton.h" #include "singleton.h"
@ -48,19 +48,15 @@ private:
void refreshColors(); void refreshColors();
void updateBackgroundMainColor();
protected: protected:
void timerEvent(QTimerEvent *event) override; void timerEvent(QTimerEvent *event) override;
void updateDesktopImage(); void checkUpdateDesktopImage();
public: public:
SINGLETON(FluTheme) SINGLETON(FluTheme)
[[maybe_unused]] Q_INVOKABLE static QJsonArray awesomeList(const QString &keyword = "");
Q_SIGNAL void darkChanged(); Q_SIGNAL void darkChanged();
static FluTheme *create(QQmlEngine *, QJSEngine *) { return getInstance(); } static FluTheme *create(QQmlEngine *, QJSEngine *) { return getInstance(); }
@ -70,6 +66,5 @@ SINGLETON(FluTheme)
private: private:
bool _systemDark; bool _systemDark;
QFileSystemWatcher _watcher; QFileSystemWatcher _watcher;
QMutex _mutex;
}; };
#endif // FLUTHEME_H

View File

@ -281,6 +281,18 @@ QString FluTools::getWallpaperFilePath() {
return path; return path;
} }
} }
#elif defined(Q_OS_MACOS)
QProcess process;
QStringList args;
args << "-e";
args << R"(tell application "Finder" to get POSIX path of (desktop picture as alias))";
process.start("osascript", args);
process.waitForFinished();
QByteArray result = process.readAllStandardOutput().trimmed();
if(result.isEmpty()){
return "/System/Library/CoreServices/DefaultDesktop.heic";
}
return result;
#else #else
return {}; return {};
#endif #endif

View File

@ -1,25 +1,14 @@
#include "FluTreeModel.h" #include "FluTreeModel.h"
#include <QMetaEnum> #include <QMetaEnum>
#include <utility>
FluTreeNode::FluTreeNode(QObject *parent) : QObject{parent} { FluTreeNode::FluTreeNode(QObject *parent) : QObject{parent} {
} }
FluTreeModel::FluTreeModel(QObject *parent) : QAbstractItemModel{parent} { FluTreeModel::FluTreeModel(QObject *parent) : QAbstractTableModel{parent} {
_dataSourceSize = 0; _dataSourceSize = 0;
} }
QModelIndex FluTreeModel::parent(const QModelIndex &child) const {
return {};
}
QModelIndex FluTreeModel::index(int row, int column, const QModelIndex &parent) const {
if (!hasIndex(row, column, parent) || parent.isValid())
return {};
return createIndex(row, column, _rows.at(row));
}
int FluTreeModel::rowCount(const QModelIndex &parent) const { int FluTreeModel::rowCount(const QModelIndex &parent) const {
return _rows.count(); return _rows.count();
} }
@ -113,15 +102,7 @@ void FluTreeModel::checkRow(int row, bool checked) {
itemData->_checked = checked; itemData->_checked = checked;
} }
Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0)); Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0));
QList<FluTreeNode *> data;
foreach (auto item, _dataSource) {
if (!item->hasChildren()) {
if (item->_checked) {
data.append(item);
}
}
}
selectionModel(data);
} }
void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) { void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) {
@ -272,3 +253,13 @@ void FluTreeModel::allCollapse() {
_rows = _root->_children; _rows = _root->_children;
endResetModel(); endResetModel();
} }
QVariant FluTreeModel::selectionModel() {
QList<FluTreeNode *> data;
foreach (auto item, _dataSource) {
if (item->checked()) {
data.append(item);
}
}
return QVariant::fromValue(data);
}

View File

@ -86,13 +86,11 @@ public:
FluTreeNode *_parent = nullptr; FluTreeNode *_parent = nullptr;
}; };
class FluTreeModel : public QAbstractItemModel { class FluTreeModel : public QAbstractTableModel {
Q_OBJECT Q_OBJECT
Q_PROPERTY_AUTO(int, dataSourceSize) Q_PROPERTY_AUTO(int, dataSourceSize)
Q_PROPERTY_AUTO(QList<FluTreeNode *>, selectionModel)
Q_PROPERTY_AUTO(QList<QVariantMap>, columnSource) Q_PROPERTY_AUTO(QList<QVariantMap>, columnSource)
QML_NAMED_ELEMENT(FluTreeModel) QML_NAMED_ELEMENT(FluTreeModel)
QML_ADDED_IN_MINOR_VERSION(1)
public: public:
enum TreeModelRoles { enum TreeModelRoles {
RowModel = 0x0101, RowModel = 0x0101,
@ -109,10 +107,6 @@ public:
[[nodiscard]] QHash<int, QByteArray> roleNames() const override; [[nodiscard]] QHash<int, QByteArray> roleNames() const override;
[[nodiscard]] QModelIndex parent(const QModelIndex &child) const override;
[[nodiscard]] QModelIndex index(int row, int column, const QModelIndex &parent = {}) const override;
Q_INVOKABLE void removeRows(int row, int count); Q_INVOKABLE void removeRows(int row, int count);
Q_INVOKABLE void insertRows(int row, const QList<FluTreeNode *> &data); Q_INVOKABLE void insertRows(int row, const QList<FluTreeNode *> &data);
@ -141,6 +135,8 @@ public:
Q_INVOKABLE void allCollapse(); Q_INVOKABLE void allCollapse();
Q_INVOKABLE QVariant selectionModel();
private: private:
QList<FluTreeNode *> _rows; QList<FluTreeNode *> _rows;
QList<FluTreeNode *> _dataSource; QList<FluTreeNode *> _dataSource;

View File

@ -3,9 +3,9 @@
#include <QObject> #include <QObject>
#include <QtQml/qqml.h> #include <QtQml/qqml.h>
namespace Fluent_Icons { namespace FluentIcons {
Q_NAMESPACE Q_NAMESPACE
enum class Fluent_IconType { enum class Type {
GlobalNavButton = 0xe700, GlobalNavButton = 0xe700,
Wifi = 0xe701, Wifi = 0xe701,
Bluetooth = 0xe702, Bluetooth = 0xe702,
@ -1411,7 +1411,7 @@ namespace Fluent_Icons {
ClickedOutLoudSolidBold = 0xf8b3 ClickedOutLoudSolidBold = 0xf8b3
}; };
Q_ENUM_NS(Fluent_IconType) Q_ENUM_NS(Type)
QML_NAMED_ELEMENT(FluentIcons) QML_NAMED_ELEMENT(FluentIcons)
} }

View File

@ -15,6 +15,8 @@
#include "FluQrCodeItem.h" #include "FluQrCodeItem.h"
#include "FluTableSortProxyModel.h" #include "FluTableSortProxyModel.h"
#include "FluFrameless.h" #include "FluFrameless.h"
#include "FluTableModel.h"
#include "FluHotkey.h"
void FluentUI::registerTypes(QQmlEngine *engine) { void FluentUI::registerTypes(QQmlEngine *engine) {
initializeEngine(engine, _uri); initializeEngine(engine, _uri);
@ -32,8 +34,10 @@ void FluentUI::registerTypes(const char *uri) const {
qmlRegisterType<FluWatermark>(uri, major, minor, "FluWatermark"); qmlRegisterType<FluWatermark>(uri, major, minor, "FluWatermark");
qmlRegisterType<FluAccentColor>(uri, major, minor, "FluAccentColor"); qmlRegisterType<FluAccentColor>(uri, major, minor, "FluAccentColor");
qmlRegisterType<FluTreeModel>(uri, major, minor, "FluTreeModel"); qmlRegisterType<FluTreeModel>(uri, major, minor, "FluTreeModel");
qmlRegisterType<FluTableModel>(uri, major, minor, "FluTableModel");
qmlRegisterType<FluRectangle>(uri, major, minor, "FluRectangle"); qmlRegisterType<FluRectangle>(uri, major, minor, "FluRectangle");
qmlRegisterType<FluFrameless>(uri, major, minor, "FluFrameless"); qmlRegisterType<FluFrameless>(uri, major, minor, "FluFrameless");
qmlRegisterType<FluHotkey>(uri, major, minor, "FluHotkey");
qmlRegisterType<FluTableSortProxyModel>(uri, major, minor, "FluTableSortProxyModel"); qmlRegisterType<FluTableSortProxyModel>(uri, major, minor, "FluTableSortProxyModel");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAcrylic.qml"), uri, major, minor, "FluAcrylic"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAcrylic.qml"), uri, major, minor, "FluAcrylic");
@ -132,7 +136,7 @@ void FluentUI::registerTypes(const char *uri) const {
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRouter.qml"), uri, major, minor, "FluRouter"); qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRouter.qml"), uri, major, minor, "FluRouter");
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEventBus.qml"), uri, major, minor, "FluEventBus"); qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEventBus.qml"), uri, major, minor, "FluEventBus");
qmlRegisterUncreatableMetaObject(Fluent_Icons::staticMetaObject, uri, major, minor, "FluentIcons", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluentIcons::staticMetaObject, uri, major, minor, "FluentIcons", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluThemeType::staticMetaObject, uri, major, minor, "FluThemeType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluThemeType::staticMetaObject, uri, major, minor, "FluThemeType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluPageType::staticMetaObject, uri, major, minor, "FluPageType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluPageType::staticMetaObject, uri, major, minor, "FluPageType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluWindowType::staticMetaObject, uri, major, minor, "FluWindowType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluWindowType::staticMetaObject, uri, major, minor, "FluWindowType", "Access to enums & flags only");
@ -146,14 +150,35 @@ void FluentUI::registerTypes(const char *uri) const {
qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only");
qmlRegisterSingletonType(uri, major, minor, "FluApp", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluApp::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluColors", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluColors::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluTheme", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluTheme::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluTools", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluTools::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluTextStyle", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluTextStyle::getInstance());
});
// qmlRegisterSingletonInstance(uri, major, minor, "FluApp", FluApp::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluColors", FluColors::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTheme", FluTheme::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTools", FluTools::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTextStyle", FluTextStyle::getInstance());
qmlRegisterModule(uri, major, minor); qmlRegisterModule(uri, major, minor);
#endif #endif
} }
void FluentUI::initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri) { void FluentUI::initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri) {
engine->rootContext()->setContextProperty("FluApp", FluApp::getInstance()); Q_UNUSED(engine)
engine->rootContext()->setContextProperty("FluColors", FluColors::getInstance());
engine->rootContext()->setContextProperty("FluTheme", FluTheme::getInstance());
engine->rootContext()->setContextProperty("FluTools", FluTools::getInstance());
engine->rootContext()->setContextProperty("FluTextStyle", FluTextStyle::getInstance());
} }

View File

@ -8,7 +8,7 @@ Item {
property real tintOpacity: 0.65 property real tintOpacity: 0.65
property real luminosity: 0.01 property real luminosity: 0.01
property real noiseOpacity: 0.02 property real noiseOpacity: 0.02
property var target property alias target : effect_source.sourceItem
property int blurRadius: 32 property int blurRadius: 32
property rect targetRect: Qt.rect(control.x, control.y, control.width,control.height) property rect targetRect: Qt.rect(control.x, control.y, control.width,control.height)
ShaderEffectSource { ShaderEffectSource {
@ -16,7 +16,6 @@ Item {
anchors.fill: parent anchors.fill: parent
visible: false visible: false
sourceRect: control.targetRect sourceRect: control.targetRect
sourceItem: control.target
} }
FastBlur { FastBlur {
id: fast_blur id: fast_blur

View File

@ -14,7 +14,7 @@ Rectangle{
property string closeText : qsTr("Close") property string closeText : qsTr("Close")
property string stayTopText : qsTr("Sticky on Top") property string stayTopText : qsTr("Sticky on Top")
property string stayTopCancelText : qsTr("Sticky on Top cancelled") property string stayTopCancelText : qsTr("Sticky on Top cancelled")
property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000" property color textColor: FluTheme.fontPrimaryColor
property color minimizeNormalColor: FluTheme.itemNormalColor property color minimizeNormalColor: FluTheme.itemNormalColor
property color minimizeHoverColor: FluTheme.itemHoverColor property color minimizeHoverColor: FluTheme.itemHoverColor
property color minimizePressColor: FluTheme.itemPressColor property color minimizePressColor: FluTheme.itemPressColor

View File

@ -7,6 +7,7 @@ FluTextBox{
property var items:[] property var items:[]
property string emptyText: qsTr("No results found") property string emptyText: qsTr("No results found")
property int autoSuggestBoxReplacement: FluentIcons.Search property int autoSuggestBoxReplacement: FluentIcons.Search
property string textRole: "title"
property var filter: function(item){ property var filter: function(item){
if(item.title.indexOf(control.text)!==-1){ if(item.title.indexOf(control.text)!==-1){
return true return true
@ -25,7 +26,7 @@ FluTextBox{
function handleClick(modelData){ function handleClick(modelData){
control_popup.visible = false control_popup.visible = false
control.itemClicked(modelData) control.itemClicked(modelData)
control.updateText(modelData.title) control.updateText(modelData[textRole])
} }
function loadData(){ function loadData(){
var result = [] var result = []
@ -48,7 +49,6 @@ FluTextBox{
} }
Popup{ Popup{
id:control_popup id:control_popup
y:control.height
focus: false focus: false
padding: 0 padding: 0
enter: Transition { enter: Transition {
@ -59,12 +59,8 @@ FluTextBox{
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
contentItem: FluRectangle{ contentItem: FluClip{
radius: [4,4,4,4] radius: [5,5,5,5]
FluShadow{
radius: 4
}
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
ListView{ ListView{
id: list_view id: list_view
anchors.fill: parent anchors.fill: parent
@ -97,14 +93,17 @@ FluTextBox{
radius:4 radius:4
} }
color: { color: {
if(hovered){ if(pressed){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) return FluTheme.itemPressColor
} }
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0) if(hovered){
return FluTheme.itemHoverColor
}
return FluTheme.itemNormalColor
} }
} }
contentItem: FluText{ contentItem: FluText{
text:modelData.title text: modelData[textRole]
leftPadding: 10 leftPadding: 10
rightPadding: 10 rightPadding: 10
verticalAlignment : Qt.AlignVCenter verticalAlignment : Qt.AlignVCenter
@ -112,22 +111,28 @@ FluTextBox{
} }
} }
} }
background: Item{ background:Rectangle{
id:container id: rect_background
implicitWidth: control.width implicitWidth: control.width
implicitHeight: 38*Math.min(Math.max(list_view.count,1),8) implicitHeight: 38*Math.min(Math.max(list_view.count,1),8)
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{
radius: 5
}
} }
} }
onTextChanged: { onTextChanged: {
d.loadData() d.loadData()
if(d.flagVisible){ if(d.flagVisible){
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.implicitHeight){ if(d.window.height>pos.y+control.height+rect_background.implicitHeight){
control_popup.y = control.height control_popup.y = Qt.binding(function(){return control.height})
} else if(pos.y>container.implicitHeight){ } else if(pos.y>rect_background.implicitHeight){
control_popup.y = -container.implicitHeight control_popup.y = -rect_background.implicitHeight
} else { } else {
control_popup.y = d.window.height-(pos.y+container.implicitHeight) control_popup.y = d.window.height-(pos.y+rect_background.implicitHeight) - 1
} }
control_popup.visible = true control_popup.visible = true
} }

View File

@ -57,12 +57,12 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: { color: {
if(item_mouse.pressed){ if(item_mouse.pressed){
return FluTheme.dark ? Qt.rgba(150/255,150/255,150/235,1) : Qt.rgba(134/255,134/255,134/235,1) return FluTheme.dark ? Qt.rgba(150/255,150/255,150/255,1) : Qt.rgba(134/255,134/255,134/255,1)
} }
if(item_mouse.containsMouse){ if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(204/255,204/255,204/235,1) : Qt.rgba(92/255,92/255,92/235,1) return FluTheme.dark ? Qt.rgba(204/255,204/255,204/255,1) : Qt.rgba(92/255,92/255,92/255,1)
} }
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/235,1) : Qt.rgba(26/255,26/255,26/235,1) return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(26/255,26/255,26/255,1)
} }
MouseArea{ MouseArea{
id:item_mouse id:item_mouse

View File

@ -53,8 +53,6 @@ FluButton {
} }
Menu{ Menu{
id:popup id:popup
height: container.height
width: container.width
modal: true modal: true
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
@ -75,12 +73,9 @@ FluButton {
} }
} }
contentItem: Item{ contentItem: Item{
clip: true
Rectangle{
id:container id:container
width: 300 implicitWidth: 300
height: 360 implicitHeight: 360
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
@ -610,8 +605,10 @@ FluButton {
} }
} }
} }
} background:Rectangle{
background: Item{ radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 5 radius: 5
} }
@ -619,13 +616,12 @@ FluButton {
function showPopup() { function showPopup() {
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height - 1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {
popup.y = d.window.height-(pos.y+container.height) popup.y = d.window.height-(pos.y+container.height)
} }
popup.x = -(popup.width-control.width)/2
popup.open() popup.open()
} }
} }

View File

@ -13,16 +13,15 @@ Button{
property color current : Qt.rgba(1,1,1,1) property color current : Qt.rgba(1,1,1,1)
signal accepted() signal accepted()
property int colorHandleRadius: 8 property int colorHandleRadius: 8
property string cancelText: "取消" property string cancelText: qsTr("Cancel")
property string okText: "确定" property string okText: qsTr("OK")
property string titleText: "颜色选择器" property string titleText: qsTr("Color Picker")
property string editText: "编辑颜色" property string editText: qsTr("Edit Color")
property string redText: "红色" property string redText: qsTr("Red")
property string greenText: "绿色" property string greenText: qsTr("Green")
property string blueText: "蓝色" property string blueText: qsTr("Blue")
property string opacityText: "透明度" property string opacityText: qsTr("Opacity")
background: background: Rectangle{
Rectangle{
id:layout_color id:layout_color
radius: 5 radius: 5
color:"#00000000" color:"#00000000"

View File

@ -11,6 +11,7 @@ T.ComboBox {
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1) property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1) property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
property alias textBox: text_field
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding) implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
@ -39,6 +40,7 @@ T.ComboBox {
opacity: enabled ? 1 : 0.3 opacity: enabled ? 1 : 0.3
} }
contentItem: T.TextField { contentItem: T.TextField {
id: text_field
property bool disabled: !control.editable property bool disabled: !control.editable
leftPadding: !control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1 leftPadding: !control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1
rightPadding: control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1 rightPadding: control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1
@ -134,10 +136,9 @@ T.ComboBox {
} }
} }
background:Rectangle{ background:Rectangle{
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
border.width: 1
radius: 5 radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 5 radius: 5
} }

View File

@ -4,7 +4,6 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15 import QtQuick.Window 2.15
import FluentUI 1.0 import FluentUI 1.0
FluButton { FluButton {
property bool showYear: true property bool showYear: true
property var current property var current
@ -96,8 +95,6 @@ FluButton {
Menu{ Menu{
id:popup id:popup
modal: true modal: true
width: container.width
height: container.height
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
reversible: true reversible: true
@ -116,30 +113,26 @@ FluButton {
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
background:Item{ background:Rectangle{
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 4 radius: 5
} }
} }
contentItem: Item{ contentItem: Item{
clip: true
Rectangle{
id:container id:container
radius: 4 implicitHeight: 340
width: 300 implicitWidth: 300
height: 340
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
} }
FluShadow{
radius: 4
}
RowLayout{ RowLayout{
id:layout_content id:layout_content
spacing: 0 spacing: 0
width: parent.width width: parent.width
height: 300 height: 280
Component{ Component{
id:list_delegate id:list_delegate
Item{ Item{
@ -166,7 +159,7 @@ FluButton {
if(item_mouse.containsMouse){ if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
} }
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0) return Qt.rgba(0,0,0,0)
} }
radius: 3 radius: 3
MouseArea{ MouseArea{
@ -214,8 +207,9 @@ FluButton {
} }
ListView{ ListView{
id:list_view_1 id:list_view_1
width: 100 Layout.preferredWidth: 100
height: parent.height Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds boundsBehavior:Flickable.StopAtBounds
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
model: generateYearArray(1924,2048) model: generateYearArray(1924,2048)
@ -232,14 +226,16 @@ FluButton {
} }
} }
Rectangle{ Rectangle{
width: 1 Layout.preferredWidth: 1
height: parent.height Layout.preferredHeight: parent.height
color: control.dividerColor color: control.dividerColor
visible: showYear
} }
ListView{ ListView{
id:list_view_2 id:list_view_2
width: showYear ? 100 : 150 Layout.preferredWidth: showYear ? 99 : 150
height: parent.height Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
clip: true clip: true
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0 preferredHighlightBegin: 0
@ -254,20 +250,20 @@ FluButton {
} }
} }
Rectangle{ Rectangle{
width: 1 Layout.preferredWidth: 1
height: parent.height Layout.preferredHeight: parent.height
color: control.dividerColor color: control.dividerColor
} }
ListView{ ListView{
id:list_view_3 id:list_view_3
width: showYear ? 100 : 150 Layout.preferredWidth: showYear ? 99 : 150
height: parent.height Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
clip: true clip: true
preferredHighlightBegin: 0 preferredHighlightBegin: 0
preferredHighlightEnd: 0 preferredHighlightEnd: 0
highlightMoveDuration: 0 highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{ delegate: FluLoader{
property var model: modelData property var model: modelData
@ -277,17 +273,12 @@ FluButton {
} }
} }
} }
Rectangle{
width: parent.width
height: 1
anchors.top: layout_content.bottom
color: control.dividerColor
}
Rectangle{ Rectangle{
id:layout_actions id:layout_actions
height: 40 height: 60
radius: 5
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 5
anchors{ anchors{
bottom:parent.bottom bottom:parent.bottom
left: parent.left left: parent.left
@ -340,7 +331,6 @@ FluButton {
} }
} }
} }
}
y:35 y:35
function showPopup() { function showPopup() {
d.changeFlag = true d.changeFlag = true
@ -361,7 +351,7 @@ FluButton {
text_day.text = day text_day.text = day
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height-1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {

View File

@ -19,16 +19,20 @@ FluButton {
} }
iconColor:control.textColor iconColor:control.textColor
} }
Item{
id: d
property var window: Window.window
}
onClicked: { onClicked: {
if(menu.count !==0){ if(menu.count !==0){
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
var containerHeight = menu.count*36 var containerHeight = menu.count*36
if(window.height>pos.y+control.height+containerHeight){ if(d.window.height>pos.y+control.height+containerHeight){
menu.y = control.height menu.y = control.height
}else if(pos.y>containerHeight){ }else if(pos.y>containerHeight){
menu.y = -containerHeight menu.y = -containerHeight
}else{ }else{
menu.y = window.height-(pos.y+containerHeight) menu.y = d.window.height-(pos.y+containerHeight)
} }
menu.open() menu.open()
} }

View File

@ -3,44 +3,40 @@ import QtQuick.Controls 2.15
import FluentUI 1.0 import FluentUI 1.0
FluObject { FluObject {
property var root; property var root
property int layoutY: 75 property int layoutY: 75
id:control id:control
FluObject{ FluObject{
id:mcontrol id:mcontrol
property string const_success: "success"; property string const_success: "success"
property string const_info: "info"; property string const_info: "info"
property string const_warning: "warning"; property string const_warning: "warning"
property string const_error: "error"; property string const_error: "error"
property int maxWidth: 300; property int maxWidth: 300
property var screenLayout: null; property var screenLayout: null
function create(type,text,duration,moremsg){ function create(type,text,duration,moremsg){
if(screenLayout){ if(screenLayout){
var last = screenLayout.getLastloader(); var last = screenLayout.getLastloader()
if(last.type === type && last.text === text && moremsg === last.moremsg){ if(last.type === type && last.text === text && moremsg === last.moremsg){
last.restart(); last.duration = duration
return; if (duration > 0) last.restart()
return last
} }
} }
initScreenLayout(); initScreenLayout()
contentComponent.createObject(screenLayout,{ return contentComponent.createObject(screenLayout,{type:type,text:text,duration:duration,moremsg:moremsg,})
type:type,
text:text,
duration:duration,
moremsg:moremsg,
});
} }
function createCustom(itemcomponent,duration){ function createCustom(itemcomponent,duration){
initScreenLayout(); initScreenLayout()
if(itemcomponent){ if(itemcomponent){
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration}); return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration})
} }
} }
function initScreenLayout(){ function initScreenLayout(){
if(screenLayout == null){ if(screenLayout == null){
screenLayout = screenlayoutComponent.createObject(root); screenLayout = screenlayoutComponent.createObject(root)
screenLayout.y = control.layoutY; screenLayout.y = control.layoutY
screenLayout.z = 100000; screenLayout.z = 100000
} }
} }
Component{ Component{
@ -57,42 +53,44 @@ FluObject {
duration: FluTheme.animationEnabled ? 333 : 0 duration: FluTheme.animationEnabled ? 333 : 0
} }
} }
onChildrenChanged: if(children.length === 0) destroy(); onChildrenChanged: if(children.length === 0) destroy()
function getLastloader(){ function getLastloader(){
if(children.length > 0){ if(children.length > 0){
return children[children.length - 1]; return children[children.length - 1]
} }
return null; return null
} }
} }
} }
Component{ Component{
id:contentComponent id:contentComponent
Item{ Item{
id:content; id:content
property int duration: 1500 property int duration: 1500
property var itemcomponent property var itemcomponent
property string type property string type
property string text property string text
property string moremsg property string moremsg
width: parent.width; width: parent.width
height: loader.height; height: loader.height
function close(){ function close(){
content.destroy(); content.destroy()
} }
function restart(){ function restart(){
delayTimer.restart(); delayTimer.restart()
} }
Timer { Timer {
id:delayTimer id:delayTimer
interval: duration; running: duration > 0; repeat: duration > 0 interval: duration
onTriggered: content.close(); running: duration > 0
repeat: duration > 0
onTriggered: content.close()
} }
FluLoader{ FluLoader{
id:loader; id:loader
x:(parent.width - width) / 2; x:(parent.width - width) / 2
property var _super: content; property var _super: content
scale: item ? 1 : 0; scale: item ? 1 : 0
asynchronous: true asynchronous: true
Behavior on scale { Behavior on scale {
enabled: FluTheme.animationEnabled enabled: FluTheme.animationEnabled
@ -101,30 +99,30 @@ FluObject {
duration: 167 duration: 167
} }
} }
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle; sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle
} }
} }
} }
property Component fluent_sytle: Rectangle{ property Component fluent_sytle: Rectangle{
width: rowlayout.width + (btn_close.visible ? 30 : 48); width: rowlayout.width + (btn_close.visible ? 30 : 48)
height: rowlayout.height + 20; height: rowlayout.height + 20
color: { color: {
if(FluTheme.dark){ if(FluTheme.dark){
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1); case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1)
case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1); case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1)
case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1); case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1)
case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1); case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1)
} }
return Qt.rgba(255,255,255,1) return Qt.rgba(1,1,1,1)
}else{ }else{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return "#dff6dd"; case mcontrol.const_success: return Qt.rgba(223/255,246/255,221/255,1)
case mcontrol.const_warning: return "#fff4ce"; case mcontrol.const_warning: return Qt.rgba(255/255,244/255,206/255,1)
case mcontrol.const_info: return "#f4f4f4"; case mcontrol.const_info: return Qt.rgba(244/255,244/255,244/255,1)
case mcontrol.const_error: return "#fde7e9"; case mcontrol.const_error: return Qt.rgba(253/255,231/255,233/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
} }
} }
FluShadow{ FluShadow{
@ -135,34 +133,34 @@ FluObject {
border.color: { border.color: {
if(FluTheme.dark){ if(FluTheme.dark){
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1); case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1)
case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1); case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1)
case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1); case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1)
case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1); case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
}else{ }else{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return "#d2e8d0"; case mcontrol.const_success: return Qt.rgba(210/255,232/255,208/255,1)
case mcontrol.const_warning: return "#f0e6c2"; case mcontrol.const_warning: return Qt.rgba(240/255,230/255,194/255,1)
case mcontrol.const_info: return "#e6e6e6"; case mcontrol.const_info: return Qt.rgba(230/255,230/255,230/255,1)
case mcontrol.const_error: return "#eed9db"; case mcontrol.const_error: return Qt.rgba(238/255,217/255,219/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
} }
} }
Row{ Row{
id:rowlayout id:rowlayout
x:20; x:20
y:(parent.height - height) / 2; y:(parent.height - height) / 2
spacing: 10 spacing: 10
FluIcon{ FluIcon{
iconSource:{ iconSource:{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return FluentIcons.CompletedSolid; case mcontrol.const_success: return FluentIcons.CompletedSolid
case mcontrol.const_warning: return FluentIcons.InfoSolid; case mcontrol.const_warning: return FluentIcons.InfoSolid
case mcontrol.const_info: return FluentIcons.InfoSolid; case mcontrol.const_info: return FluentIcons.InfoSolid
case mcontrol.const_error: return FluentIcons.StatusErrorFull; case mcontrol.const_error: return FluentIcons.StatusErrorFull
}FluentIcons.StatusErrorFull }FluentIcons.StatusErrorFull
return FluentIcons.FA_info_circle return FluentIcons.FA_info_circle
} }
@ -170,20 +168,20 @@ FluObject {
iconColor: { iconColor: {
if(FluTheme.dark){ if(FluTheme.dark){
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1); case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1)
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1); case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1)
case mcontrol.const_info: return FluTheme.primaryColor; case mcontrol.const_info: return FluTheme.primaryColor
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1); case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
}else{ }else{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return "#0f7b0f"; case mcontrol.const_success: return Qt.rgba(15/255,123/255,15/255,1)
case mcontrol.const_warning: return "#9d5d00"; case mcontrol.const_warning: return Qt.rgba(157/255,93/255,0/255,1)
case mcontrol.const_info: return "#0066b4"; case mcontrol.const_info: return Qt.rgba(0/255,102/255,180/255,1)
case mcontrol.const_error: return "#c42b1c"; case mcontrol.const_error: return Qt.rgba(196/255,43/255,28/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
} }
} }
} }
@ -208,45 +206,39 @@ FluObject {
id:btn_close id:btn_close
iconSource: FluentIcons.ChromeClose iconSource: FluentIcons.ChromeClose
iconSize: 10 iconSize: 10
y:5 verticalPadding: 0
horizontalPadding: 0
width: 30
height: 20
visible: _super.duration<=0 visible: _super.duration<=0
iconColor: { anchors.verticalCenter: parent.verticalCenter
if(FluTheme.dark){ iconColor: FluTheme.dark ? Qt.rgba(222/255,222/255,222/255,1) : Qt.rgba(97/255,97/255,97/255,1)
switch(_super.type){
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
case mcontrol.const_info: return FluTheme.primaryColor;
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
}
return "#FFFFFF"
}else{
switch(_super.type){
case mcontrol.const_success: return "#0f7b0f";
case mcontrol.const_warning: return "#9d5d00";
case mcontrol.const_info: return "#0066b4";
case mcontrol.const_error: return "#c42b1c";
}
return "#FFFFFF"
}
}
onClicked: _super.close() onClicked: _super.close()
} }
} }
} }
} }
function showSuccess(text,duration=1000,moremsg){ function showSuccess(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "")
} }
function showInfo(text,duration=1000,moremsg){ function showInfo(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "")
} }
function showWarning(text,duration=1000,moremsg){ function showWarning(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "")
} }
function showError(text,duration=1000,moremsg){ function showError(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "")
} }
function showCustom(itemcomponent,duration=1000){ function showCustom(itemcomponent,duration=1000){
mcontrol.createCustom(itemcomponent,duration); return mcontrol.createCustom(itemcomponent,duration)
}
function clearAllInfo(){
if(mcontrol.screenLayout != null) {
mcontrol.screenLayout.destroy()
mcontrol.screenLayout = null
}
return true
} }
} }

View File

@ -39,13 +39,13 @@ T.Menu {
: false : false
clip: true clip: true
currentIndex: control.currentIndex currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {} ScrollBar.vertical: FluScrollBar{}
} }
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
implicitHeight: 36 implicitHeight: 36
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(240/255,240/255,240/255,1) color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(252/255,252/255,252/255,1)
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1) border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
border.width: 1 border.width: 1
radius: 5 radius: 5
FluShadow{} FluShadow{}

View File

@ -48,9 +48,6 @@ T.MenuBarItem {
radius: 3 radius: 3
color: { color: {
if(control.highlighted){ if(control.highlighted){
return FluTheme.itemCheckColor
}
if(control.hovered){
return FluTheme.itemHoverColor return FluTheme.itemHoverColor
} }
return FluTheme.itemNormalColor return FluTheme.itemNormalColor

View File

@ -101,7 +101,7 @@ T.MenuItem {
radius: 4 radius: 4
color: { color: {
if(control.highlighted){ if(control.highlighted){
return FluTheme.itemCheckColor return FluTheme.itemHoverColor
} }
return FluTheme.itemNormalColor return FluTheme.itemNormalColor
} }

View File

@ -1120,7 +1120,8 @@ Item {
} }
padding: 0 padding: 0
focus: true focus: true
contentItem: Item{ contentItem: FluClip{
radius: [5,5,5,5]
ListView{ ListView{
id:list_view id:list_view
anchors.fill: parent anchors.fill: parent
@ -1145,7 +1146,6 @@ Item {
visible: item_button.activeFocus visible: item_button.activeFocus
radius:4 radius:4
} }
FluLoader{ FluLoader{
id:item_dot_loader id:item_dot_loader
anchors{ anchors{
@ -1160,7 +1160,6 @@ Item {
return undefined return undefined
} }
} }
} }
contentItem: FluText{ contentItem: FluText{
text:modelData.title text:modelData.title
@ -1187,13 +1186,13 @@ Item {
} }
} }
} }
background: FluRectangle{ background: Rectangle{
implicitWidth: 180 implicitWidth: 180
radius: [4,4,4,4] color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(252/255,252/255,252/255,1)
FluShadow{ border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 4 border.width: 1
} radius: 5
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1) FluShadow{}
} }
function showPopup(pos,height,model){ function showPopup(pos,height,model){
background.implicitHeight = height background.implicitHeight = height

View File

@ -3,8 +3,10 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import FluentUI 1.0 import FluentUI 1.0
Item { Item {
signal requestPage(int page, int count) signal requestPage(int page, int count)
property string previousText: qsTr("<Previous") property string previousText: qsTr("<Previous")
property string nextText: qsTr("Next>") property string nextText: qsTr("Next>")
property int pageCurrent: 0 property int pageCurrent: 0
@ -13,6 +15,8 @@ Item {
property int pageCount: itemCount > 0 ? Math.ceil(itemCount / __itemPerPage) : 0 property int pageCount: itemCount > 0 ? Math.ceil(itemCount / __itemPerPage) : 0
property int __itemPerPage: 10 property int __itemPerPage: 10
property int __pageButtonHalf: Math.floor(pageButtonCount / 2) + 1 property int __pageButtonHalf: Math.floor(pageButtonCount / 2) + 1
property Component header: null
property Component footer: null
id: control id: control
implicitHeight: 40 implicitHeight: 40
implicitWidth: content.width implicitWidth: content.width
@ -21,6 +25,9 @@ Item {
height: control.height height: control.height
spacing: 10 spacing: 10
padding: 10 padding: 10
Loader {
sourceComponent: header
}
FluToggleButton { FluToggleButton {
visible: control.pageCount > 1 visible: control.pageCount > 1
disabled: control.pageCurrent <= 1 disabled: control.pageCurrent <= 1
@ -86,9 +93,11 @@ Item {
control.calcNewPage(control.pageCurrent + 1); control.calcNewPage(control.pageCurrent + 1);
} }
} }
Loader {
sourceComponent: footer
} }
function calcNewPage(page) }
{ function calcNewPage(page) {
if (!page) if (!page)
return return
let page_num = Number(page) let page_num = Number(page)

View File

@ -3,30 +3,87 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import FluentUI 1.0 import FluentUI 1.0
ColumnLayout { Item{
default property alias buttons: control.data
property int currentIndex : -1
id:control id:control
onCurrentIndexChanged: { default property list<QtObject> buttons
property int currentIndex : -1
property int spacing: 8
property int orientation: Qt.Vertical
property bool disabled: false
property bool manuallyDisabled: false
QtObject{
id: d
function updateChecked(){
if(buttons.length === 0){
return
}
for(var i = 0;i<buttons.length;i++){ for(var i = 0;i<buttons.length;i++){
buttons[i].checked = false buttons[i].checked = false
} }
var button = buttons[currentIndex] if(currentIndex>=0 && currentIndex<buttons.length){
if(button){ buttons[currentIndex].checked = true
button.checked = true
} }
} }
function refreshButtonStatus() {
for(var i = 0;i<buttons.length;i++){
if(!manuallyDisabled) buttons[i].enabled = !disabled
}
}
}
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
onCurrentIndexChanged: {
d.updateChecked()
}
onDisabledChanged: {
d.refreshButtonStatus()
}
onManuallyDisabledChanged: {
d.refreshButtonStatus()
}
Component{
id:com_vertical
ColumnLayout {
data: control.buttons
spacing: control.spacing
Component.onCompleted: { Component.onCompleted: {
for(var i = 0;i<buttons.length;i++){ for(var i = 0;i<control.buttons.length;i++){
buttons[i].clickListener = function(){ control.buttons[i].clickListener = function(){
for(var i = 0;i<buttons.length;i++){ for(var i = 0;i<control.buttons.length;i++){
var button = buttons[i] var button = control.buttons[i]
if(this === button){ if(this === button){
currentIndex = i control.currentIndex = i
} }
} }
} }
} }
currentIndex = 0 d.updateChecked()
d.refreshButtonStatus()
}
}
}
Component{
id:com_horizontal
RowLayout {
data: control.buttons
spacing: control.spacing
Component.onCompleted: {
for(var i = 0;i<control.buttons.length;i++){
control.buttons[i].clickListener = function(){
for(var i = 0;i<control.buttons.length;i++){
var button = control.buttons[i]
if(this === button){
control.currentIndex = i
}
}
}
}
d.updateChecked()
d.refreshButtonStatus()
}
}
}
FluLoader{
sourceComponent: control.orientation === Qt.Vertical ? com_vertical : com_horizontal
} }
} }

View File

@ -10,19 +10,19 @@ QtObject {
windows.push(window) windows.push(window)
} }
} }
function removeWindow(window) { function removeWindow(win) {
if(!window.transientParent){ if(!win.transientParent){
var index = windows.indexOf(window) var index = windows.indexOf(win)
if (index !== -1) { if (index !== -1) {
windows.splice(index, 1) windows.splice(index, 1)
FluTools.deleteLater(window) win.deleteLater()
} }
} }
} }
function exit(retCode){ function exit(retCode){
for(var i =0 ;i< windows.length; i++){ for(var i =0 ;i< windows.length; i++){
var item = windows[i] var win = windows[i]
FluTools.deleteLater(item) win.deleteLater()
} }
windows = [] windows = []
Qt.exit(retCode) Qt.exit(retCode)

View File

@ -171,7 +171,7 @@ T.ScrollBar {
,Transition { ,Transition {
to: "show" to: "show"
SequentialAnimation { SequentialAnimation {
PauseAnimation { duration: 450 } PauseAnimation { duration: 150 }
NumberAnimation { NumberAnimation {
target: rect_bar target: rect_bar
properties: vertical ? "width" : "height" properties: vertical ? "width" : "height"

View File

@ -4,7 +4,7 @@ import FluentUI 1.0
Item { Item {
//高性能阴影比DropShadow阴影性能高出数倍 //高性能阴影比DropShadow阴影性能高出数倍
property color color: FluTheme.dark ? "#AAAAAA" : "#999999" property color color: FluTheme.dark ? "#000000" : "#999999"
property int elevation: 5 property int elevation: 5
property int radius: 4 property int radius: 4
id:control id:control

View File

@ -10,7 +10,30 @@ FluIconButton {
property string positiveText: qsTr("Save") property string positiveText: qsTr("Save")
property string neutralText: qsTr("Cancel") property string neutralText: qsTr("Cancel")
property string negativeText: qsTr("Reset") property string negativeText: qsTr("Reset")
property bool registered: true
property color errorColor: Qt.rgba(250/255,85/255,85/255,1)
property FluHotkey syncHotkey: undefined
signal accepted() signal accepted()
padding: 0
verticalPadding: 0
horizontalPadding: 0
onSyncHotkeyChanged: {
current = syncHotkey.sequence.split("+")
control.registered = syncHotkey.isRegistered
control.registered = Qt.binding(function(){
return syncHotkey.isRegistered
})
}
text: ""
color: {
if(!enabled){
return disableColor
}
if(pressed){
return pressedColor
}
return hovered ? hoverColor : normalColor
}
QtObject{ QtObject{
id: d id: d
function keyToString(key_code,shift = true) function keyToString(key_code,shift = true)
@ -112,37 +135,46 @@ FluIconButton {
return ""; return "";
} }
} }
background: Rectangle{ background: Item{
implicitHeight: 42
implicitWidth: 42
}
contentItem: Item{
implicitWidth: childrenRect.width
implicitHeight: layout_row.height
FluText{
id: text_title
text: control.text
visible: control.text !== ""
rightPadding: 8
anchors{
verticalCenter: layout_rect.verticalCenter
}
}
Rectangle{
id: layout_rect
border.color: FluTheme.dark ? "#505050" : "#DFDFDF" border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
border.width: 1 border.width: 1
implicitHeight: 42
implicitWidth: layout_row.width+28
radius: control.radius radius: control.radius
color: control.color color: control.color
height: control.height
width: layout_row.width
anchors{
left: text_title.right
}
FluFocusRectangle{ FluFocusRectangle{
visible: control.activeFocus visible: control.activeFocus
} }
}
Component{
id:com_item_key
Rectangle{
id:item_key_control
color:FluTheme.primaryColor
width: Math.max(item_text.implicitWidth+12,28)
height: Math.max(item_text.implicitHeight,28)
radius: 4
FluText{
id:item_text
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
text: keyText
anchors.centerIn: parent
}
}
}
Row{ Row{
id:layout_row id:layout_row
spacing: 5 spacing: 5
anchors.centerIn: parent anchors.centerIn: parent
Item{
width: 8
height: 1
}
Repeater{ Repeater{
model: control.current model: control.current
delegate: Loader{ delegate: Loader{
@ -161,6 +193,39 @@ FluIconButton {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
Item{
width: 8
height: 1
}
}
}
FluText{
id: text_error
text: qsTr("Conflict")
color: control.errorColor
visible: !control.registered
anchors{
verticalCenter: layout_rect.verticalCenter
left: layout_rect.right
leftMargin: 4
}
}
}
Component{
id:com_item_key
Rectangle{
id:item_key_control
color:FluTheme.primaryColor
width: Math.max(item_text.implicitWidth+12,28)
height: Math.max(item_text.implicitHeight,28)
radius: 4
FluText{
id:item_text
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
text: keyText
anchors.centerIn: parent
}
}
} }
FluContentDialog{ FluContentDialog{
id:content_dialog id:content_dialog
@ -179,6 +244,9 @@ FluIconButton {
onPositiveClicked: { onPositiveClicked: {
control.current = content_dialog.keysModel control.current = content_dialog.keysModel
control.accepted() control.accepted()
if(control.syncHotkey){
control.syncHotkey.sequence = control.current.join("+")
}
} }
onNegativeClickListener: function(){ onNegativeClickListener: function(){
content_dialog.keysModel = control.current content_dialog.keysModel = control.current

View File

@ -8,11 +8,11 @@ Item{
id:control id:control
default property alias content: container.data default property alias content: container.data
property int statusMode: FluStatusLayoutType.Loading property int statusMode: FluStatusLayoutType.Loading
property string loadingText:"正在加载..." property string loadingText: qsTr("Loading...")
property string emptyText: "空空如也" property string emptyText: qsTr("Empty")
property string errorText: "页面出错了.." property string errorText: qsTr("Error")
property string errorButtonText: "重新加载" property string errorButtonText: qsTr("Reload")
property color color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) property color color: Qt.rgba(0,0,0,0)
signal errorClicked signal errorClicked
property Component loadingItem : com_loading property Component loadingItem : com_loading
property Component emptyItem : com_empty property Component emptyItem : com_empty

View File

@ -1,4 +1,5 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import Qt.labs.qmlmodels 1.0 import Qt.labs.qmlmodels 1.0
@ -8,65 +9,99 @@ Rectangle {
readonly property alias rows: table_view.rows readonly property alias rows: table_view.rows
readonly property alias columns: table_view.columns readonly property alias columns: table_view.columns
readonly property alias current: d.current readonly property alias current: d.current
readonly property alias sourceModel: table_model property var sourceModel:FluTableModel {
property var columnSource columnSource: control.columnSource
}
property var columnSource: []
property var dataSource property var dataSource
property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1) property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1)
property bool horizonalHeaderVisible: true property bool horizonalHeaderVisible: true
property bool verticalHeaderVisible: true property bool verticalHeaderVisible: true
property color selectedBorderColor: FluTheme.primaryColor property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3) property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
property alias view: table_view
property var columnWidthProvider: function(column) {
var columnModel = control.columnSource[column]
var width = columnModel.width
if(width){
return width
}
var minimumWidth = columnModel.minimumWidth
if(minimumWidth){
return minimumWidth
}
return d.defaultItemWidth
}
property var rowHeightProvider: function(row) {
var rowModel = control.getRow(row)
var height = rowModel.height
if(height){
return height
}
var minimumHeight = rowModel._minimumHeight
if(minimumHeight){
return minimumHeight
}
return d.defaultItemHeight
}
id:control id:control
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) color: {
if(Window.active){
return FluTheme.frameActiveColor
}
return FluTheme.frameColor
}
onColumnSourceChanged: { onColumnSourceChanged: {
if(columnSource.length!==0){ if(columnSource.length!==0){
var columns= [] var columns= []
var columnsData = []
var headerRow = {} var headerRow = {}
columnSource.forEach(function(item){ var offsetX = 0
var column = Qt.createQmlObject('import Qt.labs.qmlmodels 1.0;TableModelColumn{}',table_model); for(var i=0;i<=columnSource.length-1;i++){
var item = columnSource[i]
if(!item.width){
item.width = d.defaultItemWidth
}
item.x = offsetX
offsetX = offsetX + item.width
var column = Qt.createQmlObject('import Qt.labs.qmlmodels 1.0;TableModelColumn{}',sourceModel);
column.display = item.dataIndex column.display = item.dataIndex
columnsData.push(item)
columns.push(column) columns.push(column)
headerRow[item.dataIndex] = item.title headerRow[item.dataIndex] = item
}) }
d.columns_data = columnsData
table_model.columns = columns
header_column_model.columns = columns header_column_model.columns = columns
header_column_model.rows = [headerRow] header_column_model.rows = [headerRow]
} }
} }
Component.onDestruction: {
table_view.contentY = 0
}
QtObject{ QtObject{
id:d id:d
property var current property var current
property int rowHoverIndex: -1 property int rowHoverIndex: -1
property int defaultItemWidth: 100 property int defaultItemWidth: 100
property int defaultItemHeight: 42 property int defaultItemHeight: 42
property var columns_data: []
property var editDelegate property var editDelegate
property var editPosition property var editPosition
signal tableItemLayout(int column)
function getEditDelegate(column){ function getEditDelegate(column){
var obj =d.columns_data[column].editDelegate var obj =control.columnSource[column].editDelegate
if(obj){ if(obj){
return obj return obj
} }
if(d.columns_data[column].editMultiline === true){ if(control.columnSource[column].editMultiline === true){
return com_edit_multiline return com_edit_multiline
} }
return com_edit return com_edit
} }
} }
onDataSourceChanged: { onDataSourceChanged: {
table_model.clear() sourceModel.clear()
table_model.rows = dataSource sourceModel.rows = dataSource
}
TableModel {
id:table_model
TableModelColumn {}
} }
TableModel{ TableModel{
id: header_column_model id: header_column_model
TableModelColumn {} TableModelColumn { display : "title"}
} }
TableModel{ TableModel{
id: header_row_model id: header_row_model
@ -74,14 +109,14 @@ Rectangle {
} }
FluTableSortProxyModel{ FluTableSortProxyModel{
id: table_sort_model id: table_sort_model
model: table_model model: control.sourceModel
} }
Component{ Component{
id:com_edit id:com_edit
FluTextBox{ FluTextBox{
id:text_box id:text_box
text: String(display) text: String(display)
readOnly: true === d.columns_data[column].readOnly readOnly: true === control.columnSource[column].readOnly
Component.onCompleted: { Component.onCompleted: {
forceActiveFocus() forceActiveFocus()
selectAll() selectAll()
@ -107,7 +142,7 @@ Rectangle {
TextArea.flickable: FluMultilineTextBox { TextArea.flickable: FluMultilineTextBox {
id:text_box id:text_box
text: String(display) text: String(display)
readOnly: true === d.columns_data[column].readOnly readOnly: true === control.columnSource[column].readOnly
verticalAlignment: TextInput.AlignVCenter verticalAlignment: TextInput.AlignVCenter
isCtrlEnterForNewline: true isCtrlEnterForNewline: true
Component.onCompleted: { Component.onCompleted: {
@ -190,14 +225,42 @@ Rectangle {
id:com_table_delegate id:com_table_delegate
MouseArea{ MouseArea{
id:item_table_mouse id:item_table_mouse
property var rowObject : control.getRow(row) property var _model: model
property var itemModel: model property bool isMainTable: TableView.view == table_view
property bool editVisible: { property var currentTableView: TableView.view
if(rowObject && d.editPosition && d.editPosition._key === rowObject._key && d.editPosition.column === column){ property bool isHide: {
if(isMainTable && columnModel.frozen){
return true
}
if(!isMainTable){
if(currentTableView.dataIndex !== columnModel.dataIndex)
return true return true
} }
return false return false
} }
property bool isRowSelected: {
if(!rowModel)
return false
if(d.current){
return rowModel._key === d.current._key
}
return false
}
property bool editVisible: {
if(!rowModel)
return false
if(d.editPosition && d.editPosition._key === rowModel._key && d.editPosition.column === column){
return true
}
return false
}
implicitWidth: isHide ? Number.MIN_VALUE : TableView.view.width
visible: !isHide
TableView.onPooled: {
if(d.editPosition && d.editPosition.row === row && d.editPosition.column === column){
control.closeEditor()
}
}
hoverEnabled: true hoverEnabled: true
onEntered: { onEntered: {
d.rowHoverIndex = row d.rowHoverIndex = row
@ -206,25 +269,37 @@ Rectangle {
if(editVisible){ if(editVisible){
updateEditPosition() updateEditPosition()
} }
if(isMainTable){
updateTableItem()
}
} }
onHeightChanged: { onHeightChanged: {
if(editVisible){ if(editVisible){
updateEditPosition() updateEditPosition()
} }
if(isMainTable){
updateTableItem()
}
} }
onXChanged: { onXChanged: {
if(editVisible){ if(editVisible){
updateEditPosition() updateEditPosition()
} }
if(isMainTable){
updateTableItem()
}
} }
onYChanged: { onYChanged: {
if(editVisible){ if(editVisible){
updateEditPosition() updateEditPosition()
} }
if(isMainTable){
updateTableItem()
}
} }
function updateEditPosition(){ function updateEditPosition(){
var obj = {} var obj = {}
obj._key = rowObject._key obj._key = rowModel._key
obj.column = column obj.column = column
obj.row = row obj.row = row
obj.x = item_table_mouse.x obj.x = item_table_mouse.x
@ -233,26 +308,22 @@ Rectangle {
obj.height = item_table_mouse.height - 2 obj.height = item_table_mouse.height - 2
d.editPosition = obj d.editPosition = obj
} }
function updateTableItem(){
var columnModel = control.columnSource[column]
columnModel.x = item_table_mouse.x
columnModel.y = item_table_mouse.y
d.tableItemLayout(column)
}
Rectangle{ Rectangle{
id:item_table
anchors.fill: parent anchors.fill: parent
property point position: Qt.point(column,row)
property bool isRowSelected: {
if(rowObject === null)
return false
if(d.current){
return rowObject._key === d.current._key
}
return false
}
color:{ color:{
if(item_table.isRowSelected){ if(item_table_mouse.isRowSelected){
return control.selectedColor return control.selectedColor
} }
if(d.rowHoverIndex === row || item_table.isRowSelected){ if(d.rowHoverIndex === row || item_table_mouse.isRowSelected){
return FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) return FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
} }
return (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.015) : Qt.rgba(0,0,0,0.015)) return (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03))
} }
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
@ -265,25 +336,28 @@ Rectangle {
onReleased: { onReleased: {
} }
onDoubleClicked:{ onDoubleClicked:{
if(typeof(display) == "object"){ if(item_table_loader.isObject){
return return
} }
loader_edit.display = item_table_loader.display
d.editDelegate = d.getEditDelegate(column) d.editDelegate = d.getEditDelegate(column)
updateEditPosition() item_table_mouse.updateEditPosition()
loader_edit.display = display
} }
onClicked: onClicked:
(event)=>{ (event)=>{
d.current = rowObject d.current = rowModel
control.closeEditor() control.closeEditor()
event.accepted = true event.accepted = true
} }
} }
FluLoader{ FluLoader{
property var model: itemModel id: item_table_loader
property var display: itemModel.display property var model: item_table_mouse._model
property int row: item_table.position.y property var display: rowModel[columnModel.dataIndex]
property int column: item_table.position.x property var rowModel : model.rowModel
property var columnModel : model.columnModel
property int row : model.row
property int column: model.column
property bool isObject: typeof(display) == "object" property bool isObject: typeof(display) == "object"
property var options: { property var options: {
if(isObject){ if(isObject){
@ -293,15 +367,53 @@ Rectangle {
} }
anchors.fill: parent anchors.fill: parent
sourceComponent: { sourceComponent: {
if(item_table_mouse.visible){
if(isObject){ if(isObject){
return display.comId return display.comId
} }
return com_text return com_text
} }
return undefined
}
}
FluLoader{
id: loader_edit
property var tableView: control
property var display
property int column: {
if(d.editPosition){
return d.editPosition.column
}
return 0
}
property int row: {
if(d.editPosition){
return d.editPosition.row
}
return 0
}
anchors{
fill: parent
margins: 1
}
signal editTextChaged(string text)
sourceComponent: {
if(item_table_mouse.visible && d.editPosition && d.editPosition.column === model.column && d.editPosition.row === model.row){
return d.editDelegate
}
return undefined
}
onEditTextChaged:
(text)=>{
var obj = control.getRow(row)
obj[control.columnSource[column].dataIndex] = text
control.setRow(row,obj)
}
z:999
} }
Item{ Item{
anchors.fill: parent anchors.fill: parent
visible: item_table.isRowSelected visible: item_table_mouse.isRowSelected
Rectangle{ Rectangle{
width: 1 width: 1
height: parent.height height: parent.height
@ -332,6 +444,11 @@ Rectangle {
} }
} }
} }
onWidthChanged:{
table_view.forceLayout()
}
MouseArea{ MouseArea{
id:layout_mouse_table id:layout_mouse_table
hoverEnabled: true hoverEnabled: true
@ -353,30 +470,8 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
ScrollBar.horizontal:scroll_bar_h ScrollBar.horizontal:scroll_bar_h
ScrollBar.vertical:scroll_bar_v ScrollBar.vertical:scroll_bar_v
columnWidthProvider: function(column) { columnWidthProvider: control.columnWidthProvider
var columnObject = d.columns_data[column] rowHeightProvider: control.rowHeightProvider
var width = columnObject.width
if(width){
return width
}
var minimumWidth = columnObject.minimumWidth
if(minimumWidth){
return minimumWidth
}
return d.defaultItemWidth
}
rowHeightProvider: function(row) {
var rowObject = control.getRow(row)
var height = rowObject.height
if(height){
return height
}
var minimumHeight = rowObject._minimumHeight
if(minimumHeight){
return minimumHeight
}
return d.defaultItemHeight
}
model: table_sort_model model: table_sort_model
clip: true clip: true
onRowsChanged: { onRowsChanged: {
@ -384,70 +479,51 @@ Rectangle {
table_view.flick(0,1) table_view.flick(0,1)
} }
delegate: com_table_delegate delegate: com_table_delegate
FluLoader{
id:loader_edit
property var tableView: control
property var display
property int column: {
if(d.editPosition){
return d.editPosition.column
}
return 0
}
property int row: {
if(d.editPosition){
return d.editPosition.row
}
return 0
}
signal editTextChaged(string text)
sourceComponent: d.editPosition ? d.editDelegate : undefined
onEditTextChaged:
(text)=>{
var obj = control.getRow(row)
obj[d.columns_data[column].dataIndex] = text
control.setRow(row,obj)
}
width: {
if(d.editPosition){
return d.editPosition.width
}
return 0
}
height: {
if(d.editPosition){
return d.editPosition.height
}
return 0
}
x:{
if(d.editPosition){
return d.editPosition.x
}
return 0
}
y:{
if(d.editPosition){
return d.editPosition.y
}
return 0
}
z:999
}
} }
} }
Component{ Component{
id: com_column_header_delegate id: com_column_header_delegate
Rectangle{ Rectangle{
id: column_item_control id: column_item_control
property var currentTableView : TableView.view
readonly property real cellPadding: 8 readonly property real cellPadding: 8
property bool canceled: false property bool canceled: false
property int columnIndex: column property var _model: model
readonly property var columnObject : d.columns_data[column] readonly property var columnModel : control.columnSource[_index]
readonly property int _index : {
const isDataIndex = (element) => {
return element.dataIndex === display.dataIndex
}
return control.columnSource.findIndex(isDataIndex)
}
readonly property bool isHeaderHorizontal: TableView.view == header_horizontal
readonly property bool isHide: {
if(isHeaderHorizontal){
return false
}
if(!isHeaderHorizontal){
if(currentTableView.dataIndex !== columnModel.dataIndex)
return true
}
return false
}
visible: !isHide
implicitWidth: { implicitWidth: {
if(isHide){
return Number.MIN_VALUE
}
if(column_item_control.isHeaderHorizontal){
return (item_column_loader.item && item_column_loader.item.implicitWidth) + (cellPadding * 2) return (item_column_loader.item && item_column_loader.item.implicitWidth) + (cellPadding * 2)
} }
implicitHeight: Math.max(36, (item_column_loader.item&&item_column_loader.item.implicitHeight) + (cellPadding * 2)) return Math.max(TableView.view.width,Number.MIN_VALUE)
}
implicitHeight: {
if(column_item_control.isHeaderHorizontal){
return Math.max(36, (item_column_loader.item&&item_column_loader.item.implicitHeight) + (cellPadding * 2))
}
return Math.max(TableView.view.height,Number.MIN_VALUE)
}
color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1) color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
Rectangle{ Rectangle{
border.color: control.borderColor border.color: control.borderColor
@ -468,7 +544,7 @@ Rectangle {
width: 1 width: 1
height: parent.height height: parent.height
anchors.left: parent.left anchors.left: parent.left
visible: column !== 0 visible: column_item_control._index !== 0
color:"#00000000" color:"#00000000"
} }
Rectangle{ Rectangle{
@ -477,7 +553,7 @@ Rectangle {
height: parent.height height: parent.height
anchors.right: parent.right anchors.right: parent.right
color:"#00000000" color:"#00000000"
visible: column === table_view.columns - 1 visible: column_item_control._index === table_view.columns - 1
} }
MouseArea{ MouseArea{
id:column_item_control_mouse id:column_item_control_mouse
@ -499,22 +575,23 @@ Rectangle {
} }
FluLoader{ FluLoader{
id:item_column_loader id:item_column_loader
property var itemModel: model property var model: column_item_control._model
property var modelData: model.display property var display: model.display.title
property var tableView: table_view property var tableView: table_view
property var tableModel: table_model property var sourceModel: control.sourceModel
property bool isObject: typeof(display) == "object"
property var options:{ property var options:{
if(typeof(modelData) == "object"){ if(isObject){
return modelData.options return display.options
} }
return {} return {}
} }
property int column: column_item_control.columnIndex property int column: column_item_control._index
width: parent.width width: parent.width
height: parent.height height: parent.height
sourceComponent: { sourceComponent: {
if(typeof(modelData) == "object"){ if(isObject){
return modelData.comId return display.comId
} }
return com_column_text return com_column_text
} }
@ -526,7 +603,7 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
hoverEnabled: true hoverEnabled: true
visible: !(columnObject.width === columnObject.minimumWidth && columnObject.width === columnObject.maximumWidth && columnObject.width) visible: !columnModel.frozen && !(columnModel.width === columnModel.minimumWidth && columnModel.width === columnModel.maximumWidth && columnModel.width)
cursorShape: Qt.SplitHCursor cursorShape: Qt.SplitHCursor
preventStealing: true preventStealing: true
onPressed : onPressed :
@ -546,9 +623,9 @@ Rectangle {
return return
} }
var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y) var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y)
var minimumWidth = columnObject.minimumWidth var minimumWidth = columnModel.minimumWidth
var maximumWidth = columnObject.maximumWidth var maximumWidth = columnModel.maximumWidth
var w = columnObject.width var w = columnModel.width
if(!w){ if(!w){
w = d.defaultItemWidth w = d.defaultItemWidth
} }
@ -558,7 +635,7 @@ Rectangle {
if(!maximumWidth){ if(!maximumWidth){
maximumWidth = 65535 maximumWidth = 65535
} }
columnObject.width = Math.min(Math.max(minimumWidth, w + delta.x),maximumWidth) columnModel.width = Math.min(Math.max(minimumWidth, w + delta.x),maximumWidth)
table_view.forceLayout() table_view.forceLayout()
header_horizontal.forceLayout() header_horizontal.forceLayout()
} }
@ -571,7 +648,7 @@ Rectangle {
id:item_control id:item_control
readonly property real cellPadding: 8 readonly property real cellPadding: 8
property bool canceled: false property bool canceled: false
property var rowObject: control.getRow(row) property var rowModel: control.getRow(row)
implicitWidth: Math.max(30, row_text.implicitWidth + (cellPadding * 2)) implicitWidth: Math.max(30, row_text.implicitWidth + (cellPadding * 2))
implicitHeight: row_text.implicitHeight + (cellPadding * 2) implicitHeight: row_text.implicitHeight + (cellPadding * 2)
color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1) color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
@ -637,9 +714,9 @@ Rectangle {
cursorShape: Qt.SplitVCursor cursorShape: Qt.SplitVCursor
preventStealing: true preventStealing: true
visible: { visible: {
if(rowObject === null) if(rowModel === null)
return false return false
return !(rowObject.height === rowObject._minimumHeight && rowObject.height === rowObject._maximumHeight && rowObject.height) return !(rowModel.height === rowModel._minimumHeight && rowModel.height === rowModel._maximumHeight && rowModel.height)
} }
onPressed : onPressed :
(mouse)=>{ (mouse)=>{
@ -657,11 +734,11 @@ Rectangle {
if(!pressed){ if(!pressed){
return return
} }
var rowObject = control.getRow(row) var rowModel = control.getRow(row)
var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y) var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y)
var minimumHeight = rowObject._minimumHeight var minimumHeight = rowModel._minimumHeight
var maximumHeight = rowObject._maximumHeight var maximumHeight = rowModel._maximumHeight
var h = rowObject.height var h = rowModel.height
if(!h){ if(!h){
h = d.defaultItemHeight h = d.defaultItemHeight
} }
@ -671,8 +748,8 @@ Rectangle {
if(!maximumHeight){ if(!maximumHeight){
maximumHeight = 65535 maximumHeight = 65535
} }
rowObject.height = Math.min(Math.max(minimumHeight, h + delta.y),maximumHeight) rowModel.height = Math.min(Math.max(minimumHeight, h + delta.y),maximumHeight)
control.setRow(row,rowObject) control.setRow(row,rowModel)
table_view.forceLayout() table_view.forceLayout()
} }
} }
@ -682,7 +759,7 @@ Rectangle {
id:com_column_text id:com_column_text
FluText { FluText {
id: column_text id: column_text
text: modelData text: String(display)
anchors.fill: parent anchors.fill: parent
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@ -772,9 +849,9 @@ Rectangle {
timer_vertical_force_layout.restart() timer_vertical_force_layout.restart()
} }
Connections{ Connections{
target: table_model target: table_view
function onRowCountChanged(){ function onRowsChanged(){
header_row_model.rows = Array.from({length: table_model.rows.length}, (_, i) => ({rowIndex:i+1})) header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
} }
} }
Timer{ Timer{
@ -785,6 +862,138 @@ Rectangle {
} }
} }
} }
Item{
anchors{
left: header_vertical.right
top: parent.top
bottom: parent.bottom
right: parent.right
}
Component{
id: com_table_frozen
Rectangle{
id: item_layout_frozen
anchors.fill: parent
color: {
if(Window.active){
return FluTheme.dark ? Qt.rgba(48/255,48/255,48/255,1) :Qt.rgba(1,1,1,1)
}
return FluTheme.dark ? Qt.rgba(56/255,56/255,56/255,1) :Qt.rgba(243/255,243/255,243/255,1)
}
visible: table_view.rows !== 0
Rectangle{
z:99
anchors.fill: parent
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,0.6) : Qt.rgba(191/255,191/255,191/255,0.3)
FluShadow{
radius: 0
anchors.fill: parent
}
color: "#00000000"
}
TableView{
property string dataIndex: columnModel.dataIndex
id: item_table_frozen
interactive: false
clip: true
anchors{
left: parent.left
right: parent.right
}
contentWidth: width
height: table_view.height
y: header_horizontal.height
boundsBehavior: TableView.StopAtBounds
model: table_view.model
delegate: table_view.delegate
syncDirection: Qt.Vertical
syncView: table_view
}
TableView {
property string dataIndex: columnModel.dataIndex
id:item_table_frozen_header
model: header_column_model
boundsBehavior: Flickable.StopAtBounds
interactive: false
clip: true
contentWidth: width
anchors{
left: parent.left
right: parent.right
top: parent.top
bottom: item_table_frozen.top
}
delegate: com_column_header_delegate
Component.onCompleted: {
item_table_frozen_header.forceLayout()
}
}
Connections{
target: table_view
function onWidthChanged() {
item_table_frozen_header.forceLayout()
}
}
}
}
Repeater{
Component.onCompleted: {
model = control.columnSource
}
delegate: FluLoader{
id: item_layout_frozen
readonly property int _index : model.index
readonly property var columnModel : control.columnSource[_index]
readonly property bool isHide:{
if(columnModel.frozen){
return false
}
return true
}
Connections{
target: d
function onTableItemLayout(column){
if(item_layout_frozen._index === column){
updateLayout()
}
}
}
Connections{
target: table_view
function onContentXChanged(){
updateLayout()
}
}
function updateLayout(){
width = table_view.columnWidthProvider(_index)
x = Qt.binding(function(){
var minX = 0
var maxX = table_view.width-width
for(var i=0;i<_index;i++){
var item = control.columnSource[i]
if(item.frozen){
minX = minX + table_view.columnWidthProvider(i)
}
}
for(i=_index+1;i<control.columnSource.length;i++){
item = control.columnSource[i]
if(item.frozen){
maxX = maxX - table_view.columnWidthProvider(i)
}
}
return Math.min(Math.max(columnModel.x - table_view.contentX,minX),maxX)}
)
}
Component.onCompleted: {
updateLayout()
}
height: control.height
visible: !item_layout_frozen.isHide
sourceComponent: item_layout_frozen.isHide ? undefined : com_table_frozen
}
}
}
FluScrollBar { FluScrollBar {
id: scroll_bar_h id: scroll_bar_h
anchors{ anchors{
@ -831,7 +1040,7 @@ Rectangle {
function sort(callback=undefined){ function sort(callback=undefined){
if(callback){ if(callback){
table_sort_model.setComparator(function(left,right){ table_sort_model.setComparator(function(left,right){
return callback(table_model.getRow(left),table_model.getRow(right)) return callback(sourceModel.getRow(left),sourceModel.getRow(right))
}) })
}else{ }else{
table_sort_model.setComparator(undefined) table_sort_model.setComparator(undefined)
@ -840,7 +1049,7 @@ Rectangle {
function filter(callback=undefined){ function filter(callback=undefined){
if(callback){ if(callback){
table_sort_model.setFilter(function(index){ table_sort_model.setFilter(function(index){
return callback(table_model.getRow(index)) return callback(sourceModel.getRow(index))
}) })
}else{ }else{
table_sort_model.setFilter(undefined) table_sort_model.setFilter(undefined)
@ -862,7 +1071,26 @@ Rectangle {
table_view.model.removeRow(rowIndex,rows) table_view.model.removeRow(rowIndex,rows)
} }
} }
function insertRow(rowIndex,obj){
if(rowIndex>=0 && rowIndex<table_view.rows){
sourceModel.insertRow(rowIndex,obj)
}
}
function currentIndex(){
var index = -1
if(!d.current){
return index
}
for (var i = 0; i <= sourceModel.rowCount-1; i++) {
var sourceItem = sourceModel.getRow(i);
if(sourceItem._key === d.current._key){
index = i
break
}
}
return index
}
function appendRow(obj){ function appendRow(obj){
table_model.appendRow(obj) sourceModel.appendRow(obj)
} }
} }

View File

@ -23,16 +23,27 @@ FluControlBackground{
GradientStop { position: 1 - d.offsetSize/control.height; color: d.startColor } GradientStop { position: 1 - d.offsetSize/control.height; color: d.startColor }
GradientStop { position: 1.0; color: d.endColor } GradientStop { position: 1.0; color: d.endColor }
} }
bottomMargin: inputItem && inputItem.activeFocus ? 2 : 1 bottomMargin: 1
QtObject{ QtObject{
id:d id:d
property int offsetSize : inputItem && inputItem.activeFocus ? 2 : 3 property int offsetSize : 3
property color startColor : FluTheme.dark ? Qt.rgba(66/255,66/255,66/255,1) : Qt.rgba(232/255,232/255,232/255,1) property color startColor : FluTheme.dark ? Qt.rgba(66/255,66/255,66/255,1) : Qt.rgba(232/255,232/255,232/255,1)
property color endColor: { property color endColor: {
if(!control.enabled){ if(!control.enabled){
return d.startColor return d.startColor
} }
return inputItem && inputItem.activeFocus ? FluTheme.primaryColor : FluTheme.dark ? Qt.rgba(123/255,123/255,123/255,1) : Qt.rgba(132/255,132/255,132/255,1) return FluTheme.dark ? Qt.rgba(123/255,123/255,123/255,1) : Qt.rgba(132/255,132/255,132/255,1)
}
}
FluClip{
anchors.fill: parent
radius: [control.radius,control.radius,control.radius,control.radius]
visible: inputItem && inputItem.activeFocus
Rectangle{
width: parent.width
height: 2
anchors.bottom: parent.bottom
color: FluTheme.primaryColor
} }
} }
} }

View File

@ -111,8 +111,6 @@ FluButton {
} }
Menu{ Menu{
id:popup id:popup
width: container.width
height: container.height
modal: true modal: true
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
@ -132,19 +130,18 @@ FluButton {
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
background:Item{ background:Rectangle{
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 4 radius: 5
} }
} }
contentItem: Item{ contentItem: Item{
clip: true
Rectangle{
id:container id:container
height: 340 implicitHeight: 340
width: 300 implicitWidth: 300
radius: 4
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
} }
@ -152,7 +149,7 @@ FluButton {
id:layout_content id:layout_content
spacing: 0 spacing: 0
width: parent.width width: parent.width
height: 300 height: 280
Component{ Component{
id:list_delegate id:list_delegate
Item{ Item{
@ -179,7 +176,7 @@ FluButton {
if(item_mouse.containsMouse){ if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
} }
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0) return Qt.rgba(0,0,0,0)
} }
radius: 3 radius: 3
MouseArea{ MouseArea{
@ -219,8 +216,9 @@ FluButton {
} }
ListView{ ListView{
id:list_view_1 id:list_view_1
width: isH ? 100 : 150 Layout.preferredWidth: isH ? 100 : 150
height: parent.height Layout.preferredHeight: parent.height-2
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds boundsBehavior:Flickable.StopAtBounds
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0 preferredHighlightBegin: 0
@ -236,14 +234,15 @@ FluButton {
} }
} }
Rectangle{ Rectangle{
width: 1 Layout.preferredWidth: 1
height: parent.height Layout.preferredHeight: parent.height
color: control.dividerColor color: control.dividerColor
} }
ListView{ ListView{
id:list_view_2 id:list_view_2
width: isH ? 100 : 150 Layout.preferredWidth: isH ? 99 : 150
height: parent.height Layout.preferredHeight: parent.height-2
Layout.alignment: Qt.AlignVCenter
model: generateArray(0,59) model: generateArray(0,59)
clip: true clip: true
preferredHighlightBegin: 0 preferredHighlightBegin: 0
@ -266,8 +265,8 @@ FluButton {
} }
ListView{ ListView{
id:list_view_3 id:list_view_3
width: 100 Layout.preferredWidth: 100
height: 76 Layout.preferredHeight: 76
model: [control.amText,control.pmText] model: [control.amText,control.pmText]
clip: true clip: true
visible: isH visible: isH
@ -285,17 +284,12 @@ FluButton {
} }
} }
} }
Rectangle{
width: parent.width
height: 1
anchors.top: layout_content.bottom
color: control.dividerColor
}
Rectangle{ Rectangle{
id:layout_actions id:layout_actions
height: 40 height: 60
radius: 5
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 5
anchors{ anchors{
bottom:parent.bottom bottom:parent.bottom
left: parent.left left: parent.left
@ -353,7 +347,6 @@ FluButton {
} }
} }
} }
}
y:35 y:35
function showPopup() { function showPopup() {
d.changeFlag = true d.changeFlag = true
@ -387,7 +380,7 @@ FluButton {
} }
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height-1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {

View File

@ -17,12 +17,19 @@ Rectangle {
property color selectedBorderColor: FluTheme.primaryColor property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3) property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
readonly property alias current: d.current readonly property alias current: d.current
property alias view: table_view
id:control id:control
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) color: {
if(Window.active){
return FluTheme.frameActiveColor
}
return FluTheme.frameColor
}
onDataSourceChanged: { onDataSourceChanged: {
tree_model.setDataSource(dataSource) tree_model.setDataSource(dataSource)
} }
onColumnSourceChanged: { onColumnSourceChanged: {
if(columnSource.length !== 0){
var columns= [] var columns= []
var headerRow = {} var headerRow = {}
columnSource.forEach(function(item){ columnSource.forEach(function(item){
@ -34,10 +41,14 @@ Rectangle {
header_column_model.columns = columns header_column_model.columns = columns
header_column_model.rows = [headerRow] header_column_model.rows = [headerRow]
} }
}
FluTreeModel{ FluTreeModel{
id:tree_model id:tree_model
columnSource: control.columnSource columnSource: control.columnSource
} }
Component.onDestruction: {
table_view.contentY = 0
}
onDepthPaddingChanged: { onDepthPaddingChanged: {
table_view.forceLayout() table_view.forceLayout()
} }
@ -710,9 +721,6 @@ Rectangle {
} }
} }
} }
function selectionModel(){
return tree_model.selectionModel
}
function count(){ function count(){
return tree_model.dataSourceSize return tree_model.dataSourceSize
} }
@ -741,4 +749,7 @@ Rectangle {
d.editPosition = undefined d.editPosition = undefined
d.editDelegate = undefined d.editDelegate = undefined
} }
function selectionModel(){
return tree_model.selectionModel()
}
} }

View File

@ -60,8 +60,9 @@ Window {
signal lazyLoad() signal lazyLoad()
property var _windowRegister property var _windowRegister
property string _route property string _route
property bool _hideShadow: false
id: window id: window
color:"transparent" color: FluTools.isSoftware() ? window.backgroundColor : "transparent"
Component.onCompleted: { Component.onCompleted: {
FluRouter.addWindow(window) FluRouter.addWindow(window)
useSystemAppBar = FluApp.useSystemAppBar useSystemAppBar = FluApp.useSystemAppBar
@ -118,13 +119,24 @@ Window {
id:img_back id:img_back
visible: false visible: false
cache: false cache: false
fillMode: Image.PreserveAspectCrop
asynchronous: true
Component.onCompleted: { Component.onCompleted: {
var geometry = FluTools.desktopAvailableGeometry(window) img_back.updateLayout()
width = geometry.width
height = geometry.height
sourceSize = Qt.size(width,height)
source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath) source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath)
} }
Connections{
target: window
function onScreenChanged(){
img_back.updateLayout()
}
}
function updateLayout(){
var geometry = FluTools.desktopAvailableGeometry(window)
img_back.width = geometry.width
img_back.height = geometry.height
img_back.sourceSize = Qt.size(img_back.width,img_back.height)
}
Connections{ Connections{
target: FluTheme target: FluTheme
function onDesktopImagePathChanged(){ function onDesktopImagePathChanged(){
@ -140,7 +152,7 @@ Window {
} }
Timer{ Timer{
id:timer_update_image id:timer_update_image
interval: 500 interval: 150
onTriggered: { onTriggered: {
img_back.source = "" img_back.source = ""
img_back.source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath) img_back.source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath)
@ -154,7 +166,7 @@ Window {
blurRadius: 64 blurRadius: 64
visible: window.active && FluTheme.blurBehindWindowEnabled visible: window.active && FluTheme.blurBehindWindowEnabled
tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1) tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
targetRect: Qt.rect(window.x,window.y,window.width,window.height) targetRect: Qt.rect(window.x-window.screen.virtualX,window.y-window.screen.virtualY,window.width,window.height)
} }
} }
} }
@ -277,13 +289,7 @@ Window {
id:loader_border id:loader_border
anchors.fill: parent anchors.fill: parent
sourceComponent: { sourceComponent: {
if(window.useSystemAppBar){ if(window.useSystemAppBar || FluTools.isWin() || window.visibility === Window.Maximized || window.visibility === Window.FullScreen){
return undefined
}
if(FluTools.isWindows10OrGreater()){
return undefined
}
if(window.visibility === Window.Maximized || window.visibility === Window.FullScreen){
return undefined return undefined
} }
return com_border return com_border
@ -293,19 +299,21 @@ Window {
loader_loading.sourceComponent = undefined loader_loading.sourceComponent = undefined
} }
function showSuccess(text,duration,moremsg){ function showSuccess(text,duration,moremsg){
info_bar.showSuccess(text,duration,moremsg) return info_bar.showSuccess(text,duration,moremsg)
} }
function showInfo(text,duration,moremsg){ function showInfo(text,duration,moremsg){
info_bar.showInfo(text,duration,moremsg) return info_bar.showInfo(text,duration,moremsg)
} }
function showWarning(text,duration,moremsg){ function showWarning(text,duration,moremsg){
info_bar.showWarning(text,duration,moremsg) return info_bar.showWarning(text,duration,moremsg)
} }
function showError(text,duration,moremsg){ function showError(text,duration,moremsg){
info_bar.showError(text,duration,moremsg) return info_bar.showError(text,duration,moremsg)
}
function clearAllInfo(){
return info_bar.clearAllInfo()
} }
function moveWindowToDesktopCenter(){ function moveWindowToDesktopCenter(){
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
var availableGeometry = FluTools.desktopAvailableGeometry(window) var availableGeometry = FluTools.desktopAvailableGeometry(window)
window.setGeometry((availableGeometry.width-window.width)/2+Screen.virtualX,(availableGeometry.height-window.height)/2+Screen.virtualY,window.width,window.height) window.setGeometry((availableGeometry.width-window.width)/2+Screen.virtualX,(availableGeometry.height-window.height)/2+Screen.virtualY,window.width,window.height)
} }
@ -328,6 +336,12 @@ Window {
function showMaximized(){ function showMaximized(){
frameless.showMaximized() frameless.showMaximized()
} }
function showMinimized(){
frameless.showMinimized()
}
function showNormal(){
frameless.showNormal()
}
function showLoading(text = "",cancel = true){ function showLoading(text = "",cancel = true){
if(text===""){ if(text===""){
text = qsTr("Loading...") text = qsTr("Loading...")
@ -339,4 +353,7 @@ Window {
function setHitTestVisible(val){ function setHitTestVisible(val){
frameless.setHitTestVisible(val) frameless.setHitTestVisible(val)
} }
function deleteLater(){
FluTools.deleteLater(window)
}
} }

View File

@ -32,9 +32,9 @@ FluWindow {
} }
} }
} }
function showDialog(){ function showDialog(offsetX=0,offsetY=0){
var x = transientParent.x + (transientParent.width - width)/2 var x = transientParent.x + (transientParent.width - width)/2 + offsetX
var y = transientParent.y + (transientParent.height - height)/2 var y = transientParent.y + (transientParent.height - height)/2 + offsetY
control.stayTop = Qt.binding(function(){return transientParent.stayTop}) control.stayTop = Qt.binding(function(){return transientParent.stayTop})
control.setGeometry(x,y,width,height) control.setGeometry(x,y,width,height)
control.visibility = Window.Windowed control.visibility = Window.Windowed

View File

@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only. // It is used for QML tooling purposes only.
// //
// This file was auto-generated by: // This file was auto-generated by:
// 'qmlplugindump -nonrelocatable FluentUI 1.0 D:\QtProjects\build-FluentUI-Desktop_Qt_5_15_2_MSVC2019_64bit-Release\src' // 'qmlplugindump -nonrelocatable FluentUI 1.0 D:/QtProjects/build-FluentUI-Desktop_Qt_5_15_2_MSVC2019_64bit-Release/src'
Module { Module {
dependencies: ["QtQuick 2.0"] dependencies: ["QtQuick 2.0"]
@ -25,19 +25,28 @@ Module {
name: "FluApp" name: "FluApp"
prototype: "QObject" prototype: "QObject"
exports: ["FluentUI/FluApp 1.0"] exports: ["FluentUI/FluApp 1.0"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Property { name: "useSystemAppBar"; type: "bool" } Property { name: "useSystemAppBar"; type: "bool" }
Property { name: "windowIcon"; type: "string" } Property { name: "windowIcon"; type: "string" }
Property { name: "locale"; type: "QLocale" } Property { name: "locale"; type: "QLocale" }
Property { name: "launcher"; type: "QObject"; isPointer: true }
Method { Method {
name: "init" name: "init"
Parameter { name: "target"; type: "QObject"; isPointer: true } Parameter { name: "launcher"; type: "QObject"; isPointer: true }
Parameter { name: "locale"; type: "QLocale" } Parameter { name: "locale"; type: "QLocale" }
} }
Method { Method {
name: "init" name: "init"
Parameter { name: "target"; type: "QObject"; isPointer: true } Parameter { name: "launcher"; type: "QObject"; isPointer: true }
} }
Method {
name: "iconData"
type: "QJsonArray"
Parameter { name: "keyword"; type: "string" }
}
Method { name: "iconData"; type: "QJsonArray" }
} }
Component { Component {
name: "FluCalendarViewType" name: "FluCalendarViewType"
@ -72,6 +81,8 @@ Module {
name: "FluColors" name: "FluColors"
prototype: "QObject" prototype: "QObject"
exports: ["FluentUI/FluColors 1.0"] exports: ["FluentUI/FluColors 1.0"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Property { name: "Transparent"; type: "QColor" } Property { name: "Transparent"; type: "QColor" }
Property { name: "Black"; type: "QColor" } Property { name: "Black"; type: "QColor" }
@ -133,10 +144,10 @@ Module {
exports: ["FluentUI/FluFrameless 1.0"] exports: ["FluentUI/FluFrameless 1.0"]
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Property { name: "appbar"; type: "QQuickItem"; isPointer: true } Property { name: "appbar"; type: "QQuickItem"; isPointer: true }
Property { name: "topmost"; type: "bool" }
Property { name: "maximizeButton"; type: "QQuickItem"; isPointer: true } Property { name: "maximizeButton"; type: "QQuickItem"; isPointer: true }
Property { name: "minimizedButton"; type: "QQuickItem"; isPointer: true } Property { name: "minimizedButton"; type: "QQuickItem"; isPointer: true }
Property { name: "closeButton"; type: "QQuickItem"; isPointer: true } Property { name: "closeButton"; type: "QQuickItem"; isPointer: true }
Property { name: "topmost"; type: "bool" }
Property { name: "disabled"; type: "bool" } Property { name: "disabled"; type: "bool" }
Property { name: "fixSize"; type: "bool" } Property { name: "fixSize"; type: "bool" }
Method { name: "showFullScreen" } Method { name: "showFullScreen" }
@ -149,6 +160,16 @@ Module {
} }
Method { name: "onDestruction" } Method { name: "onDestruction" }
} }
Component {
name: "FluHotkey"
prototype: "QObject"
exports: ["FluentUI/FluHotkey 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "sequence"; type: "string" }
Property { name: "name"; type: "string" }
Property { name: "isRegistered"; type: "bool"; isReadonly: true }
Signal { name: "activated" }
}
Component { Component {
name: "FluNavigationViewType" name: "FluNavigationViewType"
exports: ["FluentUI/FluNavigationViewType 1.0"] exports: ["FluentUI/FluNavigationViewType 1.0"]
@ -259,11 +280,14 @@ Module {
} }
} }
Component { Component {
name: "FluTableSortProxyModel" name: "FluTableModel"
prototype: "QSortFilterProxyModel" prototype: "QAbstractTableModel"
exports: ["FluentUI/FluTableSortProxyModel 1.0"] exports: ["FluentUI/FluTableModel 1.0"]
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Property { name: "model"; type: "QAbstractTableModel"; isPointer: true } Property { name: "columnSource"; type: "QList<QVariantMap>" }
Property { name: "rows"; type: "QList<QVariantMap>" }
Property { name: "rowCount"; type: "int"; isReadonly: true }
Method { name: "clear" }
Method { Method {
name: "getRow" name: "getRow"
type: "QVariant" type: "QVariant"
@ -272,6 +296,46 @@ Module {
Method { Method {
name: "setRow" name: "setRow"
Parameter { name: "rowIndex"; type: "int" } Parameter { name: "rowIndex"; type: "int" }
Parameter { name: "row"; type: "QVariant" }
}
Method {
name: "insertRow"
Parameter { name: "rowIndex"; type: "int" }
Parameter { name: "row"; type: "QVariant" }
}
Method {
name: "removeRow"
Parameter { name: "rowIndex"; type: "int" }
Parameter { name: "rows"; type: "int" }
}
Method {
name: "removeRow"
Parameter { name: "rowIndex"; type: "int" }
}
Method {
name: "appendRow"
Parameter { name: "row"; type: "QVariant" }
}
}
Component {
name: "FluTableSortProxyModel"
prototype: "QSortFilterProxyModel"
exports: ["FluentUI/FluTableSortProxyModel 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "model"; type: "QVariant" }
Method {
name: "getRow"
type: "QVariant"
Parameter { name: "rowIndex"; type: "int" }
}
Method {
name: "setRow"
Parameter { name: "rowIndex"; type: "int" }
Parameter { name: "val"; type: "QVariant" }
}
Method {
name: "insertRow"
Parameter { name: "rowIndex"; type: "int" }
Parameter { name: "val"; type: "QVariant" } Parameter { name: "val"; type: "QVariant" }
} }
Method { Method {
@ -292,6 +356,8 @@ Module {
name: "FluTextStyle" name: "FluTextStyle"
prototype: "QObject" prototype: "QObject"
exports: ["FluentUI/FluTextStyle 1.0"] exports: ["FluentUI/FluTextStyle 1.0"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Property { name: "family"; type: "string" } Property { name: "family"; type: "string" }
Property { name: "Caption"; type: "QFont" } Property { name: "Caption"; type: "QFont" }
@ -306,6 +372,8 @@ Module {
name: "FluTheme" name: "FluTheme"
prototype: "QObject" prototype: "QObject"
exports: ["FluentUI/FluTheme 1.0"] exports: ["FluentUI/FluTheme 1.0"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Property { name: "dark"; type: "bool"; isReadonly: true } Property { name: "dark"; type: "bool"; isReadonly: true }
Property { name: "accentColor"; type: "FluAccentColor"; isPointer: true } Property { name: "accentColor"; type: "FluAccentColor"; isPointer: true }
@ -318,18 +386,16 @@ Module {
Property { name: "fontSecondaryColor"; type: "QColor" } Property { name: "fontSecondaryColor"; type: "QColor" }
Property { name: "fontTertiaryColor"; type: "QColor" } Property { name: "fontTertiaryColor"; type: "QColor" }
Property { name: "itemNormalColor"; type: "QColor" } Property { name: "itemNormalColor"; type: "QColor" }
Property { name: "frameColor"; type: "QColor" }
Property { name: "frameActiveColor"; type: "QColor" }
Property { name: "itemHoverColor"; type: "QColor" } Property { name: "itemHoverColor"; type: "QColor" }
Property { name: "itemPressColor"; type: "QColor" } Property { name: "itemPressColor"; type: "QColor" }
Property { name: "itemCheckColor"; type: "QColor" } Property { name: "itemCheckColor"; type: "QColor" }
Property { name: "desktopImagePath"; type: "string" }
Property { name: "darkMode"; type: "int" } Property { name: "darkMode"; type: "int" }
Property { name: "nativeText"; type: "bool" } Property { name: "nativeText"; type: "bool" }
Property { name: "animationEnabled"; type: "bool" } Property { name: "animationEnabled"; type: "bool" }
Method { Property { name: "blurBehindWindowEnabled"; type: "bool" }
name: "awesomeList"
type: "QJsonArray"
Parameter { name: "keyword"; type: "string" }
}
Method { name: "awesomeList"; type: "QJsonArray" }
} }
Component { Component {
name: "FluThemeType" name: "FluThemeType"
@ -376,6 +442,8 @@ Module {
name: "FluTools" name: "FluTools"
prototype: "QObject" prototype: "QObject"
exports: ["FluentUI/FluTools 1.0"] exports: ["FluentUI/FluTools 1.0"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Method { name: "qtMajor"; type: "int" } Method { name: "qtMajor"; type: "int" }
Method { name: "qtMinor"; type: "int" } Method { name: "qtMinor"; type: "int" }
@ -480,14 +548,25 @@ Module {
type: "QRect" type: "QRect"
Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
} }
Method { name: "getWallpaperFilePath"; type: "string" }
Method {
name: "imageMainColor"
type: "QColor"
Parameter { name: "image"; type: "QImage" }
Parameter { name: "bright"; type: "double" }
}
Method {
name: "imageMainColor"
type: "QColor"
Parameter { name: "image"; type: "QImage" }
}
} }
Component { Component {
name: "FluTreeModel" name: "FluTreeModel"
prototype: "QAbstractItemModel" prototype: "QAbstractTableModel"
exports: ["FluentUI/FluTreeModel 1.0"] exports: ["FluentUI/FluTreeModel 1.0"]
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Property { name: "dataSourceSize"; type: "int" } Property { name: "dataSourceSize"; type: "int" }
Property { name: "selectionModel"; type: "QList<FluTreeNode*>" }
Property { name: "columnSource"; type: "QList<QVariantMap>" } Property { name: "columnSource"; type: "QList<QVariantMap>" }
Method { Method {
name: "removeRows" name: "removeRows"
@ -504,6 +583,11 @@ Module {
type: "QObject*" type: "QObject*"
Parameter { name: "row"; type: "int" } Parameter { name: "row"; type: "int" }
} }
Method {
name: "setRow"
Parameter { name: "row"; type: "int" }
Parameter { name: "data"; type: "QVariantMap" }
}
Method { Method {
name: "setData" name: "setData"
Parameter { name: "data"; type: "QList<FluTreeNode*>" } Parameter { name: "data"; type: "QList<FluTreeNode*>" }
@ -541,6 +625,7 @@ Module {
} }
Method { name: "allExpand" } Method { name: "allExpand" }
Method { name: "allCollapse" } Method { name: "allCollapse" }
Method { name: "selectionModel"; type: "QVariant" }
} }
Component { Component {
name: "FluTreeViewType" name: "FluTreeViewType"
@ -584,12 +669,12 @@ Module {
} }
} }
Component { Component {
name: "Fluent_Awesome" name: "Fluent_Icons"
exports: ["FluentUI/FluentIcons 1.0"] exports: ["FluentUI/FluentIcons 1.0"]
isCreatable: false isCreatable: false
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Enum { Enum {
name: "Fluent_AwesomeType" name: "Fluent_IconType"
values: { values: {
"GlobalNavButton": 59136, "GlobalNavButton": 59136,
"Wifi": 59137, "Wifi": 59137,
@ -2295,6 +2380,7 @@ Module {
Parameter { name: "selection"; type: "QItemSelection" } Parameter { name: "selection"; type: "QItemSelection" }
} }
} }
Component { name: "QAbstractTableModel"; prototype: "QAbstractItemModel" }
Component { Component {
name: "QSortFilterProxyModel" name: "QSortFilterProxyModel"
prototype: "QAbstractProxyModel" prototype: "QAbstractProxyModel"
@ -2421,37 +2507,37 @@ Module {
Property { name: "darkClickListener"; type: "QVariant" } Property { name: "darkClickListener"; type: "QVariant" }
Property { Property {
name: "buttonStayTop" name: "buttonStayTop"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonMinimize" name: "buttonMinimize"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonMaximize" name: "buttonMaximize"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonClose" name: "buttonClose"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonDark" name: "buttonDark"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "layoutMacosButtons" name: "layoutMacosButtons"
type: "FluLoader_QMLTYPE_12" type: "FluLoader_QMLTYPE_16"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
@ -2472,6 +2558,7 @@ Module {
Property { name: "items"; type: "QVariant" } Property { name: "items"; type: "QVariant" }
Property { name: "emptyText"; type: "string" } Property { name: "emptyText"; type: "string" }
Property { name: "autoSuggestBoxReplacement"; type: "int" } Property { name: "autoSuggestBoxReplacement"; type: "int" }
Property { name: "textRole"; type: "string" }
Property { name: "filter"; type: "QVariant" } Property { name: "filter"; type: "QVariant" }
Signal { Signal {
name: "itemClicked" name: "itemClicked"
@ -2674,6 +2761,7 @@ Module {
Property { name: "normalColor"; type: "QColor" } Property { name: "normalColor"; type: "QColor" }
Property { name: "hoverColor"; type: "QColor" } Property { name: "hoverColor"; type: "QColor" }
Property { name: "disableColor"; type: "QColor" } Property { name: "disableColor"; type: "QColor" }
Property { name: "textBox"; type: "QQuickTextField"; isReadonly: true; isPointer: true }
Signal { Signal {
name: "commit" name: "commit"
Parameter { name: "text"; type: "string" } Parameter { name: "text"; type: "string" }
@ -3022,6 +3110,7 @@ Module {
Parameter { name: "itemcomponent"; type: "QVariant" } Parameter { name: "itemcomponent"; type: "QVariant" }
Parameter { name: "duration"; type: "QVariant" } Parameter { name: "duration"; type: "QVariant" }
} }
Method { name: "clearAllInfo"; type: "QVariant" }
Property { name: "children"; type: "QObject"; isList: true; isReadonly: true } Property { name: "children"; type: "QObject"; isList: true; isReadonly: true }
} }
Component { Component {
@ -3141,15 +3230,15 @@ Module {
defaultProperty: "data" defaultProperty: "data"
Property { name: "logo"; type: "QUrl" } Property { name: "logo"; type: "QUrl" }
Property { name: "title"; type: "string" } Property { name: "title"; type: "string" }
Property { name: "items"; type: "FluObject_QMLTYPE_172"; isPointer: true } Property { name: "items"; type: "FluObject_QMLTYPE_164"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_172"; isPointer: true } Property { name: "footerItems"; type: "FluObject_QMLTYPE_164"; isPointer: true }
Property { name: "displayMode"; type: "int" } Property { name: "displayMode"; type: "int" }
Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true } Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true }
Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true } Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "topPadding"; type: "int" } Property { name: "topPadding"; type: "int" }
Property { name: "pageMode"; type: "int" } Property { name: "pageMode"; type: "int" }
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_42"; isPointer: true } Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_42"; isPointer: true } Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
Property { name: "navCompactWidth"; type: "int" } Property { name: "navCompactWidth"; type: "int" }
Property { name: "navTopMargin"; type: "int" } Property { name: "navTopMargin"; type: "int" }
Property { name: "cellHeight"; type: "int" } Property { name: "cellHeight"; type: "int" }
@ -3157,13 +3246,13 @@ Module {
Property { name: "hideNavAppBar"; type: "bool" } Property { name: "hideNavAppBar"; type: "bool" }
Property { Property {
name: "buttonMenu" name: "buttonMenu"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonBack" name: "buttonBack"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
@ -3225,6 +3314,8 @@ Module {
Property { name: "pageCount"; type: "int" } Property { name: "pageCount"; type: "int" }
Property { name: "__itemPerPage"; type: "int" } Property { name: "__itemPerPage"; type: "int" }
Property { name: "__pageButtonHalf"; type: "int" } Property { name: "__pageButtonHalf"; type: "int" }
Property { name: "header"; type: "QQmlComponent"; isPointer: true }
Property { name: "footer"; type: "QQmlComponent"; isPointer: true }
Signal { Signal {
name: "requestPage" name: "requestPage"
Parameter { name: "page"; type: "int" } Parameter { name: "page"; type: "int" }
@ -3449,14 +3540,18 @@ Module {
Property { name: "textColor"; type: "QColor" } Property { name: "textColor"; type: "QColor" }
} }
Component { Component {
prototype: "QQuickColumnLayout" prototype: "QQuickItem"
name: "FluentUI/FluRadioButtons 1.0" name: "FluentUI/FluRadioButtons 1.0"
exports: ["FluentUI/FluRadioButtons 1.0"] exports: ["FluentUI/FluRadioButtons 1.0"]
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
isComposite: true isComposite: true
defaultProperty: "buttons" defaultProperty: "buttons"
Property { name: "currentIndex"; type: "int" }
Property { name: "buttons"; type: "QObject"; isList: true; isReadonly: true } Property { name: "buttons"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "currentIndex"; type: "int" }
Property { name: "spacing"; type: "int" }
Property { name: "orientation"; type: "int" }
Property { name: "disabled"; type: "bool" }
Property { name: "manuallyDisabled"; type: "bool" }
} }
Component { Component {
prototype: "QQuickRangeSlider" prototype: "QQuickRangeSlider"
@ -3611,6 +3706,9 @@ Module {
Property { name: "positiveText"; type: "string" } Property { name: "positiveText"; type: "string" }
Property { name: "neutralText"; type: "string" } Property { name: "neutralText"; type: "string" }
Property { name: "negativeText"; type: "string" } Property { name: "negativeText"; type: "string" }
Property { name: "registered"; type: "bool" }
Property { name: "errorColor"; type: "QColor" }
Property { name: "syncHotkey"; type: "FluHotkey"; isPointer: true }
Signal { name: "accepted" } Signal { name: "accepted" }
Property { name: "iconSize"; type: "int" } Property { name: "iconSize"; type: "int" }
Property { name: "iconSource"; type: "int" } Property { name: "iconSource"; type: "int" }
@ -3736,6 +3834,7 @@ Module {
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
isComposite: true isComposite: true
defaultProperty: "data" defaultProperty: "data"
Property { name: "sourceModel"; type: "QVariant" }
Property { name: "columnSource"; type: "QVariant" } Property { name: "columnSource"; type: "QVariant" }
Property { name: "dataSource"; type: "QVariant" } Property { name: "dataSource"; type: "QVariant" }
Property { name: "borderColor"; type: "QColor" } Property { name: "borderColor"; type: "QColor" }
@ -3743,10 +3842,12 @@ Module {
Property { name: "verticalHeaderVisible"; type: "bool" } Property { name: "verticalHeaderVisible"; type: "bool" }
Property { name: "selectedBorderColor"; type: "QColor" } Property { name: "selectedBorderColor"; type: "QColor" }
Property { name: "selectedColor"; type: "QColor" } Property { name: "selectedColor"; type: "QColor" }
Property { name: "columnWidthProvider"; type: "QVariant" }
Property { name: "rowHeightProvider"; type: "QVariant" }
Property { name: "rows"; type: "int"; isReadonly: true } Property { name: "rows"; type: "int"; isReadonly: true }
Property { name: "columns"; type: "int"; isReadonly: true } Property { name: "columns"; type: "int"; isReadonly: true }
Property { name: "current"; type: "QVariant"; isReadonly: true } Property { name: "current"; type: "QVariant"; isReadonly: true }
Property { name: "sourceModel"; type: "QQmlTableModel"; isReadonly: true; isPointer: true } Property { name: "view"; type: "QQuickTableView"; isReadonly: true; isPointer: true }
Method { name: "closeEditor"; type: "QVariant" } Method { name: "closeEditor"; type: "QVariant" }
Method { name: "resetPosition"; type: "QVariant" } Method { name: "resetPosition"; type: "QVariant" }
Method { Method {
@ -3782,6 +3883,13 @@ Module {
Parameter { name: "rowIndex"; type: "QVariant" } Parameter { name: "rowIndex"; type: "QVariant" }
Parameter { name: "rows"; type: "QVariant" } Parameter { name: "rows"; type: "QVariant" }
} }
Method {
name: "insertRow"
type: "QVariant"
Parameter { name: "rowIndex"; type: "QVariant" }
Parameter { name: "obj"; type: "QVariant" }
}
Method { name: "currentIndex"; type: "QVariant" }
Method { Method {
name: "appendRow" name: "appendRow"
type: "QVariant" type: "QVariant"
@ -3975,21 +4083,24 @@ Module {
Property { name: "previousText"; type: "string" } Property { name: "previousText"; type: "string" }
} }
Component { Component {
prototype: "QQuickItem" prototype: "QQuickRectangle"
name: "FluentUI/FluTreeView 1.0" name: "FluentUI/FluTreeView 1.0"
exports: ["FluentUI/FluTreeView 1.0"] exports: ["FluentUI/FluTreeView 1.0"]
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
isComposite: true isComposite: true
defaultProperty: "data" defaultProperty: "data"
Property { name: "currentIndex"; type: "int" }
Property { name: "dataSource"; type: "QVariant" } Property { name: "dataSource"; type: "QVariant" }
Property { name: "columnSource"; type: "QVariant" }
Property { name: "showLine"; type: "bool" } Property { name: "showLine"; type: "bool" }
Property { name: "draggable"; type: "bool" }
Property { name: "cellHeight"; type: "int" } Property { name: "cellHeight"; type: "int" }
Property { name: "depthPadding"; type: "int" } Property { name: "depthPadding"; type: "int" }
Property { name: "checkable"; type: "bool" } Property { name: "checkable"; type: "bool" }
Property { name: "lineColor"; type: "QColor" } Property { name: "lineColor"; type: "QColor" }
Method { name: "selectionModel"; type: "QVariant" } Property { name: "borderColor"; type: "QColor" }
Property { name: "selectedBorderColor"; type: "QColor" }
Property { name: "selectedColor"; type: "QColor" }
Property { name: "current"; type: "QVariant"; isReadonly: true }
Property { name: "view"; type: "QQuickTableView"; isReadonly: true; isPointer: true }
Method { name: "count"; type: "QVariant" } Method { name: "count"; type: "QVariant" }
Method { name: "visibleCount"; type: "QVariant" } Method { name: "visibleCount"; type: "QVariant" }
Method { Method {
@ -4004,6 +4115,14 @@ Module {
} }
Method { name: "allExpand"; type: "QVariant" } Method { name: "allExpand"; type: "QVariant" }
Method { name: "allCollapse"; type: "QVariant" } Method { name: "allCollapse"; type: "QVariant" }
Method {
name: "customItem"
type: "QVariant"
Parameter { name: "comId"; type: "QVariant" }
Parameter { name: "options"; type: "QVariant" }
}
Method { name: "closeEditor"; type: "QVariant" }
Method { name: "selectionModel"; type: "QVariant" }
} }
Component { Component {
prototype: "QQuickWindowQmlImpl" prototype: "QQuickWindowQmlImpl"
@ -4037,6 +4156,7 @@ Module {
Property { name: "closeListener"; type: "QVariant" } Property { name: "closeListener"; type: "QVariant" }
Property { name: "_windowRegister"; type: "QVariant" } Property { name: "_windowRegister"; type: "QVariant" }
Property { name: "_route"; type: "string" } Property { name: "_route"; type: "string" }
Property { name: "_hideShadow"; type: "bool" }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
Signal { Signal {
name: "initArgument" name: "initArgument"
@ -4072,6 +4192,7 @@ Module {
Parameter { name: "duration"; type: "QVariant" } Parameter { name: "duration"; type: "QVariant" }
Parameter { name: "moremsg"; type: "QVariant" } Parameter { name: "moremsg"; type: "QVariant" }
} }
Method { name: "clearAllInfo"; type: "QVariant" }
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" } Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
Method { name: "fixWindowSize"; type: "QVariant" } Method { name: "fixWindowSize"; type: "QVariant" }
Method { Method {
@ -4085,6 +4206,8 @@ Module {
Parameter { name: "data"; type: "QVariant" } Parameter { name: "data"; type: "QVariant" }
} }
Method { name: "showMaximized"; type: "QVariant" } Method { name: "showMaximized"; type: "QVariant" }
Method { name: "showMinimized"; type: "QVariant" }
Method { name: "showNormal"; type: "QVariant" }
Method { Method {
name: "showLoading" name: "showLoading"
type: "QVariant" type: "QVariant"
@ -4105,7 +4228,12 @@ Module {
isComposite: true isComposite: true
defaultProperty: "contentData" defaultProperty: "contentData"
Property { name: "contentDelegate"; type: "QQmlComponent"; isPointer: true } Property { name: "contentDelegate"; type: "QQmlComponent"; isPointer: true }
Method { name: "showDialog"; type: "QVariant" } Method {
name: "showDialog"
type: "QVariant"
Parameter { name: "offsetX"; type: "QVariant" }
Parameter { name: "offsetY"; type: "QVariant" }
}
Property { name: "windowIcon"; type: "string" } Property { name: "windowIcon"; type: "string" }
Property { name: "launchMode"; type: "int" } Property { name: "launchMode"; type: "int" }
Property { name: "argument"; type: "QVariant" } Property { name: "argument"; type: "QVariant" }
@ -4131,6 +4259,7 @@ Module {
Property { name: "closeListener"; type: "QVariant" } Property { name: "closeListener"; type: "QVariant" }
Property { name: "_windowRegister"; type: "QVariant" } Property { name: "_windowRegister"; type: "QVariant" }
Property { name: "_route"; type: "string" } Property { name: "_route"; type: "string" }
Property { name: "_hideShadow"; type: "bool" }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
Signal { Signal {
name: "initArgument" name: "initArgument"
@ -4166,6 +4295,7 @@ Module {
Parameter { name: "duration"; type: "QVariant" } Parameter { name: "duration"; type: "QVariant" }
Parameter { name: "moremsg"; type: "QVariant" } Parameter { name: "moremsg"; type: "QVariant" }
} }
Method { name: "clearAllInfo"; type: "QVariant" }
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" } Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
Method { name: "fixWindowSize"; type: "QVariant" } Method { name: "fixWindowSize"; type: "QVariant" }
Method { Method {
@ -4179,6 +4309,8 @@ Module {
Parameter { name: "data"; type: "QVariant" } Parameter { name: "data"; type: "QVariant" }
} }
Method { name: "showMaximized"; type: "QVariant" } Method { name: "showMaximized"; type: "QVariant" }
Method { name: "showMinimized"; type: "QVariant" }
Method { name: "showNormal"; type: "QVariant" }
Method { Method {
name: "showLoading" name: "showLoading"
type: "QVariant" type: "QVariant"

View File

@ -14,7 +14,7 @@ Rectangle{
property string closeText : qsTr("Close") property string closeText : qsTr("Close")
property string stayTopText : qsTr("Sticky on Top") property string stayTopText : qsTr("Sticky on Top")
property string stayTopCancelText : qsTr("Sticky on Top cancelled") property string stayTopCancelText : qsTr("Sticky on Top cancelled")
property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000" property color textColor: FluTheme.fontPrimaryColor
property color minimizeNormalColor: FluTheme.itemNormalColor property color minimizeNormalColor: FluTheme.itemNormalColor
property color minimizeHoverColor: FluTheme.itemHoverColor property color minimizeHoverColor: FluTheme.itemHoverColor
property color minimizePressColor: FluTheme.itemPressColor property color minimizePressColor: FluTheme.itemPressColor

View File

@ -6,6 +6,7 @@ FluTextBox{
property var items:[] property var items:[]
property string emptyText: qsTr("No results found") property string emptyText: qsTr("No results found")
property int autoSuggestBoxReplacement: FluentIcons.Search property int autoSuggestBoxReplacement: FluentIcons.Search
property string textRole: "title"
property var filter: function(item){ property var filter: function(item){
if(item.title.indexOf(control.text)!==-1){ if(item.title.indexOf(control.text)!==-1){
return true return true
@ -24,7 +25,7 @@ FluTextBox{
function handleClick(modelData){ function handleClick(modelData){
control_popup.visible = false control_popup.visible = false
control.itemClicked(modelData) control.itemClicked(modelData)
control.updateText(modelData.title) control.updateText(modelData[textRole])
} }
function loadData(){ function loadData(){
var result = [] var result = []
@ -47,7 +48,6 @@ FluTextBox{
} }
Popup{ Popup{
id:control_popup id:control_popup
y:control.height
focus: false focus: false
padding: 0 padding: 0
enter: Transition { enter: Transition {
@ -58,12 +58,8 @@ FluTextBox{
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
contentItem: FluRectangle{ contentItem: FluClip{
radius: [4,4,4,4] radius: [5,5,5,5]
FluShadow{
radius: 4
}
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
ListView{ ListView{
id: list_view id: list_view
anchors.fill: parent anchors.fill: parent
@ -96,14 +92,17 @@ FluTextBox{
radius:4 radius:4
} }
color: { color: {
if(hovered){ if(pressed){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) return FluTheme.itemPressColor
} }
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0) if(hovered){
return FluTheme.itemHoverColor
}
return FluTheme.itemNormalColor
} }
} }
contentItem: FluText{ contentItem: FluText{
text:modelData.title text: modelData[textRole]
leftPadding: 10 leftPadding: 10
rightPadding: 10 rightPadding: 10
verticalAlignment : Qt.AlignVCenter verticalAlignment : Qt.AlignVCenter
@ -111,22 +110,28 @@ FluTextBox{
} }
} }
} }
background: Item{ background:Rectangle{
id:container id: rect_background
implicitWidth: control.width implicitWidth: control.width
implicitHeight: 38*Math.min(Math.max(list_view.count,1),8) implicitHeight: 38*Math.min(Math.max(list_view.count,1),8)
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{
radius: 5
}
} }
} }
onTextChanged: { onTextChanged: {
d.loadData() d.loadData()
if(d.flagVisible){ if(d.flagVisible){
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.implicitHeight){ if(d.window.height>pos.y+control.height+rect_background.implicitHeight){
control_popup.y = control.height control_popup.y = Qt.binding(function(){return control.height})
} else if(pos.y>container.implicitHeight){ } else if(pos.y>rect_background.implicitHeight){
control_popup.y = -container.implicitHeight control_popup.y = -rect_background.implicitHeight
} else { } else {
control_popup.y = d.window.height-(pos.y+container.implicitHeight) control_popup.y = d.window.height-(pos.y+rect_background.implicitHeight) - 1
} }
control_popup.visible = true control_popup.visible = true
} }

View File

@ -57,12 +57,12 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: { color: {
if(item_mouse.pressed){ if(item_mouse.pressed){
return FluTheme.dark ? Qt.rgba(150/255,150/255,150/235,1) : Qt.rgba(134/255,134/255,134/235,1) return FluTheme.dark ? Qt.rgba(150/255,150/255,150/255,1) : Qt.rgba(134/255,134/255,134/255,1)
} }
if(item_mouse.containsMouse){ if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(204/255,204/255,204/235,1) : Qt.rgba(92/255,92/255,92/235,1) return FluTheme.dark ? Qt.rgba(204/255,204/255,204/255,1) : Qt.rgba(92/255,92/255,92/255,1)
} }
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/235,1) : Qt.rgba(26/255,26/255,26/235,1) return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(26/255,26/255,26/255,1)
} }
MouseArea{ MouseArea{
id:item_mouse id:item_mouse

View File

@ -52,8 +52,6 @@ FluButton {
} }
Menu{ Menu{
id:popup id:popup
height: container.height
width: container.width
modal: true modal: true
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
@ -74,12 +72,9 @@ FluButton {
} }
} }
contentItem: Item{ contentItem: Item{
clip: true
Rectangle{
id:container id:container
width: 300 implicitWidth: 300
height: 360 implicitHeight: 360
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
@ -609,8 +604,10 @@ FluButton {
} }
} }
} }
} background:Rectangle{
background: Item{ radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 5 radius: 5
} }
@ -618,13 +615,12 @@ FluButton {
function showPopup() { function showPopup() {
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height - 1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {
popup.y = d.window.height-(pos.y+container.height) popup.y = d.window.height-(pos.y+container.height)
} }
popup.x = -(popup.width-control.width)/2
popup.open() popup.open()
} }
} }

View File

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Controls.Basic
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import FluentUI import FluentUI
@ -13,16 +14,15 @@ Button{
property color current : Qt.rgba(1,1,1,1) property color current : Qt.rgba(1,1,1,1)
signal accepted() signal accepted()
property int colorHandleRadius: 8 property int colorHandleRadius: 8
property string cancelText: "取消" property string cancelText: qsTr("Cancel")
property string okText: "确定" property string okText: qsTr("OK")
property string titleText: "颜色选择器" property string titleText: qsTr("Color Picker")
property string editText: "编辑颜色" property string editText: qsTr("Edit Color")
property string redText: "红色" property string redText: qsTr("Red")
property string greenText: "绿色" property string greenText: qsTr("Green")
property string blueText: "蓝色" property string blueText: qsTr("Blue")
property string opacityText: "透明度" property string opacityText: qsTr("Opacity")
background: background: Rectangle{
Rectangle{
id:layout_color id:layout_color
radius: 5 radius: 5
color:"#00000000" color:"#00000000"

View File

@ -11,6 +11,7 @@ T.ComboBox {
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1) property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1) property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
property alias textBox: text_field
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding) implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
@ -39,6 +40,7 @@ T.ComboBox {
opacity: enabled ? 1 : 0.3 opacity: enabled ? 1 : 0.3
} }
contentItem: T.TextField { contentItem: T.TextField {
id: text_field
property bool disabled: !control.editable property bool disabled: !control.editable
leftPadding: !control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1 leftPadding: !control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1
rightPadding: control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1 rightPadding: control.mirrored ? 10 : control.editable && activeFocus ? 3 : 1
@ -134,10 +136,9 @@ T.ComboBox {
} }
} }
background:Rectangle{ background:Rectangle{
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
border.width: 1
radius: 5 radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 5 radius: 5
} }

View File

@ -95,8 +95,6 @@ FluButton {
Menu{ Menu{
id:popup id:popup
modal: true modal: true
width: container.width
height: container.height
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
reversible: true reversible: true
@ -115,30 +113,26 @@ FluButton {
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
background:Item{ background:Rectangle{
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 4 radius: 5
} }
} }
contentItem: Item{ contentItem: Item{
clip: true
Rectangle{
id:container id:container
radius: 4 implicitHeight: 340
width: 300 implicitWidth: 300
height: 340
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
} }
FluShadow{
radius: 4
}
RowLayout{ RowLayout{
id:layout_content id:layout_content
spacing: 0 spacing: 0
width: parent.width width: parent.width
height: 300 height: 280
Component{ Component{
id:list_delegate id:list_delegate
Item{ Item{
@ -165,7 +159,7 @@ FluButton {
if(item_mouse.containsMouse){ if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
} }
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0) return Qt.rgba(0,0,0,0)
} }
radius: 3 radius: 3
MouseArea{ MouseArea{
@ -213,8 +207,9 @@ FluButton {
} }
ListView{ ListView{
id:list_view_1 id:list_view_1
width: 100 Layout.preferredWidth: 100
height: parent.height Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds boundsBehavior:Flickable.StopAtBounds
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
model: generateYearArray(1924,2048) model: generateYearArray(1924,2048)
@ -231,14 +226,16 @@ FluButton {
} }
} }
Rectangle{ Rectangle{
width: 1 Layout.preferredWidth: 1
height: parent.height Layout.preferredHeight: parent.height
color: control.dividerColor color: control.dividerColor
visible: showYear
} }
ListView{ ListView{
id:list_view_2 id:list_view_2
width: showYear ? 100 : 150 Layout.preferredWidth: showYear ? 99 : 150
height: parent.height Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
clip: true clip: true
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0 preferredHighlightBegin: 0
@ -253,20 +250,20 @@ FluButton {
} }
} }
Rectangle{ Rectangle{
width: 1 Layout.preferredWidth: 1
height: parent.height Layout.preferredHeight: parent.height
color: control.dividerColor color: control.dividerColor
} }
ListView{ ListView{
id:list_view_3 id:list_view_3
width: showYear ? 100 : 150 Layout.preferredWidth: showYear ? 99 : 150
height: parent.height Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
clip: true clip: true
preferredHighlightBegin: 0 preferredHighlightBegin: 0
preferredHighlightEnd: 0 preferredHighlightEnd: 0
highlightMoveDuration: 0 highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{ delegate: FluLoader{
property var model: modelData property var model: modelData
@ -276,17 +273,12 @@ FluButton {
} }
} }
} }
Rectangle{
width: parent.width
height: 1
anchors.top: layout_content.bottom
color: control.dividerColor
}
Rectangle{ Rectangle{
id:layout_actions id:layout_actions
height: 40 height: 60
radius: 5
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 5
anchors{ anchors{
bottom:parent.bottom bottom:parent.bottom
left: parent.left left: parent.left
@ -339,7 +331,6 @@ FluButton {
} }
} }
} }
}
y:35 y:35
function showPopup() { function showPopup() {
d.changeFlag = true d.changeFlag = true
@ -360,7 +351,7 @@ FluButton {
text_day.text = day text_day.text = day
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height-1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {

View File

@ -20,16 +20,20 @@ FluButton {
} }
iconColor:control.textColor iconColor:control.textColor
} }
Item{
id: d
property var window: Window.window
}
onClicked: { onClicked: {
if(menu.count !==0){ if(menu.count !==0){
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
var containerHeight = menu.count*36 var containerHeight = menu.count*36
if(window.height>pos.y+control.height+containerHeight){ if(d.window.height>pos.y+control.height+containerHeight){
menu.y = control.height menu.y = control.height
}else if(pos.y>containerHeight){ }else if(pos.y>containerHeight){
menu.y = -containerHeight menu.y = -containerHeight
}else{ }else{
menu.y = window.height-(pos.y+containerHeight) menu.y = d.window.height-(pos.y+containerHeight)
} }
menu.open() menu.open()
} }

View File

@ -3,44 +3,40 @@ import QtQuick.Controls
import FluentUI import FluentUI
FluObject { FluObject {
property var root; property var root
property int layoutY: 75 property int layoutY: 75
id:control id:control
FluObject{ FluObject{
id:mcontrol id:mcontrol
property string const_success: "success"; property string const_success: "success"
property string const_info: "info"; property string const_info: "info"
property string const_warning: "warning"; property string const_warning: "warning"
property string const_error: "error"; property string const_error: "error"
property int maxWidth: 300; property int maxWidth: 300
property var screenLayout: null; property var screenLayout: null
function create(type,text,duration,moremsg){ function create(type,text,duration,moremsg){
if(screenLayout){ if(screenLayout){
var last = screenLayout.getLastloader(); var last = screenLayout.getLastloader()
if(last.type === type && last.text === text && moremsg === last.moremsg){ if(last.type === type && last.text === text && moremsg === last.moremsg){
last.restart(); last.duration = duration
return; if (duration > 0) last.restart()
return last
} }
} }
initScreenLayout(); initScreenLayout()
contentComponent.createObject(screenLayout,{ return contentComponent.createObject(screenLayout,{type:type,text:text,duration:duration,moremsg:moremsg,})
type:type,
text:text,
duration:duration,
moremsg:moremsg,
});
} }
function createCustom(itemcomponent,duration){ function createCustom(itemcomponent,duration){
initScreenLayout(); initScreenLayout()
if(itemcomponent){ if(itemcomponent){
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration}); return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration})
} }
} }
function initScreenLayout(){ function initScreenLayout(){
if(screenLayout == null){ if(screenLayout == null){
screenLayout = screenlayoutComponent.createObject(root); screenLayout = screenlayoutComponent.createObject(root)
screenLayout.y = control.layoutY; screenLayout.y = control.layoutY
screenLayout.z = 100000; screenLayout.z = 100000
} }
} }
Component{ Component{
@ -57,42 +53,44 @@ FluObject {
duration: FluTheme.animationEnabled ? 333 : 0 duration: FluTheme.animationEnabled ? 333 : 0
} }
} }
onChildrenChanged: if(children.length === 0) destroy(); onChildrenChanged: if(children.length === 0) destroy()
function getLastloader(){ function getLastloader(){
if(children.length > 0){ if(children.length > 0){
return children[children.length - 1]; return children[children.length - 1]
} }
return null; return null
} }
} }
} }
Component{ Component{
id:contentComponent id:contentComponent
Item{ Item{
id:content; id:content
property int duration: 1500 property int duration: 1500
property var itemcomponent property var itemcomponent
property string type property string type
property string text property string text
property string moremsg property string moremsg
width: parent.width; width: parent.width
height: loader.height; height: loader.height
function close(){ function close(){
content.destroy(); content.destroy()
} }
function restart(){ function restart(){
delayTimer.restart(); delayTimer.restart()
} }
Timer { Timer {
id:delayTimer id:delayTimer
interval: duration; running: duration > 0; repeat: duration > 0 interval: duration
onTriggered: content.close(); running: duration > 0
repeat: duration > 0
onTriggered: content.close()
} }
FluLoader{ FluLoader{
id:loader; id:loader
x:(parent.width - width) / 2; x:(parent.width - width) / 2
property var _super: content; property var _super: content
scale: item ? 1 : 0; scale: item ? 1 : 0
asynchronous: true asynchronous: true
Behavior on scale { Behavior on scale {
enabled: FluTheme.animationEnabled enabled: FluTheme.animationEnabled
@ -101,30 +99,30 @@ FluObject {
duration: 167 duration: 167
} }
} }
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle; sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle
} }
} }
} }
property Component fluent_sytle: Rectangle{ property Component fluent_sytle: Rectangle{
width: rowlayout.width + (btn_close.visible ? 30 : 48); width: rowlayout.width + (btn_close.visible ? 30 : 48)
height: rowlayout.height + 20; height: rowlayout.height + 20
color: { color: {
if(FluTheme.dark){ if(FluTheme.dark){
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1); case mcontrol.const_success: return Qt.rgba(57/255,61/255,27/255,1)
case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1); case mcontrol.const_warning: return Qt.rgba(67/255,53/255,25/255,1)
case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1); case mcontrol.const_info: return Qt.rgba(39/255,39/255,39/255,1)
case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1); case mcontrol.const_error: return Qt.rgba(68/255,39/255,38/255,1)
} }
return Qt.rgba(255,255,255,1) return Qt.rgba(1,1,1,1)
}else{ }else{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return "#dff6dd"; case mcontrol.const_success: return Qt.rgba(223/255,246/255,221/255,1)
case mcontrol.const_warning: return "#fff4ce"; case mcontrol.const_warning: return Qt.rgba(255/255,244/255,206/255,1)
case mcontrol.const_info: return "#f4f4f4"; case mcontrol.const_info: return Qt.rgba(244/255,244/255,244/255,1)
case mcontrol.const_error: return "#fde7e9"; case mcontrol.const_error: return Qt.rgba(253/255,231/255,233/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
} }
} }
FluShadow{ FluShadow{
@ -135,34 +133,34 @@ FluObject {
border.color: { border.color: {
if(FluTheme.dark){ if(FluTheme.dark){
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1); case mcontrol.const_success: return Qt.rgba(56/255,61/255,27/255,1)
case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1); case mcontrol.const_warning: return Qt.rgba(66/255,53/255,25/255,1)
case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1); case mcontrol.const_info: return Qt.rgba(38/255,39/255,39/255,1)
case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1); case mcontrol.const_error: return Qt.rgba(67/255,39/255,38/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
}else{ }else{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return "#d2e8d0"; case mcontrol.const_success: return Qt.rgba(210/255,232/255,208/255,1)
case mcontrol.const_warning: return "#f0e6c2"; case mcontrol.const_warning: return Qt.rgba(240/255,230/255,194/255,1)
case mcontrol.const_info: return "#e6e6e6"; case mcontrol.const_info: return Qt.rgba(230/255,230/255,230/255,1)
case mcontrol.const_error: return "#eed9db"; case mcontrol.const_error: return Qt.rgba(238/255,217/255,219/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
} }
} }
Row{ Row{
id:rowlayout id:rowlayout
x:20; x:20
y:(parent.height - height) / 2; y:(parent.height - height) / 2
spacing: 10 spacing: 10
FluIcon{ FluIcon{
iconSource:{ iconSource:{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return FluentIcons.CompletedSolid; case mcontrol.const_success: return FluentIcons.CompletedSolid
case mcontrol.const_warning: return FluentIcons.InfoSolid; case mcontrol.const_warning: return FluentIcons.InfoSolid
case mcontrol.const_info: return FluentIcons.InfoSolid; case mcontrol.const_info: return FluentIcons.InfoSolid
case mcontrol.const_error: return FluentIcons.StatusErrorFull; case mcontrol.const_error: return FluentIcons.StatusErrorFull
}FluentIcons.StatusErrorFull }FluentIcons.StatusErrorFull
return FluentIcons.FA_info_circle return FluentIcons.FA_info_circle
} }
@ -170,20 +168,20 @@ FluObject {
iconColor: { iconColor: {
if(FluTheme.dark){ if(FluTheme.dark){
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1); case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1)
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1); case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1)
case mcontrol.const_info: return FluTheme.primaryColor; case mcontrol.const_info: return FluTheme.primaryColor
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1); case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
}else{ }else{
switch(_super.type){ switch(_super.type){
case mcontrol.const_success: return "#0f7b0f"; case mcontrol.const_success: return Qt.rgba(15/255,123/255,15/255,1)
case mcontrol.const_warning: return "#9d5d00"; case mcontrol.const_warning: return Qt.rgba(157/255,93/255,0/255,1)
case mcontrol.const_info: return "#0066b4"; case mcontrol.const_info: return Qt.rgba(0/255,102/255,180/255,1)
case mcontrol.const_error: return "#c42b1c"; case mcontrol.const_error: return Qt.rgba(196/255,43/255,28/255,1)
} }
return "#FFFFFF" return Qt.rgba(1,1,1,1)
} }
} }
} }
@ -208,45 +206,39 @@ FluObject {
id:btn_close id:btn_close
iconSource: FluentIcons.ChromeClose iconSource: FluentIcons.ChromeClose
iconSize: 10 iconSize: 10
y:5 verticalPadding: 0
horizontalPadding: 0
width: 30
height: 20
visible: _super.duration<=0 visible: _super.duration<=0
iconColor: { anchors.verticalCenter: parent.verticalCenter
if(FluTheme.dark){ iconColor: FluTheme.dark ? Qt.rgba(222/255,222/255,222/255,1) : Qt.rgba(97/255,97/255,97/255,1)
switch(_super.type){
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
case mcontrol.const_info: return FluTheme.primaryColor;
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
}
return "#FFFFFF"
}else{
switch(_super.type){
case mcontrol.const_success: return "#0f7b0f";
case mcontrol.const_warning: return "#9d5d00";
case mcontrol.const_info: return "#0066b4";
case mcontrol.const_error: return "#c42b1c";
}
return "#FFFFFF"
}
}
onClicked: _super.close() onClicked: _super.close()
} }
} }
} }
} }
function showSuccess(text,duration=1000,moremsg){ function showSuccess(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "")
} }
function showInfo(text,duration=1000,moremsg){ function showInfo(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "")
} }
function showWarning(text,duration=1000,moremsg){ function showWarning(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "")
} }
function showError(text,duration=1000,moremsg){ function showError(text,duration=1000,moremsg){
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : ""); return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "")
} }
function showCustom(itemcomponent,duration=1000){ function showCustom(itemcomponent,duration=1000){
mcontrol.createCustom(itemcomponent,duration); return mcontrol.createCustom(itemcomponent,duration)
}
function clearAllInfo(){
if(mcontrol.screenLayout != null) {
mcontrol.screenLayout.destroy()
mcontrol.screenLayout = null
}
return true
} }
} }

View File

@ -39,13 +39,13 @@ T.Menu {
: false : false
clip: true clip: true
currentIndex: control.currentIndex currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {} ScrollBar.vertical: FluScrollBar{}
} }
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
implicitHeight: 36 implicitHeight: 36
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(240/255,240/255,240/255,1) color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(252/255,252/255,252/255,1)
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1) border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
border.width: 1 border.width: 1
radius: 5 radius: 5
FluShadow{} FluShadow{}

View File

@ -49,9 +49,6 @@ T.MenuBarItem {
radius: 3 radius: 3
color: { color: {
if(control.highlighted){ if(control.highlighted){
return FluTheme.itemCheckColor
}
if(control.hovered){
return FluTheme.itemHoverColor return FluTheme.itemHoverColor
} }
return FluTheme.itemNormalColor return FluTheme.itemNormalColor

View File

@ -102,7 +102,7 @@ T.MenuItem {
radius: 4 radius: 4
color: { color: {
if(control.highlighted){ if(control.highlighted){
return FluTheme.itemCheckColor return FluTheme.itemHoverColor
} }
return FluTheme.itemNormalColor return FluTheme.itemNormalColor
} }

View File

@ -1121,7 +1121,8 @@ Item {
} }
padding: 0 padding: 0
focus: true focus: true
contentItem: Item{ contentItem: FluClip{
radius: [5,5,5,5]
ListView{ ListView{
id:list_view id:list_view
anchors.fill: parent anchors.fill: parent
@ -1146,7 +1147,6 @@ Item {
visible: item_button.activeFocus visible: item_button.activeFocus
radius:4 radius:4
} }
FluLoader{ FluLoader{
id:item_dot_loader id:item_dot_loader
anchors{ anchors{
@ -1161,7 +1161,6 @@ Item {
return undefined return undefined
} }
} }
} }
contentItem: FluText{ contentItem: FluText{
text:modelData.title text:modelData.title
@ -1188,13 +1187,13 @@ Item {
} }
} }
} }
background: FluRectangle{ background: Rectangle{
implicitWidth: 180 implicitWidth: 180
radius: [4,4,4,4] color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(252/255,252/255,252/255,1)
FluShadow{ border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 4 border.width: 1
} radius: 5
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1) FluShadow{}
} }
function showPopup(pos,height,model){ function showPopup(pos,height,model){
background.implicitHeight = height background.implicitHeight = height

View File

@ -5,6 +5,7 @@ import FluentUI
Item { Item {
signal requestPage(int page, int count) signal requestPage(int page, int count)
property string previousText: qsTr("<Previous") property string previousText: qsTr("<Previous")
property string nextText: qsTr("Next>") property string nextText: qsTr("Next>")
property int pageCurrent: 0 property int pageCurrent: 0
@ -13,6 +14,8 @@ Item {
property int pageCount: itemCount > 0 ? Math.ceil(itemCount / __itemPerPage) : 0 property int pageCount: itemCount > 0 ? Math.ceil(itemCount / __itemPerPage) : 0
property int __itemPerPage: 10 property int __itemPerPage: 10
property int __pageButtonHalf: Math.floor(pageButtonCount / 2) + 1 property int __pageButtonHalf: Math.floor(pageButtonCount / 2) + 1
property Component header: null
property Component footer: null
id: control id: control
implicitHeight: 40 implicitHeight: 40
implicitWidth: content.width implicitWidth: content.width
@ -21,6 +24,9 @@ Item {
height: control.height height: control.height
spacing: 10 spacing: 10
padding: 10 padding: 10
Loader {
sourceComponent: header
}
FluToggleButton { FluToggleButton {
visible: control.pageCount > 1 visible: control.pageCount > 1
disabled: control.pageCurrent <= 1 disabled: control.pageCurrent <= 1
@ -86,9 +92,11 @@ Item {
control.calcNewPage(control.pageCurrent + 1); control.calcNewPage(control.pageCurrent + 1);
} }
} }
Loader {
sourceComponent: footer
} }
function calcNewPage(page) }
{ function calcNewPage(page) {
if (!page) if (!page)
return return
let page_num = Number(page) let page_num = Number(page)

View File

@ -4,30 +4,87 @@ import QtQuick.Controls.Basic
import QtQuick.Layouts import QtQuick.Layouts
import FluentUI import FluentUI
ColumnLayout { Item{
default property alias buttons: control.data
property int currentIndex : -1
id:control id:control
onCurrentIndexChanged: { default property list<QtObject> buttons
property int currentIndex : -1
property int spacing: 8
property int orientation: Qt.Vertical
property bool disabled: false
property bool manuallyDisabled: false
QtObject{
id: d
function updateChecked(){
if(buttons.length === 0){
return
}
for(var i = 0;i<buttons.length;i++){ for(var i = 0;i<buttons.length;i++){
buttons[i].checked = false buttons[i].checked = false
} }
var button = buttons[currentIndex] if(currentIndex>=0 && currentIndex<buttons.length){
if(button){ buttons[currentIndex].checked = true
button.checked = true
} }
} }
function refreshButtonStatus() {
for(var i = 0;i<buttons.length;i++){
if(!manuallyDisabled) buttons[i].enabled = !disabled
}
}
}
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
onCurrentIndexChanged: {
d.updateChecked()
}
onDisabledChanged: {
d.refreshButtonStatus()
}
onManuallyDisabledChanged: {
d.refreshButtonStatus()
}
Component{
id:com_vertical
ColumnLayout {
data: control.buttons
spacing: control.spacing
Component.onCompleted: { Component.onCompleted: {
for(var i = 0;i<buttons.length;i++){ for(var i = 0;i<control.buttons.length;i++){
buttons[i].clickListener = function(){ control.buttons[i].clickListener = function(){
for(var i = 0;i<buttons.length;i++){ for(var i = 0;i<control.buttons.length;i++){
var button = buttons[i] var button = control.buttons[i]
if(this === button){ if(this === button){
currentIndex = i control.currentIndex = i
} }
} }
} }
} }
currentIndex = 0 d.updateChecked()
d.refreshButtonStatus()
}
}
}
Component{
id:com_horizontal
RowLayout {
data: control.buttons
spacing: control.spacing
Component.onCompleted: {
for(var i = 0;i<control.buttons.length;i++){
control.buttons[i].clickListener = function(){
for(var i = 0;i<control.buttons.length;i++){
var button = control.buttons[i]
if(this === button){
control.currentIndex = i
}
}
}
}
d.updateChecked()
d.refreshButtonStatus()
}
}
}
FluLoader{
sourceComponent: control.orientation === Qt.Vertical ? com_vertical : com_horizontal
} }
} }

View File

@ -11,19 +11,19 @@ QtObject {
windows.push(window) windows.push(window)
} }
} }
function removeWindow(window) { function removeWindow(win) {
if(!window.transientParent){ if(!win.transientParent){
var index = windows.indexOf(window) var index = windows.indexOf(win)
if (index !== -1) { if (index !== -1) {
windows.splice(index, 1) windows.splice(index, 1)
FluTools.deleteLater(window) win.deleteLater()
} }
} }
} }
function exit(retCode){ function exit(retCode){
for(var i =0 ;i< windows.length; i++){ for(var i =0 ;i< windows.length; i++){
var item = windows[i] var win = windows[i]
FluTools.deleteLater(item) win.deleteLater()
} }
windows = [] windows = []
Qt.exit(retCode) Qt.exit(retCode)

View File

@ -173,7 +173,7 @@ T.ScrollBar {
,Transition { ,Transition {
to: "show" to: "show"
SequentialAnimation { SequentialAnimation {
PauseAnimation { duration: 450 } PauseAnimation { duration: 150 }
NumberAnimation { NumberAnimation {
target: rect_bar target: rect_bar
properties: vertical ? "width" : "height" properties: vertical ? "width" : "height"

View File

@ -4,7 +4,7 @@ import FluentUI
Item { Item {
//高性能阴影比DropShadow阴影性能高出数倍 //高性能阴影比DropShadow阴影性能高出数倍
property color color: FluTheme.dark ? "#AAAAAA" : "#999999" property color color: FluTheme.dark ? "#000000" : "#999999"
property int elevation: 5 property int elevation: 5
property int radius: 4 property int radius: 4
id:control id:control

View File

@ -10,7 +10,30 @@ FluIconButton {
property string positiveText: qsTr("Save") property string positiveText: qsTr("Save")
property string neutralText: qsTr("Cancel") property string neutralText: qsTr("Cancel")
property string negativeText: qsTr("Reset") property string negativeText: qsTr("Reset")
property bool registered: true
property color errorColor: Qt.rgba(250/255,85/255,85/255,1)
property FluHotkey syncHotkey: undefined
signal accepted() signal accepted()
padding: 0
verticalPadding: 0
horizontalPadding: 0
onSyncHotkeyChanged: {
current = syncHotkey.sequence.split("+")
control.registered = syncHotkey.isRegistered
control.registered = Qt.binding(function(){
return syncHotkey.isRegistered
})
}
text: ""
color: {
if(!enabled){
return disableColor
}
if(pressed){
return pressedColor
}
return hovered ? hoverColor : normalColor
}
QtObject{ QtObject{
id: d id: d
function keyToString(key_code,shift = true) function keyToString(key_code,shift = true)
@ -112,37 +135,46 @@ FluIconButton {
return ""; return "";
} }
} }
background: Rectangle{ background: Item{
implicitHeight: 42
implicitWidth: 42
}
contentItem: Item{
implicitWidth: childrenRect.width
implicitHeight: layout_row.height
FluText{
id: text_title
text: control.text
visible: control.text !== ""
rightPadding: 8
anchors{
verticalCenter: layout_rect.verticalCenter
}
}
Rectangle{
id: layout_rect
border.color: FluTheme.dark ? "#505050" : "#DFDFDF" border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
border.width: 1 border.width: 1
implicitHeight: 42
implicitWidth: layout_row.width+28
radius: control.radius radius: control.radius
color: control.color color: control.color
height: control.height
width: layout_row.width
anchors{
left: text_title.right
}
FluFocusRectangle{ FluFocusRectangle{
visible: control.activeFocus visible: control.activeFocus
} }
}
Component{
id:com_item_key
Rectangle{
id:item_key_control
color:FluTheme.primaryColor
width: Math.max(item_text.implicitWidth+12,28)
height: Math.max(item_text.implicitHeight,28)
radius: 4
FluText{
id:item_text
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
text: keyText
anchors.centerIn: parent
}
}
}
Row{ Row{
id:layout_row id:layout_row
spacing: 5 spacing: 5
anchors.centerIn: parent anchors.centerIn: parent
Item{
width: 8
height: 1
}
Repeater{ Repeater{
model: control.current model: control.current
delegate: Loader{ delegate: Loader{
@ -161,6 +193,39 @@ FluIconButton {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
Item{
width: 8
height: 1
}
}
}
FluText{
id: text_error
text: qsTr("Conflict")
color: control.errorColor
visible: !control.registered
anchors{
verticalCenter: layout_rect.verticalCenter
left: layout_rect.right
leftMargin: 4
}
}
}
Component{
id:com_item_key
Rectangle{
id:item_key_control
color:FluTheme.primaryColor
width: Math.max(item_text.implicitWidth+12,28)
height: Math.max(item_text.implicitHeight,28)
radius: 4
FluText{
id:item_text
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
text: keyText
anchors.centerIn: parent
}
}
} }
FluContentDialog{ FluContentDialog{
id:content_dialog id:content_dialog
@ -179,6 +244,9 @@ FluIconButton {
onPositiveClicked: { onPositiveClicked: {
control.current = content_dialog.keysModel control.current = content_dialog.keysModel
control.accepted() control.accepted()
if(control.syncHotkey){
control.syncHotkey.sequence = control.current.join("+")
}
} }
onNegativeClickListener: function(){ onNegativeClickListener: function(){
content_dialog.keysModel = control.current content_dialog.keysModel = control.current

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