Compare commits

..

46 Commits

Author SHA1 Message Date
fac4f172d8 Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2025-05-28 17:35:57 +08:00
f8b7475261 fix bug 2025-05-28 17:35:52 +08:00
4ca0978882 Merge pull request #602 from Polaris-Night/main
feat: FluRectangle支持修改边框样式、FluTour增加指示器和动画效果
2025-05-28 13:34:56 +08:00
ce4fb06084 feat: FluRectangle支持修改边框样式 2025-05-27 22:40:04 +08:00
97e88dbd6f feat: FluTour增加指示器和动画效果 2025-05-17 08:25:17 +08:00
e27f1591b0 Merge pull request #599 from Polaris-Night/main
feat: 新增 FluRectangle 边框绘制、优化 FluDatePicker 月份切换逻辑、改进控件 enabled 属性兼容性及 FluTableView 分页行序号支持
2025-05-16 18:24:43 +08:00
f2c2beb90a feat: FluTableView增加startRowIndex属性,以支持分页数据场景下正确计算行序号,避免仅依赖表格数据量进行编号 2025-05-11 23:13:36 +08:00
a787a733c4 refactor: 部分控件用enabled替代disabled进行逻辑判断,提升使用原生enabled属性时的兼容性 2025-05-11 22:30:54 +08:00
b2fd3acda3 feat: FluDatePicker修改月份时,若当前日存在于新的月份中则保持日不变,否则修改为新月份的最后一日 2025-05-11 22:18:37 +08:00
49e96b094b feat: FluRectangle支持border绘制 2025-05-10 20:38:02 +08:00
af573b71a4 Merge pull request #598 from Polaris-Night/main
feat: 优化FluAutoSuggest和FluBadge
2025-05-09 09:19:19 +08:00
99c77d2786 feat: FluBadge支持设置max和position 2025-05-09 08:22:09 +08:00
5de9588b93 feat: FluAutoSuggestBox支持设置建议行数和行高以及pressed时显示建议 2025-05-07 23:15:32 +08:00
6b9f7a1c99 Merge pull request #597 from Polaris-Night/main
fix: 修复FluTableView错位问题
2025-04-24 10:07:49 +08:00
023776dbe8 fix: 修复FluTableView错位问题 2025-04-23 00:58:42 +08:00
b4a1eaa860 Update README.md 2025-03-16 19:26:11 +08:00
ef1f70683a Merge pull request #595 from Polaris-Night/main
feat: FluCarousel支持纵向轮播
2025-03-13 12:53:39 +08:00
8377fb5227 feat: FluCarousel支持纵向轮播 2025-03-12 23:38:48 +08:00
9ac58a8ca7 update 2025-03-12 10:09:54 +08:00
ee87a718ed update 2025-03-12 09:56:43 +08:00
80dd3ebd35 update 2025-03-12 09:55:58 +08:00
1990203f3b Merge pull request #593 from Polaris-Night/main
修复FluTreeModel::setDataSource内存泄漏问题
2025-03-08 14:49:26 +08:00
df7cd94eec Merge pull request #592 from add-uos/main
fix: 优化示例中加载按钮交互效果
2025-03-08 14:48:48 +08:00
2cc17e9db3 修复FluTreeModel::setDataSource内存泄漏问题 2025-03-03 21:24:56 +08:00
aa8fcb304f fix: 优化示例中加载按钮交互效果
优化 example 中加载按钮页面交互效果
2025-03-03 15:23:57 +08:00
882cc8989f Merge pull request #589 from soulwyb/repair-FluPivot-example-error
修复Pivot的示例代码错误
2025-02-21 12:01:57 +08:00
444cc1aeee 修复Pivot的示例代码错误 2025-02-21 11:34:54 +08:00
db0588edcd Merge pull request #588 from Polaris-Night/main
修复FluCarousel手动翻页的问题
2025-02-21 11:23:30 +08:00
99f6b16aa1 修复FluProgressBar属性错误 2025-02-20 20:15:21 +08:00
65b7737454 修复FluCarousel设置autoPlay为false时手动翻页仍触发自动轮播翻页问题. fixed #563
修复FluCarousel设置autoPlay为false时不能无限向左/右翻页的问题.
2025-02-20 20:11:01 +08:00
7a6efa41fb Merge pull request #587 from add-uos/main
fix: add some chinese translation in example
2025-02-13 11:46:22 +08:00
113810879d fix: add some chinese translation in example
add some chinese translation in example
2025-02-13 10:31:13 +08:00
09e0430293 Merge pull request #584 from Kakueeen/main
修复编译错误
2025-01-16 18:09:35 +08:00
29686d07ba fix: Fix compilation error
QApplication: No such file or directory
2025-01-14 20:16:31 +08:00
7204e18afe Merge pull request #583 from luckyloogn/fix/flupivot-animation-issues
修复FluPivot 切换选中项目时标题下划线动画未能完全关闭的问题
2025-01-02 17:04:23 +08:00
985e90bffc Merge pull request #582 from luckyloogn/fix/color-picker-sync-issues
修复 FluColorPicker 存在的颜色同步与输入问题
2025-01-02 17:04:02 +08:00
e82000e6f8 fix(FluPivot): 修复 title 下划线动画未能完全关闭的问题
修复了在 `FluTheme.animationEnabled = false` 时,从文字较少的 title 切换到文字较多的 title 时,下划线仍然存在尺寸变化动画的问题。
2025-01-01 17:24:31 +08:00
444d9b2d28 fix(FluColorPicker): 修复多项颜色同步与输入问题
- 修复了 FluColorPicker 打开时滑块与 RGBA/HEX 数值未正确匹配当前颜色的问题。
- 修复了 FluColorPicker 设置 HEX 值时,RGBA 数值未同步更新的问题。
- 修复了 FluColorPicker HEX 输入框只能接受大写 A-F 字符的问题。
2025-01-01 17:20:39 +08:00
1a8e3d5ab2 Merge pull request #580 from lucky9loogn/fix/ubuntu-blur-behind-segmentation-fault
fix: 修复了在 Ubuntu 中启用亚克力效果无效且导致程序崩溃的问题
2024-12-27 09:14:23 +08:00
fb720b29ec Merge pull request #581 from lucky9loogn/fix/github-action-appimage-language-switch-not-working
fix(ci): 修复 GitHub Action 打包的 AppImage 语言切换无效
2024-12-27 09:13:48 +08:00
552772391c fix(ci): 修复 GitHub Action 打包的 AppImage 语言切换无效 2024-12-26 23:23:34 +08:00
3a34e98d80 fix: 修复了在 Ubuntu 中启用亚克力效果无效且导致程序崩溃的问题 2024-12-26 22:54:14 +08:00
1beb900455 Merge pull request #578 from ToMoree/add_init_checked_for_treeview
fix treeview初始化时,设置checked为true无效
2024-12-24 21:51:40 +08:00
bb537f4328 Merge pull request #577 from lucky9loogn/feat-fluexpander-custom-header
FluExpander 添加属性 headerHeight 和 headerDelegate
2024-12-24 21:50:57 +08:00
2f38232dcf fix treeview初始化时,设置checked为true无效 2024-12-04 13:49:22 +08:00
cd6a46c22e FluExpander 添加属性 headerHeight 和 headerDelegate
- 使 FluExpander 支持自定义非展开状态下 header 的高度和内容
- 在 example 添加对应的使用例子
2024-12-03 22:32:52 +08:00
74 changed files with 2647 additions and 721 deletions

View File

@ -69,6 +69,11 @@ jobs:
- name: Check if svg file exists
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
- name: Copy translation files
run: |
mkdir -p bin/release/usr/bin/
cp -r bin/Release/i18n/ bin/release/usr/bin/i18n/
- name: package
run: |
# make sure Qt plugin finds QML sources so it can deploy the imported files

20
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
"MicroPython.executeButton": [
{
"text": "▶",
"tooltip": "运行",
"alignment": "left",
"command": "extension.executeFile",
"priority": 3.5
}
],
"MicroPython.syncButton": [
{
"text": "$(sync)",
"tooltip": "同步",
"alignment": "left",
"command": "extension.execute",
"priority": 4
}
]
}

View File

@ -1,6 +1,5 @@
# ATTENTION! THIS REPO HAS BEEN DEPRECATED!
# PLEASE USE THE BRAND NEW [FluentUI2](https://github.com/zhuzichu520/FluentUI2) INSTEAD!
# THIS REPO IS NO LONGER MAINTAINED.
# ATTENTION!
# PLEASE USE THE BRAND NEW [FluentUI Pro](https://github.com/zhuzichu520/FluentUI2) INSTEAD!
<div align=center>
<img width=64 src="doc/preview/fluent_design.svg">

View File

@ -24,8 +24,8 @@ else ()
endif ()
#导入Qt相关依赖包
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 NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network Widgets)
#添加国际化脚本
find_program(QT_LUPDATE NAMES lupdate lupdate-qt6)
@ -141,6 +141,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::Svg
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Widgets
fluentuiplugin
)

View File

@ -70,17 +70,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/CrashWindow.qml" line="50"/>
<location filename="qml/window/CrashWindow.qml" line="53"/>
<source>We apologize for the inconvenience caused by an unexpected error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/CrashWindow.qml" line="62"/>
<location filename="qml/window/CrashWindow.qml" line="65"/>
<source>Report Logs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/CrashWindow.qml" line="72"/>
<location filename="qml/window/CrashWindow.qml" line="75"/>
<source>Restart Program</source>
<translation type="unfinished"></translation>
</message>
@ -612,104 +612,104 @@
<context>
<name>MainWindow</name>
<message>
<location filename="qml/window/MainWindow.qml" line="86"/>
<location filename="qml/window/MainWindow.qml" line="94"/>
<location filename="qml/window/MainWindow.qml" line="88"/>
<location filename="qml/window/MainWindow.qml" line="96"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="87"/>
<location filename="qml/window/MainWindow.qml" line="89"/>
<source>Are you sure you want to exit the program?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="88"/>
<location filename="qml/window/MainWindow.qml" line="90"/>
<source>Minimize</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="91"/>
<location filename="qml/window/MainWindow.qml" line="93"/>
<source>Friendly Reminder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="91"/>
<location filename="qml/window/MainWindow.qml" line="93"/>
<source>FluentUI is hidden from the tray, click on the tray to activate the window again</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="95"/>
<location filename="qml/window/MainWindow.qml" line="337"/>
<location filename="qml/window/MainWindow.qml" line="97"/>
<location filename="qml/window/MainWindow.qml" line="339"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="106"/>
<location filename="qml/window/MainWindow.qml" line="108"/>
<source>Open in Separate Window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="203"/>
<location filename="qml/window/MainWindow.qml" line="205"/>
<source>Click Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="213"/>
<location filename="qml/window/MainWindow.qml" line="215"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="302"/>
<location filename="qml/window/MainWindow.qml" line="304"/>
<source>Finish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="303"/>
<location filename="qml/window/MainWindow.qml" line="305"/>
<source>Next</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="304"/>
<location filename="qml/window/MainWindow.qml" line="306"/>
<source>Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="308"/>
<location filename="qml/window/MainWindow.qml" line="310"/>
<source>Dark Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="308"/>
<location filename="qml/window/MainWindow.qml" line="310"/>
<source>Here you can switch to night mode.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="310"/>
<location filename="qml/window/MainWindow.qml" line="312"/>
<source>Hide Easter eggs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="310"/>
<location filename="qml/window/MainWindow.qml" line="312"/>
<source>Try a few more clicks!!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="334"/>
<location filename="qml/window/MainWindow.qml" line="336"/>
<source>Upgrade Tips</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="335"/>
<location filename="qml/window/MainWindow.qml" line="337"/>
<source>FluentUI is currently up to date </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="335"/>
<location filename="qml/window/MainWindow.qml" line="337"/>
<source> -- The current app version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="335"/>
<location filename="qml/window/MainWindow.qml" line="337"/>
<source>
Now go and download the new version
@ -718,17 +718,17 @@ Updated content:
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="338"/>
<location filename="qml/window/MainWindow.qml" line="340"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="365"/>
<location filename="qml/window/MainWindow.qml" line="367"/>
<source>The current version is already the latest</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="372"/>
<location filename="qml/window/MainWindow.qml" line="374"/>
<source>The network is abnormal</source>
<translation type="unfinished"></translation>
</message>
@ -831,9 +831,25 @@ Updated content:
<name>T_Acrylic</name>
<message>
<location filename="qml/page/T_Acrylic.qml" line="10"/>
<location filename="qml/page/T_Acrylic.qml" line="72"/>
<source>Acrylic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Acrylic.qml" line="15"/>
<source>tintColor:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Acrylic.qml" line="25"/>
<source>tintOpacity:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Acrylic.qml" line="36"/>
<source>blurRadius:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Badge</name>
@ -863,11 +879,22 @@ Updated content:
<source>BreadcurmbBar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_BreadcrumbBar.qml" line="15"/>
<source>Item_%1</source>
<oldsource>Item_&apos;%1&apos;</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_BreadcrumbBar.qml" line="50"/>
<source>Reset sample</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_BreadcrumbBar.qml" line="54"/>
<source>Item_</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_BubbleChart</name>
@ -942,10 +969,16 @@ Updated content:
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Buttons.qml" line="222"/>
<location filename="qml/page/T_Buttons.qml" line="238"/>
<source>Loading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Buttons.qml" line="238"/>
<source>Normal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Buttons.qml" line="270"/>
<source>Click IconButton</source>
@ -1062,6 +1095,11 @@ Updated content:
<source>Please enter a verification code</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Captcha.qml" line="48"/>
<source>verify</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Captcha.qml" line="52"/>
<source>The verification code is correct</source>
@ -1085,6 +1123,11 @@ Updated content:
<source>Carousel map, support infinite carousel, infinite swipe, and components implemented with ListView</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Carousel.qml" line="203"/>
<source>Auto play</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_CheckBox</name>
@ -1158,6 +1201,62 @@ Updated content:
<source>ComboBox</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ComboBox.qml" line="20"/>
<source>editable=false</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ComboBox.qml" line="26"/>
<location filename="qml/page/T_ComboBox.qml" line="50"/>
<location filename="qml/page/T_ComboBox.qml" line="74"/>
<location filename="qml/page/T_ComboBox.qml" line="100"/>
<source>Banana</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ComboBox.qml" line="27"/>
<location filename="qml/page/T_ComboBox.qml" line="51"/>
<location filename="qml/page/T_ComboBox.qml" line="75"/>
<location filename="qml/page/T_ComboBox.qml" line="101"/>
<source>Apple</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ComboBox.qml" line="28"/>
<location filename="qml/page/T_ComboBox.qml" line="52"/>
<location filename="qml/page/T_ComboBox.qml" line="76"/>
<location filename="qml/page/T_ComboBox.qml" line="102"/>
<source>Coconut</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ComboBox.qml" line="43"/>
<source>disabled=true</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ComboBox.qml" line="67"/>
<source>editable=true</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ComboBox.qml" line="88"/>
<source>FluComboBox{
editable: true
model: ListModel {
id: model
ListElement { text: &quot;%1&quot; }
ListElement { text: &quot;%2&quot; }
ListElement { text: &quot;%3&quot; }
}
onAccepted: {
if (find(editText) === -1)
model.append({text: editText})
}
}</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_CustomPlot</name>
@ -1314,6 +1413,26 @@ Since that moment, I have been tormented day and night by the fear that I might
My only desire is to be permitted to drive out the traitors and restore the Han. If I should let you down, punish my offense and report it to the spirit of the late Emperor. If those three advisors should fail in their duties, then they should be punished for their negligence.Your Majesty, consider your course of action carefully. Seek out good advice, and never forget the late Emperor. I depart now on a long expedition, and I will be forever grateful if you heed my advice. Blinded by my own tears, I know not what I write.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Expander.qml" line="152"/>
<source>Check for Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Expander.qml" line="207"/>
<source>This is a ToggleButton in the header</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Expander.qml" line="215"/>
<source>This is a StandardButton in the content</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Expander.qml" line="217"/>
<source>Click StandardButton</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_FlipView</name>
@ -1472,11 +1591,21 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<source>This is an InfoBar in the Warning Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="39"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="41"/>
<source>This is an InfoBar in the Error Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="45"/>
<source>Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="47"/>
<source>This is an InfoBar in the Success Style</source>
@ -1508,7 +1637,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<location filename="qml/page/T_InfoBar.qml" line="64"/>
<location filename="qml/page/T_InfoBar.qml" line="75"/>
<location filename="qml/page/T_InfoBar.qml" line="85"/>
<source>show &apos;%1</source>
<source>show &apos;%1&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -1518,11 +1647,34 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<source>This is an &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="70"/>
<source>info1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="75"/>
<location filename="qml/page/T_InfoBar.qml" line="81"/>
<source>info2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="85"/>
<location filename="qml/page/T_InfoBar.qml" line="91"/>
<source>info3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="95"/>
<source>clear all info</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="103"/>
<source>Loading</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_LineChart</name>
@ -1797,6 +1949,31 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_QRCode.qml" line="27"/>
<source>text:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_QRCode.qml" line="41"/>
<source>color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_QRCode.qml" line="54"/>
<source>bgColor:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_QRCode.qml" line="66"/>
<source>margins:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_QRCode.qml" line="80"/>
<source>size:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_RadarChart</name>
@ -2038,6 +2215,37 @@ Some contents...</source>
<source>SplitLayout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_SplitLayout.qml" line="18"/>
<source>orientation:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_SplitLayout.qml" line="23"/>
<location filename="qml/page/T_SplitLayout.qml" line="25"/>
<source>Horizontal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_SplitLayout.qml" line="32"/>
<source>Vertical</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_SplitLayout.qml" line="57"/>
<source>Page 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_SplitLayout.qml" line="69"/>
<source>Page 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_SplitLayout.qml" line="78"/>
<source>Page 3</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_StaggeredLayout</name>
@ -2054,6 +2262,27 @@ Some contents...</source>
<source>StatusLayout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="22"/>
<location filename="qml/page/T_StatusLayout.qml" line="24"/>
<source>Loading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="31"/>
<source>Empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="38"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="45"/>
<source>Success</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_TabView</name>
@ -2067,6 +2296,48 @@ Some contents...</source>
<source>Document </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="39"/>
<source>Tab Width Behavior:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="44"/>
<location filename="qml/page/T_TabView.qml" line="46"/>
<source>Equal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="53"/>
<source>SizeToContent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="60"/>
<source>Compact</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="68"/>
<source>Tab Close Button Visibility:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="72"/>
<location filename="qml/page/T_TabView.qml" line="82"/>
<source>Always</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="75"/>
<source>Never</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TabView.qml" line="89"/>
<source>OnHover</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_TableView</name>
@ -2097,7 +2368,7 @@ Some contents...</source>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="503"/>
<location filename="qml/page/T_TableView.qml" line="504"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
@ -2147,37 +2418,37 @@ Some contents...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="508"/>
<location filename="qml/page/T_TableView.qml" line="509"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="522"/>
<location filename="qml/page/T_TableView.qml" line="523"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="530"/>
<location filename="qml/page/T_TableView.qml" line="531"/>
<source>Nickname</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="537"/>
<location filename="qml/page/T_TableView.qml" line="538"/>
<source>Long String</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="545"/>
<location filename="qml/page/T_TableView.qml" line="546"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="563"/>
<location filename="qml/page/T_TableView.qml" line="564"/>
<source>&lt;Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="564"/>
<location filename="qml/page/T_TableView.qml" line="565"/>
<source>Next&gt;</source>
<translation type="unfinished"></translation>
</message>
@ -2216,8 +2487,8 @@ Some contents...</source>
<location filename="qml/page/T_TextBox.qml" line="33"/>
<location filename="qml/page/T_TextBox.qml" line="64"/>
<location filename="qml/page/T_TextBox.qml" line="97"/>
<location filename="qml/page/T_TextBox.qml" line="128"/>
<location filename="qml/page/T_TextBox.qml" line="157"/>
<location filename="qml/page/T_TextBox.qml" line="135"/>
<location filename="qml/page/T_TextBox.qml" line="168"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
@ -2236,6 +2507,11 @@ Some contents...</source>
<source>AutoSuggestBox</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TextBox.qml" line="131"/>
<source>Show suggest when pressed</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Theme</name>
@ -2275,6 +2551,12 @@ Some contents...</source>
<oldsource>Rounded Window</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Theme.qml" line="157"/>
<location filename="qml/page/T_Theme.qml" line="162"/>
<source>dwm-blur</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Theme.qml" line="158"/>
<source>window tintOpacity</source>
@ -2290,11 +2572,6 @@ Some contents...</source>
<source>window effect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Theme.qml" line="178"/>
<source></source>
<translation></translation>
</message>
</context>
<context>
<name>T_TimePicker</name>
@ -2367,6 +2644,27 @@ Some contents...</source>
<source>clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Timeline.qml" line="130"/>
<source>mode:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Timeline.qml" line="137"/>
<source>Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Timeline.qml" line="144"/>
<source>Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Timeline.qml" line="135"/>
<location filename="qml/page/T_Timeline.qml" line="151"/>
<source>Alternate</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_ToggleSwitch</name>
@ -2434,49 +2732,60 @@ Some contents...</source>
<name>T_Tour</name>
<message>
<location filename="qml/page/T_Tour.qml" line="15"/>
<location filename="qml/page/T_Tour.qml" line="23"/>
<source>Upload File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="15"/>
<location filename="qml/page/T_Tour.qml" line="23"/>
<source>Put your files here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="16"/>
<location filename="qml/page/T_Tour.qml" line="52"/>
<location filename="qml/page/T_Tour.qml" line="54"/>
<location filename="qml/page/T_Tour.qml" line="24"/>
<location filename="qml/page/T_Tour.qml" line="74"/>
<location filename="qml/page/T_Tour.qml" line="76"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="16"/>
<location filename="qml/page/T_Tour.qml" line="24"/>
<source>Save your changes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="17"/>
<location filename="qml/page/T_Tour.qml" line="25"/>
<source>Other Actions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="17"/>
<location filename="qml/page/T_Tour.qml" line="25"/>
<source>Click to see other actions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="31"/>
<location filename="qml/page/T_Tour.qml" line="46"/>
<source>Begin Tour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="45"/>
<location filename="qml/page/T_Tour.qml" line="47"/>
<location filename="qml/page/T_Tour.qml" line="52"/>
<source>Begin Tour with custom indicator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="67"/>
<location filename="qml/page/T_Tour.qml" line="69"/>
<source>Upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="61"/>
<location filename="qml/page/T_Tour.qml" line="83"/>
<source>More</source>
<translation type="unfinished"></translation>
</message>
@ -2494,22 +2803,57 @@ Some contents...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="183"/>
<location filename="qml/page/T_TreeView.qml" line="92"/>
<source>cellHeight:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="105"/>
<source>depthPadding:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="121"/>
<source>showLine</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="126"/>
<source>checkable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="134"/>
<source>all expand</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="140"/>
<source>all collapse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="147"/>
<source>print selection model</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="182"/>
<source>Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="187"/>
<location filename="qml/page/T_TreeView.qml" line="186"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="191"/>
<location filename="qml/page/T_TreeView.qml" line="190"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="195"/>
<location filename="qml/page/T_TreeView.qml" line="194"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
@ -2521,6 +2865,41 @@ Some contents...</source>
<source>Typography</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Typography.qml" line="27"/>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Typography.qml" line="33"/>
<source>Title Large</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Typography.qml" line="39"/>
<source>Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Typography.qml" line="45"/>
<source>Subtitle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Typography.qml" line="51"/>
<source>Body Strong</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Typography.qml" line="57"/>
<source>Body</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Typography.qml" line="63"/>
<source>Caption</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Watermark</name>
@ -2529,5 +2908,45 @@ Some contents...</source>
<source>Watermark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="25"/>
<source>text:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="38"/>
<source>textSize:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="51"/>
<source>gapX:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="62"/>
<source>gapY:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="73"/>
<source>offsetX:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="84"/>
<source>offsetY:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="95"/>
<source>rotate:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Watermark.qml" line="108"/>
<source>textColor:</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"tintColor:"
text: qsTr("tintColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
@ -22,7 +22,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"tintOpacity:"
text: qsTr("tintOpacity:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -33,7 +33,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"blurRadius:"
text: qsTr("blurRadius:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -69,7 +69,7 @@ FluScrollablePage{
y:(image.height-height)/2
FluText {
anchors.centerIn: parent
text: "Acrylic"
text: qsTr("Acrylic")
color: "#FFFFFF"
font: FluTextStyle.Subtitle
}

View File

@ -26,7 +26,8 @@ FluScrollablePage{
width: parent.width
text: qsTr("It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed")
}
Row{
Flow{
width: parent.width
spacing: 20
Rectangle{
width: 40
@ -34,7 +35,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
topRight: true
position: "topRight"
showZero: true
count:0
}
@ -46,7 +47,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
topRight: true
position: "topRight"
showZero: true
count:5
}
@ -57,7 +58,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
topRight: true
position: "topRight"
showZero: true
count:50
}
@ -68,9 +69,10 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
topRight: true
position: "topRight"
showZero: true
count:100
count:1000
max: 999
}
}
Rectangle{
@ -79,7 +81,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
topRight: true
position: "topRight"
showZero: true
isDot:true
}
@ -90,7 +92,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
topRight: true
position: "topRight"
showZero: true
count:99
color: Qt.rgba(250/255,173/255,20/255,1)
@ -102,12 +104,71 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
topRight: true
position: "topRight"
showZero: true
count:99
color: Qt.rgba(82/255,196/255,26/255,1)
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
showZero: true
count:100
color: Qt.rgba(84/255,169/255,1,1)
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "bottomLeft"
showZero: true
count:100
color: Qt.rgba(84/255,169/255,1,1)
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topLeft"
showZero: true
count:100
color: Qt.rgba(84/255,169/255,1,1)
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "bottomRight"
showZero: true
count:100
color: Qt.rgba(84/255,169/255,1,1)
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
count: "NEW"
color: Qt.rgba(84/255,169/255,1,1)
}
}
}
}
}
@ -120,7 +181,9 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
count: 100
max: 99
isDot: false
color: Qt.rgba(82/255,196/255,26/255,1)
}

View File

@ -12,7 +12,7 @@ FluScrollablePage{
Component.onCompleted: {
var items = []
for(var i=0;i<10;i++){
items.push({title:"Item_"+(i+1)})
items.push({title: qsTr("Item_%1").arg(i+1)})
}
breadcrumb_1.items = items
breadcrumb_2.items = items
@ -51,7 +51,7 @@ FluScrollablePage{
onClicked:{
var items = []
for(var i=0;i<10;i++){
items.push({title:"Item_"+(i+1)})
items.push({title: qsTr("Item_")+(i+1)})
}
breadcrumb_2.items = items
}

View File

@ -219,7 +219,7 @@ FluScrollablePage{
FluLoadingButton{
id: btn_loading
loading: loading_button_switch.checked
text: qsTr("Loading Button")
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Loading Button")
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
@ -235,7 +235,7 @@ FluScrollablePage{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Loading")
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Normal")
}
}
CodeExpander{

View File

@ -45,7 +45,7 @@ FluScrollablePage{
Layout.preferredWidth: 240
}
FluButton{
text:"verify"
text: qsTr("verify")
onClicked: {
var success = captcha.verify(text_box.text)
if(success){

View File

@ -121,7 +121,6 @@ FluScrollablePage{
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
@ -140,6 +139,90 @@ FluScrollablePage{
Component.onCompleted: {
carousel.model = [{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}]
}
}'
}
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 300 + topPadding + bottomPadding
padding: 10
Layout.topMargin: 10
RowLayout{
anchors.fill: parent
Item{
Layout.preferredWidth: 400
Layout.fillHeight: true
FluShadow{
radius: 8
}
FluCarousel{
anchors.fill: parent
orientation: Qt.Vertical
autoPlay: auto_play_switch.checked
loopTime:1500
indicatorGravity: Qt.AlignVCenter | Qt.AlignRight
indicatorMarginTop:15
delegate: Component{
Item{
anchors.fill: parent
Image {
anchors.fill: parent
source: model.url
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Rectangle{
height: 40
width: parent.width
anchors.bottom: parent.bottom
color: "#33000000"
FluText{
anchors.fill: parent
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter
text:model.title
color: FluColors.Grey10
}
}
}
}
Layout.topMargin: 20
Layout.leftMargin: 5
Component.onCompleted: {
var arr = []
arr.push({url:"qrc:/example/res/image/banner_1.jpg",title:"共同应对全球性问题"})
arr.push({url:"qrc:/example/res/image/banner_2.jpg",title:"三小只全程没互动"})
arr.push({url:"qrc:/example/res/image/banner_3.jpg",title:"有效投资扩大 激发增长动能"})
model = arr
}
}
}
FluToggleSwitch{
id: auto_play_switch
Layout.alignment: Qt.AlignRight
text: qsTr("Auto play")
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluCarousel{
id:carousel
width: 400
height: 300
orientation: Qt.Vertical
delegate: Component{
Image {
anchors.fill: parent
source: model.url
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
}
Component.onCompleted: {
carousel.model = [{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}]
}
}'
}
}

View File

@ -17,15 +17,15 @@ FluScrollablePage{
spacing: 5
anchors.verticalCenter: parent.verticalCenter
FluText{
text: "editable=false"
text: qsTr("editable=false")
x:10
}
FluComboBox {
model: ListModel {
id: model_1
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: qsTr("Banana") }
ListElement { text: qsTr("Apple") }
ListElement { text: qsTr("Coconut") }
}
}
}
@ -40,16 +40,16 @@ FluScrollablePage{
spacing: 5
anchors.verticalCenter: parent.verticalCenter
FluText{
text: "disabled=true"
text: qsTr("disabled=true")
x:10
}
FluComboBox {
disabled: true
model: ListModel {
id: model_2
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: qsTr("Banana") }
ListElement { text: qsTr("Apple") }
ListElement { text: qsTr("Coconut") }
}
}
}
@ -64,16 +64,16 @@ FluScrollablePage{
spacing: 5
anchors.verticalCenter: parent.verticalCenter
FluText{
text: "editable=true"
text: qsTr("editable=true")
x:5
}
FluComboBox {
editable: true
model: ListModel {
id: model_3
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: qsTr("Banana") }
ListElement { text: qsTr("Apple") }
ListElement { text: qsTr("Coconut") }
}
onAccepted: {
if (find(editText) === -1)
@ -85,19 +85,21 @@ FluScrollablePage{
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluComboBox{
code:qsTr('FluComboBox{
editable: true
model: ListModel {
id: model
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement { text: "%1" }
ListElement { text: "%2" }
ListElement { text: "%3" }
}
onAccepted: {
if (find(editText) === -1)
model.append({text: editText})
}
}'
}').arg(qsTr("Banana"))
.arg(qsTr("Apple"))
.arg(qsTr("Coconut"))
}
}

View File

@ -105,5 +105,147 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
}'
}
FluFrame {
Layout.fillWidth: true
padding: 10
Layout.topMargin: 20
Column {
spacing: 15
FluExpander {
headerHeight: 60
contentHeight: content_layout.implicitHeight
headerDelegate: Component {
Item {
RowLayout {
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 15
}
spacing: 15
FluImage {
width: 20
height: 20
sourceSize.width: 20
sourceSize.height: 20
source: "qrc:/example/res/image/favicon.ico"
}
ColumnLayout {
spacing: 0
FluText {
text: "FluentUI"
}
FluText {
text: "%1".arg(AppInfo.version)
textColor: FluTheme.fontSecondaryColor
font.pixelSize: 12
}
}
}
FluLoadingButton {
id: btn_checkupdate
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: 15
}
text: qsTr("Check for Updates")
onClicked: {
loading = true;
FluEventBus.post("checkUpdate");
}
}
FluEvent {
name: "checkUpdateFinish"
onTriggered: {
btn_checkupdate.loading = false;
}
}
}
}
content: ColumnLayout {
id: content_layout
spacing: 0
RowLayout {
Layout.topMargin: 15
Layout.leftMargin: 15
spacing: 0
FluText {
text: "GitHub: "
}
FluTextButton {
text: "https://github.com/zhuzichu520/FluentUI"
onClicked: {
Qt.openUrlExternally(text);
}
}
}
RowLayout {
Layout.bottomMargin: 15
Layout.leftMargin: 15
spacing: 0
FluText {
text: "bilibili: "
}
FluTextButton {
text: "https://www.bilibili.com/video/BV1mg4y1M71w"
onClicked: {
Qt.openUrlExternally(text);
}
}
}
}
}
FluExpander {
contentHeight: 100
headerHeight: 45
headerDelegate: Component {
Item {
FluToggleButton {
anchors.centerIn: parent
text: qsTr("This is a ToggleButton in the header")
}
}
}
content: Item {
anchors.fill: parent
FluButton {
anchors.centerIn: parent
text: qsTr("This is a StandardButton in the content")
onClicked: {
showInfo(qsTr("Click StandardButton"))
}
}
}
}
}
}
CodeExpander {
Layout.fillWidth: true
Layout.topMargin: -6
code: 'FluExpander {
contentHeight: 100
headerHeight: 45
headerDelegate: Component {
Item {
FluToggleButton {
anchors.centerIn: parent
text: qsTr("This is a ToggleButton in the header")
}
}
}
content: Item {
anchors.fill: parent
FluButton {
anchors.centerIn: parent
text: qsTr("This is a StandardButton in the content")
onClicked: {
showInfo(qsTr("Click StandardButton"))
}
}
}
}'
}
}

View File

@ -36,13 +36,13 @@ FluScrollablePage{
}
}
FluButton{
text:"Error"
text: qsTr("Error")
onClicked: {
showError(qsTr("This is an InfoBar in the Error Style"))
}
}
FluButton{
text:"Success"
text: qsTr("Success")
onClicked: {
showSuccess(qsTr("This is an InfoBar in the Success Style"))
}
@ -61,34 +61,34 @@ FluScrollablePage{
Row{
spacing: 5
FluButton{
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info1")
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info1"))
onClicked: {
if(info1) {
info1.close()
return
}
info1 = showInfo(qsTr("This is an '%1'").arg("info1"), 0)
info1 = showInfo(qsTr("This is an '%1'").arg(qsTr("info1")), 0)
info1.close()
}
}
FluButton{
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info2")
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info2"))
onClicked: {
if(info2) {
info2.close()
return
}
info2 = showInfo(qsTr("This is an '%1'").arg("info2"), 0)
info2 = showInfo(qsTr("This is an '%1'").arg(qsTr("info2")), 0)
}
}
FluButton{
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info3")
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info3"))
onClicked: {
if(info3) {
info3.close()
return
}
info3 = showInfo(qsTr("This is an '%1'").arg("info3"), 0)
info3 = showInfo(qsTr("This is an '%1'").arg(qsTr("info3")), 0)
}
}
FluButton{
@ -100,7 +100,7 @@ FluScrollablePage{
}
FluButton{
text:"Loading"
text: qsTr("Loading")
onClicked: {
showLoading()
}

View File

@ -49,26 +49,26 @@ FluScrollablePage{
Layout.topMargin: -6
code:'FluPivot{
anchors.fill: parent
FluPivotItem:{
text: qsTr("All")
FluPivotItem {
title: qsTr("All")
contentItem: FluText{
text: qsTr("All emails go here.")
}
}
FluPivotItem:{
text: qsTr("Unread")
FluPivotItem {
title: qsTr("Unread")
contentItem: FluText{
text: qsTr("Unread emails go here.")
}
}
FluPivotItem:{
text: qsTr("Flagged")
FluPivotItem {
title: qsTr("Flagged")
contentItem: FluText{
text: qsTr("Flagged emails go here.")
}
}
FluPivotItem:{
text: qsTr("Urgent")
FluPivotItem {
title: qsTr("Urgent")
contentItem: FluText{
text: qsTr("Urgent emails go here.")
}

View File

@ -24,7 +24,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 20
FluText{
text:"text:"
text: qsTr("text:")
Layout.alignment: Qt.AlignVCenter
}
FluTextBox{
@ -38,7 +38,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 10
FluText{
text:"color:"
text: qsTr("color:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
@ -51,7 +51,7 @@ FluScrollablePage{
spacing: 10
Layout.topMargin: 10
FluText{
text:"bgColor:"
text: qsTr("bgColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
@ -63,7 +63,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"margins:"
text: qsTr("margins:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -77,7 +77,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text:"size:"
text: qsTr("size:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{

View File

@ -11,53 +11,71 @@ FluScrollablePage{
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 80
padding: 10
Column{
Flow{
width: parent.width
spacing: 15
anchors{
left: parent.left
verticalCenter: parent.verticalCenter
FluRectangle{
width: 50
height: 50
color:"#0078d4"
radius:[0,0,0,0]
}
RowLayout{
Layout.topMargin: 20
FluRectangle{
width: 50
height: 50
color:"#0078d4"
radius:[0,0,0,0]
}
FluRectangle{
width: 50
height: 50
color:"#744da9"
radius:[15,15,15,15]
}
FluRectangle{
width: 50
height: 50
color:"#ffeb3b"
radius:[15,0,0,0]
}
FluRectangle{
width: 50
height: 50
color:"#f7630c"
radius:[0,15,0,0]
}
FluRectangle{
width: 50
height: 50
color:"#e71123"
radius:[0,0,15,0]
}
FluRectangle{
width: 50
height: 50
color:"#b4009e"
radius:[0,0,0,15]
}
FluRectangle{
width: 50
height: 50
color:"#744da9"
radius:[15,15,15,15]
}
FluRectangle{
width: 50
height: 50
color:"#ffeb3b"
radius:[15,0,0,0]
}
FluRectangle{
width: 50
height: 50
color:"#f7630c"
radius:[0,15,0,0]
}
FluRectangle{
width: 50
height: 50
color:"#e71123"
radius:[0,0,15,0]
}
FluRectangle{
width: 50
height: 50
color:"#b4009e"
radius:[0,0,0,15]
}
FluRectangle{
width: 50
height: 50
color:"#a8d5ba"
radius:[15,15,15,15]
borderWidth: 3
borderColor: "#5b8a72"
}
FluRectangle{
width: 50
height: 50
color:"#dbe2ef"
radius:[15,0,0,0]
borderWidth: 2
borderColor: "#3f72af"
}
FluRectangle{
width: 50
height: 50
color:"#dbe2ef"
borderWidth: 2
borderColor: "#3f72af"
borderStyle: Qt.DashLine
dashPattern: [4,2]
}
}
}
@ -66,6 +84,10 @@ FluScrollablePage{
Layout.topMargin: -6
code:'FluRectangle{
radius: [25,25,25,25]
borderWidth: 2
borderColor: "#000000"
borderStyle: Qt.DashLine
dashPattern: [4,2]
width: 50
height: 50
}'

View File

@ -15,21 +15,21 @@ FluContentPage{
top: parent.top
}
FluText{
text:"orientation:"
text: qsTr("orientation:")
}
FluDropDownButton{
id:btn_orientation
Layout.preferredWidth: 120
text:"Horizontal"
text: qsTr("Horizontal")
FluMenuItem{
text:"Horizontal"
text: qsTr("Horizontal")
onClicked: {
btn_orientation.text = text
split_layout.orientation = Qt.Horizontal
}
}
FluMenuItem{
text:"Vertical"
text: qsTr("Vertical")
onClicked: {
btn_orientation.text = text
split_layout.orientation = Qt.Vertical
@ -54,7 +54,7 @@ FluContentPage{
SplitView.maximumWidth: 400
SplitView.maximumHeight: 400
FluText {
text: "Page 1"
text: qsTr("Page 1")
anchors.centerIn: parent
}
}
@ -66,7 +66,7 @@ FluContentPage{
SplitView.fillWidth: true
SplitView.fillHeight: true
FluText {
text: "Page 2"
text: qsTr("Page 2")
anchors.centerIn: parent
}
}
@ -75,7 +75,7 @@ FluContentPage{
implicitWidth: 200
implicitHeight: 200
FluText {
text: "Page 3"
text: qsTr("Page 3")
anchors.centerIn: parent
}
}

View File

@ -19,30 +19,30 @@ FluScrollablePage{
FluDropDownButton{
id:btn_status_mode
Layout.preferredWidth: 140
text:"Loading"
text: qsTr("Loading")
FluMenuItem{
text:"Loading"
text: qsTr("Loading")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Loading
}
}
FluMenuItem{
text:"Empty"
text: qsTr("Empty")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Empty
}
}
FluMenuItem{
text:"Error"
text: qsTr("Error")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Error
}
}
FluMenuItem{
text:"Success"
text: qsTr("Success")
onClicked: {
btn_status_mode.text = text
status_view.statusMode = FluStatusLayoutType.Success

View File

@ -35,52 +35,58 @@ FluScrollablePage{
padding: 10
RowLayout{
spacing: 14
FluCopyableText{
text: qsTr("Tab Width Behavior:")
}
FluDropDownButton{
id:btn_tab_width_behavior
Layout.preferredWidth: 140
text:"Equal"
text: qsTr("Equal")
FluMenuItem{
text:"Equal"
text: qsTr("Equal")
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabViewType.Equal
}
}
FluMenuItem{
text:"SizeToContent"
text: qsTr("SizeToContent")
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabViewType.SizeToContent
}
}
FluMenuItem{
text:"Compact"
text: qsTr("Compact")
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabViewType.Compact
}
}
}
FluCopyableText{
text: qsTr("Tab Close Button Visibility:")
}
FluDropDownButton{
id:btn_close_button_visibility
text:"Always"
text: qsTr("Always")
Layout.preferredWidth: 120
FluMenuItem{
text:"Never"
text: qsTr("Never")
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabViewType.Never
}
}
FluMenuItem{
text:"Always"
text: qsTr("Always")
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabViewType.Always
}
}
FluMenuItem{
text:"OnHover"
text: qsTr("OnHover")
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabViewType.OnHover

View File

@ -493,6 +493,7 @@ FluContentPage{
onRowsChanged: {
root.checkBoxChanged()
}
startRowIndex: (gagination.pageCurrent - 1) * gagination.__itemPerPage + 1
columnSource:[
{
title: table_view.customItem(com_column_checbox,{checked:true}),

View File

@ -114,18 +114,26 @@ FluScrollablePage{
placeholderText: qsTr("AutoSuggestBox")
items: generateRandomNames(100)
disabled: text_box_suggest_switch.checked
itemRows: 12
showSuggestWhenPressed: text_box_show_suggest_switch.checked
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
}
FluToggleSwitch{
id:text_box_suggest_switch
RowLayout{
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
}
text: qsTr("Disabled")
FluToggleSwitch{
id:text_box_show_suggest_switch
text: qsTr("Show suggest when pressed")
}
FluToggleSwitch{
id:text_box_suggest_switch
text: qsTr("Disabled")
}
}
}
CodeExpander{
@ -133,6 +141,9 @@ FluScrollablePage{
Layout.topMargin: -6
code:'FluAutoSuggestBox{
placeholderText: qsTr("AutoSuggestBox")
itemRows: 12
itemHeight: 38
showSuggestWhenPressed: false
}'
}

View File

@ -154,12 +154,12 @@ FluScrollablePage{
}
}
FluText{
visible: FluTheme.blurBehindWindowEnabled || window.effect === "dwm-blur"
visible: FluTheme.blurBehindWindowEnabled || window.effect === qsTr("dwm-blur")
text: qsTr("window tintOpacity")
Layout.topMargin: 20
}
FluSlider{
visible: FluTheme.blurBehindWindowEnabled || window.effect === "dwm-blur"
visible: FluTheme.blurBehindWindowEnabled || window.effect === qsTr("dwm-blur")
Layout.topMargin: 5
to:1
stepSize:0.1

View File

@ -127,28 +127,28 @@ FluScrollablePage{
RowLayout{
Layout.topMargin: 10
FluText{
text:"mode:"
text: qsTr("mode:")
}
FluDropDownButton{
id: btn_mode
Layout.preferredWidth: 100
text: "Alternate"
text: qsTr("Alternate")
FluMenuItem{
text: "Left"
text: qsTr("Left")
onClicked: {
btn_mode.text = text
time_line.mode = FluTimelineType.Left
}
}
FluMenuItem{
text: "Right"
text: qsTr("Right")
onClicked: {
btn_mode.text = text
time_line.mode = FluTimelineType.Right
}
}
FluMenuItem{
text: "Alternate"
text: qsTr("Alternate")
onClicked: {
btn_mode.text = text
time_line.mode = FluTimelineType.Alternate

View File

@ -17,20 +17,42 @@ FluScrollablePage{
{title:qsTr("Other Actions"),description: qsTr("Click to see other actions."),target:()=>btn_more}
]
}
FluTour{
id:tour_custom_indicator
steps:[
{title:qsTr("Upload File"),description: qsTr("Put your files here."),target:()=>btn_upload},
{title:qsTr("Save"),description: qsTr("Save your changes."),target:()=>btn_save},
{title:qsTr("Other Actions"),description: qsTr("Click to see other actions."),target:()=>btn_more}
]
indicator: Component{
FluText {
text: "%1 / %2".arg(current + 1).arg(total)
}
}
}
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 130
padding: 10
FluFilledButton{
Row{
anchors{
top: parent.top
topMargin: 14
}
text: qsTr("Begin Tour")
onClicked: {
tour.open()
spacing: 20
FluFilledButton{
text: qsTr("Begin Tour")
onClicked: {
tour.open()
}
}
FluFilledButton{
text: qsTr("Begin Tour with custom indicator")
onClicked: {
tour_custom_indicator.open()
}
}
}

View File

@ -9,7 +9,6 @@ FluContentPage {
title: qsTr("TreeView")
function treeData(){
const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
function getRandomName(){
@ -90,7 +89,7 @@ FluContentPage {
RowLayout{
spacing: 10
FluText{
text: "cellHeight:"
text: qsTr("cellHeight:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -103,7 +102,7 @@ FluContentPage {
RowLayout{
spacing: 10
FluText{
text: "depthPadding:"
text: qsTr("depthPadding:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -119,12 +118,12 @@ FluContentPage {
anchors.verticalCenter: parent.verticalCenter
FluToggleSwitch{
id: switch_showline
text:"showLine"
text: qsTr("showLine")
checked: false
}
FluToggleSwitch{
id: switch_checkable
text:"checkable"
text: qsTr("checkable")
checked: false
}
}
@ -132,20 +131,20 @@ FluContentPage {
spacing: 8
anchors.verticalCenter: parent.verticalCenter
FluButton{
text: "all expand"
text: qsTr("all expand")
onClicked: {
tree_view.allExpand()
}
}
FluButton{
text: "all collapse"
text: qsTr("all collapse")
onClicked: {
tree_view.allCollapse()
}
}
}
FluButton{
text: "print selection model"
text: qsTr("print selection model")
onClicked: {
var printData = []
var data = tree_view.selectionModel();

View File

@ -24,43 +24,43 @@ FluContentPage {
transformOrigin: Item.TopLeft
FluText{
id:text_Display
text:"Display"
text: qsTr("Display")
padding: 0
font: FluTextStyle.Display
}
FluText{
id:text_TitleLarge
text:"Title Large"
text: qsTr("Title Large")
padding: 0
font: FluTextStyle.TitleLarge
}
FluText{
id:text_Title
text:"Title"
text: qsTr("Title")
padding: 0
font: FluTextStyle.Title
}
FluText{
id:text_Subtitle
text:"Subtitle"
text: qsTr("Subtitle")
padding: 0
font: FluTextStyle.Subtitle
}
FluText{
id:text_BodyStrong
text:"Body Strong"
text: qsTr("Body Strong")
padding: 0
font: FluTextStyle.BodyStrong
}
FluText{
id:text_Body
text:"Body"
text: qsTr("Body")
padding: 0
font: FluTextStyle.Body
}
FluText{
id:text_Caption
text:"Caption"
text: qsTr("Caption")
padding: 0
font: FluTextStyle.Caption
}

View File

@ -22,7 +22,7 @@ FluContentPage{
spacing: 10
Layout.topMargin: 14
FluText{
text: "text:"
text: qsTr("text:")
Layout.alignment: Qt.AlignVCenter
}
FluTextBox{
@ -35,7 +35,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "textSize:"
text: qsTr("textSize:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -48,7 +48,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "gapX:"
text: qsTr("gapX:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -59,7 +59,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "gapY:"
text: qsTr("gapY:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -70,7 +70,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "offsetX:"
text: qsTr("offsetX:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -81,7 +81,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "offsetY:"
text: qsTr("offsetY:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -92,7 +92,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "rotate:"
text: qsTr("rotate:")
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -105,7 +105,7 @@ FluContentPage{
RowLayout{
spacing: 10
FluText{
text: "textColor:"
text: qsTr("textColor:")
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{

View File

@ -19,6 +19,9 @@ FluWindow {
Component.onCompleted: {
window.stayTop = true
}
Component.onDestruction: {
FluRouter.exit()
}
onInitArgument:
(argument)=>{

View File

@ -69,6 +69,8 @@ FluWindow {
window.show()
window.raise()
window.requestActivate()
}else if(reason === SystemTrayIcon.Context){
system_tray.menu.open()
}
}
}

View File

@ -90,7 +90,7 @@ int main(int argc, char *argv[]) {
engine.rootContext()->setContextProperty("TranslateHelper", TranslateHelper::getInstance());
engine.rootContext()->setContextProperty("Network", Network::getInstance());
#ifdef FLUENTUI_BUILD_STATIC_LIB
FluentUI::getInstance()->registerTypes(&engine);
FluentUI::registerTypes(&engine);
#endif
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
QObject::connect(

View File

@ -145,7 +145,7 @@ endif ()
if (QT_VERSION VERSION_GREATER_EQUAL "6.2")
#如果是Qt6.2版本以上则使用qt_add_libraryqt_add_qml_module函数添加资源文件
if (FLUENTUI_BUILD_STATIC_LIB)
set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/FluentUI)
set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/FluentUI)
endif ()
qt_add_library(${PROJECT_NAME} ${LIB_TYPE})
qt_add_qml_module(${PROJECT_NAME}

View File

@ -441,6 +441,9 @@ void FluFrameless::componentComplete() {
window()->setFlag(Qt::CustomizeWindowHint, true);
window()->setFlag(Qt::FramelessWindowHint, true);
window()->setProperty("__borderWidth", 1);
#endif
#ifdef Q_OS_WIN
window()->setFlag(Qt::CustomizeWindowHint, true);
#endif
window()->installEventFilter(this);
QGuiApplication::instance()->installNativeEventFilter(this);

View File

@ -2,33 +2,69 @@
#include <QPainterPath>
FluRectangle::FluRectangle(QQuickItem *parent) : QQuickPaintedItem(parent) {
color(QColor(255, 255, 255, 255));
color(Qt::white);
radius({0, 0, 0, 0});
borderWidth(0);
borderColor(Qt::black);
borderStyle(Qt::SolidLine);
dashPattern({});
connect(this, &FluRectangle::colorChanged, this, [=] { update(); });
connect(this, &FluRectangle::radiusChanged, this, [=] { update(); });
connect(this, &FluRectangle::borderWidthChanged, this, [=] { update(); });
connect(this, &FluRectangle::borderColorChanged, this, [=] { update(); });
connect(this, &FluRectangle::borderStyleChanged, this, [=] { update(); });
connect(this, &FluRectangle::dashPatternChanged, this, [=] { update(); });
}
bool FluRectangle::borderValid() const {
return qRound(_borderWidth) >= 1 && _color.isValid() && _color.alpha() > 0;
}
void FluRectangle::paint(QPainter *painter) {
painter->save();
painter->setRenderHint(QPainter::Antialiasing);
QPainterPath path;
QRectF rect = boundingRect();
path.moveTo(rect.bottomRight() - QPointF(0, _radius[2]));
path.lineTo(rect.topRight() + QPointF(0, _radius[1]));
path.arcTo(QRectF(QPointF(rect.topRight() - QPointF(_radius[1] * 2, 0)),
QSize(_radius[1] * 2, _radius[1] * 2)),
0, 90);
path.lineTo(rect.topLeft() + QPointF(_radius[0], 0));
path.arcTo(QRectF(QPointF(rect.topLeft()), QSize(_radius[0] * 2, _radius[0] * 2)), 90, 90);
path.lineTo(rect.bottomLeft() - QPointF(0, _radius[3]));
path.arcTo(QRectF(QPointF(rect.bottomLeft() - QPointF(0, _radius[3] * 2)),
QSize(_radius[3] * 2, _radius[3] * 2)),
180, 90);
path.lineTo(rect.bottomRight() - QPointF(_radius[2], 0));
path.arcTo(QRectF(QPointF(rect.bottomRight() - QPointF(_radius[2] * 2, _radius[2] * 2)),
QSize(_radius[2] * 2, _radius[2] * 2)),
270, 90);
bool drawBorder = borderValid();
if (drawBorder) {
// 绘制边框时画笔的宽度从路径向两侧扩充
// 因此实际绘制的矩形应向内侧收缩边框宽度的一半,避免边框裁剪导致不完整
qreal halfBorderWidth = _borderWidth / 2.0;
rect.adjust(halfBorderWidth, halfBorderWidth, -halfBorderWidth, -halfBorderWidth);
}
QPainterPath path;
QList<int> r = _radius;
while (r.size() < 4) {
r.append(0);
}
// 从右下角开始逆时针绘制圆角矩形路径
path.moveTo(rect.bottomRight() - QPointF(0, r[2]));
path.lineTo(rect.topRight() + QPointF(0, r[1]));
path.arcTo(QRectF(QPointF(rect.topRight() - QPointF(r[1] * 2, 0)), QSize(r[1] * 2, r[1] * 2)), 0, 90);
path.lineTo(rect.topLeft() + QPointF(r[0], 0));
path.arcTo(QRectF(QPointF(rect.topLeft()), QSize(r[0] * 2, r[0] * 2)), 90, 90);
path.lineTo(rect.bottomLeft() - QPointF(0, r[3]));
path.arcTo(QRectF(QPointF(rect.bottomLeft() - QPointF(0, r[3] * 2)), QSize(r[3] * 2, r[3] * 2)), 180, 90);
path.lineTo(rect.bottomRight() - QPointF(r[2], 0));
path.arcTo(QRectF(QPointF(rect.bottomRight() - QPointF(r[2] * 2, r[2] * 2)), QSize(r[2] * 2, r[2] * 2)), 270, 90);
// 填充背景
painter->fillPath(path, _color);
// 绘制边框
if (drawBorder) {
QPen pen(_borderColor, _borderWidth, _borderStyle);
if (_borderStyle == Qt::DashLine || _borderStyle == Qt::CustomDashLine) {
pen.setDashPattern(_dashPattern);
}
painter->strokePath(path, pen);
}
painter->restore();
}

View File

@ -12,9 +12,15 @@ class FluRectangle : public QQuickPaintedItem {
Q_OBJECT
Q_PROPERTY_AUTO(QColor, color)
Q_PROPERTY_AUTO(QList<int>, radius)
Q_PROPERTY_AUTO(qreal, borderWidth)
Q_PROPERTY_AUTO(QColor, borderColor)
Q_PROPERTY_AUTO(Qt::PenStyle, borderStyle)
Q_PROPERTY_AUTO(QVector<qreal>, dashPattern)
QML_NAMED_ELEMENT(FluRectangle)
public:
explicit FluRectangle(QQuickItem *parent = nullptr);
bool borderValid() const;
void paint(QPainter *painter) override;
};

View File

@ -282,7 +282,22 @@ QString FluTools::getWallpaperFilePath() {
auto path = result.mid(startIndex + 7, result.length() - startIndex - 8);
return path;
}
} else if (type == "ubuntu") {
QProcess process;
QStringList args;
args << "get";
args << "org.gnome.desktop.background";
args << "picture-uri";
process.start("gsettings", args);
process.waitForFinished();
QByteArray result = process.readAllStandardOutput().trimmed();
result = result.mid(1, result.length() - 2);
if (result.startsWith("file:///")) {
auto path = result.mid(7);
return path;
}
}
return {};
#elif defined(Q_OS_MACOS)
QProcess process;
QStringList args;

View File

@ -1,4 +1,4 @@
#include "FluTreeModel.h"
#include "FluTreeModel.h"
#include <QMetaEnum>
@ -107,7 +107,7 @@ void FluTreeModel::checkRow(int row, bool checked) {
void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) {
_dataSource.clear();
if (_root) {
delete _root;
_root->deleteLater();
_root = nullptr;
}
_root = new FluTreeNode(this);
@ -115,7 +115,7 @@ void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) {
while (data.count() > 0) {
auto item = data.at(data.count() - 1);
data.pop_back();
auto *node = new FluTreeNode(this);
auto *node = new FluTreeNode(_root);
node->_depth = item.value("__depth").toInt();
node->_parent = item.value("__parent").value<FluTreeNode *>();
node->_data = item;
@ -126,6 +126,7 @@ void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) {
node->_parent = _root;
_root->_children.append(node);
}
node->_checked = item.value("checked").toBool();
_dataSource.append(node);
if (item.contains("children")) {
QList<QVariant> children = item.value("children").toList();

View File

@ -23,12 +23,14 @@
#include "qmlcustomplot/ticker.h"
#include "qmlcustomplot/grid.h"
const char* FluentUI::_uri = "FluentUI";
void FluentUI::registerTypes(QQmlEngine *engine) {
initializeEngine(engine, _uri);
registerTypes(_uri);
}
void FluentUI::registerTypes(const char *uri) const {
void FluentUI::registerTypes(const char *uri) {
#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0))
Q_INIT_RESOURCE(fluentui);
int major = _major;

View File

@ -2,25 +2,22 @@
#include <QObject>
#include <QQmlEngine>
#include "singleton.h"
/**
* @brief The FluentUI class
*/
class FluentUI : public QObject {
Q_OBJECT
class FluentUI{
public:
SINGLETON(FluentUI)
Q_DECL_EXPORT void registerTypes(QQmlEngine *engine);
static Q_DECL_EXPORT void registerTypes(QQmlEngine *engine);
void registerTypes(const char *uri) const;
static void registerTypes(const char *uri);
void initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri);
static void initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri);
private:
const int _major = 1;
const int _minor = 0;
const char *_uri = "FluentUI";
static const int _major = 1;
static const int _minor = 0;
static const char *_uri;
};

View File

@ -7,9 +7,12 @@ FluTextBox{
property var items:[]
property string emptyText: qsTr("No results found")
property int autoSuggestBoxReplacement: FluentIcons.Search
property int itemHeight: 38
property int itemRows: 8
property bool showSuggestWhenPressed: false
property string textRole: "title"
property var filter: function(item){
if(item.title.indexOf(control.text)!==-1){
if(item[textRole].indexOf(control.text)!==-1){
return true
}
return false
@ -29,17 +32,11 @@ FluTextBox{
control.updateText(modelData[textRole])
}
function loadData(){
var result = []
if(items==null){
list_view.model = result
list_view.model = []
return
}
items.map(function(item){
if(control.filter(item)){
result.push(item)
}
})
list_view.model = result
list_view.model = items.filter(item => control.filter(item))
}
}
onActiveFocusChanged: {
@ -69,7 +66,7 @@ FluTextBox{
ScrollBar.vertical: FluScrollBar {}
header: Item{
width: control.width
height: visible ? 38 : 0
height: visible ? control.itemHeight : 0
visible: list_view.count === 0
FluText{
text: emptyText
@ -82,7 +79,7 @@ FluTextBox{
}
delegate:FluControl{
id: item_control
height: 38
height: control.itemHeight
width: control.width
onClicked: {
d.handleClick(modelData)
@ -114,7 +111,7 @@ FluTextBox{
background:Rectangle{
id: rect_background
implicitWidth: control.width
implicitHeight: 38*Math.min(Math.max(list_view.count,1),8)
implicitHeight: control.itemHeight*Math.min(Math.max(list_view.count,1),control.itemRows)
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)
@ -124,6 +121,14 @@ FluTextBox{
}
}
onTextChanged: {
control.showSuggest()
}
onPressed: {
if(control.showSuggestWhenPressed){
control.showSuggest()
}
}
function showSuggest(){
d.loadData()
if(d.flagVisible){
var pos = control.mapToItem(null, 0, 0)

View File

@ -5,19 +5,15 @@ import FluentUI 1.0
Rectangle{
property bool isDot: false
property bool showZero: false
property int count: 0
property bool topRight: false
property var count: 0
property int max: 99
property string position: "" // topLeft, topRight, bottomLeft, bottomRight
id:control
color:Qt.rgba(255/255,77/255,79/255,1)
width: {
if(isDot)
return 10
if(count<10){
return 20
}else if(count<100){
return 30
}
return 40
return content_text.implicitWidth + 12
}
height: {
if(isDot)
@ -31,49 +27,74 @@ Rectangle{
}
border.width: 1
border.color: Qt.rgba(1,1,1,1)
anchors{
anchors {
left: {
if(!parent){
return undefined
}
return (position === "topLeft" || position === "bottomLeft") ? parent.left : undefined
}
right: {
if(parent && topRight)
return parent.right
return undefined
if(!parent){
return undefined
}
return (position === "topRight" || position === "bottomRight") ? parent.right : undefined
}
top: {
if(parent && topRight)
return parent.top
return undefined
if(!parent){
return undefined
}
return (position === "topLeft" || position === "topRight") ? parent.top : undefined
}
bottom: {
if(!parent){
return undefined
}
return (position === "bottomLeft" || position === "bottomRight") ? parent.bottom : undefined
}
leftMargin: {
if(!parent){
return 0
}
return (position === "topLeft" || position === "bottomLeft") ? (isDot ? -2.5 : -(width / 2)) : 0
}
rightMargin: {
if(parent && topRight){
if(isDot){
return -2.5
}
return -(control.width/2)
if(!parent){
return 0
}
return 0
return (position === "topRight" || position === "bottomRight") ? (isDot ? -2.5 : -(width / 2)) : 0
}
topMargin: {
if(parent && topRight){
if(isDot){
return -2.5
}
return -10
if(!parent){
return 0
}
return 0
return (position === "topLeft" || position === "topRight") ? (isDot ? -2.5 : -10) : 0
}
bottomMargin: {
if(!parent){
return 0
}
return (position === "bottomLeft" || position === "bottomRight") ? (isDot ? -2.5 : -10) : 0
}
}
visible: {
if(showZero)
return true
return count!==0
if(typeof(count) === "number"){
return showZero ? true : count !== 0
}
return true
}
FluText{
id: content_text
anchors.centerIn: parent
color: Qt.rgba(1,1,1,1)
visible: !isDot
text:{
if(count<100)
if(typeof(count) === "string"){
return count
return "100+"
}else if(typeof(count) === "number"){
return count <= max ? count.toString() : "%1+".arg(max.toString())
}
return ""
}
}
}

View File

@ -4,6 +4,7 @@ import FluentUI 1.0
Item {
property bool autoPlay: true
property int orientation: Qt.Horizontal
property int loopTime: 2000
property var model
property Component delegate
@ -14,7 +15,7 @@ Item {
property int indicatorMarginTop: 0
property int indicatorMarginBottom: 20
property int indicatorSpacing: 10
property alias indicatorAnchors: layout_indicator.anchors
property alias indicatorAnchors: indicator_loader.anchors
property Component indicatorDelegate : com_indicator
id:control
width: 400
@ -24,13 +25,24 @@ Item {
}
QtObject{
id:d
property bool flagXChanged: true
property bool isManualMoving: false
property bool isAnimEnable: control.autoPlay && list_view.count>3
onIsAnimEnableChanged: {
if(isAnimEnable){
timer_run.restart()
}else{
timer_run.stop()
}
}
function setData(data){
if(!data){
if(!data || !Array.isArray(data)){
return
}
content_model.clear()
list_view.resetPos()
if(data.length === 0){
return
}
content_model.append(data[data.length-1])
content_model.append(data)
content_model.append(data[0])
@ -49,7 +61,7 @@ Item {
clip: true
boundsBehavior: ListView.StopAtBounds
model:content_model
maximumFlickVelocity: 4 * (list_view.orientation === Qt.Horizontal ? width : height)
maximumFlickVelocity: 4 * (control.orientation === Qt.Vertical ? height : width)
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
@ -63,7 +75,7 @@ Item {
d.setData(control.model)
}
}
orientation : ListView.Horizontal
orientation : control.orientation
delegate: Item{
id:item_control
width: ListView.view.width
@ -88,31 +100,63 @@ Item {
}
}
onMovementEnded:{
currentIndex = list_view.contentX/list_view.width
if(currentIndex === 0){
currentIndex = list_view.count-2
}else if(currentIndex === list_view.count-1){
currentIndex = 1
d.isManualMoving = false
list_view.highlightMoveDuration = 0
if(control.orientation === Qt.Vertical){
currentIndex = (list_view.contentY - list_view.originY) / list_view.height
if(currentIndex === 0){
currentIndex = list_view.count - 2
}else if(currentIndex === list_view.count - 1) {
currentIndex = 1
}
} else {
currentIndex = (list_view.contentX - list_view.originX) / list_view.width
if(currentIndex === 0){
currentIndex = list_view.count - 2
}else if(currentIndex === list_view.count - 1){
currentIndex = 1
}
}
if(d.isAnimEnable){
timer_run.restart()
}
d.flagXChanged = false
timer_run.restart()
}
onMovementStarted: {
d.flagXChanged = true
d.isManualMoving = true
timer_run.stop()
}
onContentXChanged: {
if(d.flagXChanged){
var maxX = Math.min(list_view.width*(currentIndex+1),list_view.count*list_view.width)
var minY = Math.max(0,(list_view.width*(currentIndex-1)))
if(contentX>=maxX){
contentX = maxX
if(d.isManualMoving && control.orientation === Qt.Horizontal){
const range = getPosRange(list_view.width, currentIndex)
if(contentX >= range.max){
contentX = range.max
}
if(contentX<=minY){
contentX = minY
if(contentX <= range.min){
contentX = range.min
}
}
}
onContentYChanged: {
if(d.isManualMoving && control.orientation === Qt.Vertical){
const range = getPosRange(list_view.height, currentIndex)
if(contentY >= range.max){
contentY = range.max
}
if(contentY <= range.min){
contentY = range.min
}
}
}
function resetPos() {
contentX = 0
contentY = 0
}
function getPosRange(size, index) {
return {
"min": Math.max(0, size * (index - 1)),
"max": Math.min(size * (index + 1), list_view.count * size)
}
}
}
Component{
id:com_indicator
@ -137,9 +181,9 @@ Item {
}
}
}
Row{
id:layout_indicator
spacing: control.indicatorSpacing
Loader{
id: indicator_loader
anchors{
horizontalCenter:(indicatorGravity & Qt.AlignHCenter) ? parent.horizontalCenter : undefined
verticalCenter: (indicatorGravity & Qt.AlignVCenter) ? parent.verticalCenter : undefined
@ -152,28 +196,66 @@ Item {
rightMargin: control.indicatorMarginBottom
topMargin: control.indicatorMarginBottom
}
visible: showIndicator
Repeater{
id:repeater_indicator
model: list_view.count
FluLoader{
property int displayIndex: {
if(index === 0)
return list_view.count-3
if(index === list_view.count-1)
return 0
return index-1
}
property int realIndex: index
property bool checked: list_view.currentIndex === index
sourceComponent: {
if(index===0 || index===list_view.count-1)
return undefined
return control.indicatorDelegate
active: showIndicator
sourceComponent: control.orientation === Qt.Vertical ? column_indicator : row_indicator
}
Component{
id: row_indicator
Row{
id:layout_indicator
spacing: control.indicatorSpacing
Repeater{
id:repeater_indicator
model: list_view.count
FluLoader{
property int displayIndex: {
if(index === 0)
return list_view.count-3
if(index === list_view.count-1)
return 0
return index-1
}
property int realIndex: index
property bool checked: list_view.currentIndex === index
sourceComponent: {
if(index===0 || index===list_view.count-1)
return undefined
return control.indicatorDelegate
}
}
}
}
}
Component{
id: column_indicator
Column{
id:layout_indicator
spacing: control.indicatorSpacing
Repeater{
id:repeater_indicator
model: list_view.count
FluLoader{
property int displayIndex: {
if(index === 0)
return list_view.count-3
if(index === list_view.count-1)
return 0
return index-1
}
property int realIndex: index
property bool checked: list_view.currentIndex === index
sourceComponent: {
if(index===0 || index===list_view.count-1)
return undefined
return control.indicatorDelegate
}
}
}
}
}
Timer{
id:timer_anim
interval: 250
@ -195,10 +277,10 @@ Item {
}
}
function changedIndex(index){
d.flagXChanged = true
d.isManualMoving = true
timer_run.stop()
list_view.currentIndex = index
d.flagXChanged = false
d.isManualMoving = false
if(d.isAnimEnable){
timer_run.restart()
}

View File

@ -47,6 +47,17 @@ Button{
implicitWidth: 326
implicitHeight: 560
closePolicy: Popup.CloseOnEscape
onClosed: {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
}
onOpened: {
layout_color_hue.updateColorText(current);
text_box_color.textEdited();
}
Rectangle{
id:layout_actions
width: parent.width
@ -148,7 +159,9 @@ Button{
if(color.a===1){
colorString = "FF"+colorString
}
text_box_color.text = colorString.toUpperCase()
if (!text_box_color.activeFocus) {
text_box_color.text = colorString.toUpperCase();
}
}
property color blackColor: {
var c = whiteColor
@ -279,6 +292,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
pickerCursor.x = Math.max(0,Math.min(mouse.x - colorHandleRadius,width-2*colorHandleRadius));
pickerCursor.y = Math.max(0,Math.min(mouse.y - colorHandleRadius,height-2*colorHandleRadius));
}
@ -369,6 +387,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
blackCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
blackCursor.y = 0
}
@ -438,6 +461,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
opacityCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
opacityCursor.y = 0
}
@ -472,7 +500,7 @@ Button{
id:text_box_color
width: 136
validator: RegularExpressionValidator {
regularExpression: /^[0-9A-F]{8}$/
regularExpression: /^[0-9A-Fa-f]{8}$/
}
anchors{
right: parent.right
@ -495,6 +523,11 @@ Button{
parseInt(colorString.substring(6, 8), 16) / 255,
parseInt(colorString.substring(0, 2), 16) / 255)
layout_color_hue.colorValue = c
layout_color_hue.updateColorText(c);
text_box_r.textEdited();
text_box_g.textEdited();
text_box_b.textEdited();
text_box_a.textEdited();
}
}
}

View File

@ -55,7 +55,7 @@ T.ComboBox {
font:control.font
readOnly: control.down
color: {
if(control.disabled) {
if(!control.enabled) {
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
}
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
@ -97,7 +97,7 @@ T.ComboBox {
anchors.margins: -2
}
color:{
if(disabled){
if(!enabled){
return disableColor
}
return hovered ? hoverColor :normalColor

View File

@ -178,7 +178,12 @@ FluButton {
}
if(type === 1){
text_month.text = model
let day = list_view_3.model[list_view_3.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
if(list_view_3.model.indexOf(day) === -1){
day = list_view_3.model[list_view_3.model.length - 1]
}
list_view_3.currentIndex = list_view_3.model.indexOf(day)
text_day.text = list_view_3.model[list_view_3.currentIndex]
}

View File

@ -5,6 +5,8 @@ import FluentUI 1.0
Item {
property string headerText: ""
property int headerHeight : 45
property Component headerDelegate: com_header
property bool expand: false
property int contentHeight : 300
default property alias content: container.data
@ -21,10 +23,23 @@ Item {
}
}
clip: true
Component {
id: com_header
Item {
FluText {
text: control.headerText
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 15
}
}
}
}
Rectangle{
id:layout_header
width: parent.width
height: 45
height: control.headerHeight
radius: 4
border.color: FluTheme.dividerColor
color: {
@ -41,15 +56,17 @@ Item {
d.toggle()
}
}
FluText{
text: headerText
anchors{
verticalCenter: parent.verticalCenter
FluLoader {
anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
leftMargin: 15
right: btn_toggle.left
}
sourceComponent: control.headerDelegate
}
FluIconButton{
id: btn_toggle
anchors{
verticalCenter: parent.verticalCenter
right: parent.right

View File

@ -6,7 +6,7 @@ T.MenuBarItem {
property bool disabled: false
property color textColor: {
if(FluTheme.dark){
if(disabled){
if(!enabled){
return Qt.rgba(131/255,131/255,131/255,1)
}
if(pressed){
@ -14,7 +14,7 @@ T.MenuBarItem {
}
return Qt.rgba(1,1,1,1)
}else{
if(disabled){
if(!enabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){

View File

@ -31,21 +31,15 @@ Page {
interactive: false
orientation: ListView.Horizontal
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
highlight: Item{
clip: true
Rectangle{
height: 3
radius: 1.5
color: FluTheme.primaryColor
width: nav_list.currentItem ? nav_list.currentItem.width : 0
width: nav_list.currentItem.width
y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
}
}
delegate: Button{

View File

@ -14,13 +14,6 @@ ProgressBar{
id:d
property real _radius: strokeWidth/2
}
onIndeterminateChanged:{
if(!indeterminate){
animator_x.duration = 0
rect_progress.x = 0
animator_x.duration = control.duration
}
}
background: Rectangle {
implicitWidth: 150
implicitHeight: control.strokeWidth
@ -45,6 +38,11 @@ ProgressBar{
id: animator_x
running: control.indeterminate && control.visible
loops: Animation.Infinite
onRunningChanged: {
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width

View File

@ -139,13 +139,13 @@ T.SpinBox {
radius: 4
border.width: 1
border.color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(73/255,73/255,73/255,1) : Qt.rgba(237/255,237/255,237/255,1)
}
return FluTheme.dark ? Qt.rgba(76/255,76/255,76/255,1) : Qt.rgba(240/255,240/255,240/255,1)
}
color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(contentItem.activeFocus){

View File

@ -17,6 +17,7 @@ Rectangle {
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 verticalHeaderVisible: true
property int startRowIndex: 1
property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
property alias view: table_view
@ -266,30 +267,18 @@ Rectangle {
d.rowHoverIndex = row
}
onWidthChanged: {
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
updatePosition()
}
onHeightChanged: {
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
updatePosition()
}
onXChanged: {
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
updatePosition()
}
onYChanged: {
updatePosition()
}
function updatePosition(){
if(editVisible){
updateEditPosition()
}
@ -310,9 +299,11 @@ Rectangle {
}
function updateTableItem(){
var columnModel = control.columnSource[column]
columnModel.x = item_table_mouse.x
columnModel.y = item_table_mouse.y
d.tableItemLayout(column)
if(columnModel.x !== item_table_mouse.x || columnModel.y !== item_table_mouse.y){
columnModel.x = item_table_mouse.x
columnModel.y = item_table_mouse.y
d.tableItemLayout(column)
}
}
Rectangle{
anchors.fill: parent
@ -352,6 +343,7 @@ Rectangle {
}
FluLoader{
id: item_table_loader
property var tableView: control
property var model: item_table_mouse._model
property var display: rowModel[columnModel.dataIndex]
property var rowModel : model.rowModel
@ -445,10 +437,6 @@ Rectangle {
}
}
onWidthChanged:{
table_view.forceLayout()
}
MouseArea{
id:layout_mouse_table
hoverEnabled: true
@ -479,6 +467,9 @@ Rectangle {
table_view.flick(0,1)
}
delegate: com_table_delegate
onWidthChanged: {
Qt.callLater(forceLayout)
}
}
}
@ -851,7 +842,13 @@ Rectangle {
Connections{
target: table_view
function onRowsChanged(){
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
header_vertical.updateRowIndex()
}
}
Connections {
target: control
function onStartRowIndexChanged(){
header_vertical.updateRowIndex()
}
}
Timer{
@ -861,6 +858,9 @@ Rectangle {
header_vertical.forceLayout()
}
}
function updateRowIndex(){
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+control.startRowIndex}))
}
}
Item{
anchors{
@ -955,18 +955,18 @@ Rectangle {
target: d
function onTableItemLayout(column){
if(item_layout_frozen._index === column){
updateLayout()
Qt.callLater(updateLayout)
}
}
}
Connections{
target: table_view
function onContentXChanged(){
updateLayout()
Qt.callLater(updateLayout)
}
}
function updateLayout(){
width = table_view.columnWidthProvider(_index)
width = Qt.binding(() => table_view.columnWidthProvider(_index))
x = Qt.binding(function(){
var minX = 0
var maxX = table_view.width-width

View File

@ -6,7 +6,7 @@ FluControlBackground{
property Item inputItem
id:control
color: {
if(inputItem && inputItem.disabled){
if(inputItem && !inputItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(inputItem && inputItem.activeFocus){

View File

@ -7,8 +7,10 @@ import FluentUI 1.0
Popup{
property var steps : []
property int targetMargins: 5
property int targetRadius: 2
property Component nextButton: com_next_button
property Component prevButton: com_prev_button
property Component indicator: com_indicator
property int index : 0
property string finishText: qsTr("Finish")
property string nextText: qsTr("Next")
@ -22,12 +24,12 @@ Popup{
contentItem: Item{}
onVisibleChanged: {
if(visible){
d.animationEnabled = false
control.index = 0
d.updatePos()
d.animationEnabled = true
}
}
onIndexChanged: {
canvas.requestPaint()
}
Component{
id: com_next_button
FluFilledButton{
@ -50,10 +52,32 @@ Popup{
}
}
}
Component{
id: com_indicator
Row{
spacing: 10
Repeater{
model: total
delegate: Rectangle{
width: 8
height: 8
radius: 4
scale: current === index ? 1.2 : 1
color:{
if(current === index){
return FluTheme.primaryColor
}
return FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
}
}
}
}
}
Item{
id:d
property var window: Window.window
property point pos: Qt.point(0,0)
property bool animationEnabled: true
property var step: steps[index]
property var target: {
if(steps[index]){
@ -73,15 +97,22 @@ Popup{
}
return control.width
}
function updatePos(){
if(d.target && d.window){
d.pos = d.target.mapToGlobal(0,0)
d.pos = Qt.point(d.pos.x-d.window.x,d.pos.y-d.window.y)
}
}
onTargetChanged: {
updatePos()
}
}
Connections{
target: d.window
function onWidthChanged(){
canvas.requestPaint()
timer_delay.restart()
}
function onHeightChanged(){
canvas.requestPaint()
timer_delay.restart()
}
}
@ -89,39 +120,128 @@ Popup{
id: timer_delay
interval: 200
onTriggered: {
canvas.requestPaint()
d.updatePos()
}
}
Canvas{
id: canvas
anchors.fill: parent
onPaint: {
d.pos = d.target.mapToGlobal(0,0)
d.pos = Qt.point(d.pos.x-d.window.x,d.pos.y-d.window.y)
var ctx = canvas.getContext("2d")
ctx.clearRect(0, 0, canvasSize.width, canvasSize.height)
ctx.save()
ctx.fillStyle = "#88000000"
ctx.fillRect(0, 0, canvasSize.width, canvasSize.height)
ctx.globalCompositeOperation = 'destination-out'
ctx.fillStyle = 'black'
var rect = Qt.rect(d.pos.x-control.targetMargins,d.pos.y-control.targetMargins, d.target.width+control.targetMargins*2, d.target.height+control.targetMargins*2)
drawRoundedRect(rect,2,ctx)
ctx.restore()
Item{
id: targetRect
x: d.pos.x - control.targetMargins
y: d.pos.y - control.targetMargins
width: d.target ? d.target.width + control.targetMargins * 2 : 0
height: d.target ? d.target.height + control.targetMargins * 2 : 0
Behavior on x {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
function drawRoundedRect(rect, r, ctx) {
ctx.beginPath();
ctx.moveTo(rect.x + r, rect.y);
ctx.lineTo(rect.x + rect.width - r, rect.y);
ctx.arcTo(rect.x + rect.width, rect.y, rect.x + rect.width, rect.y + r, r);
ctx.lineTo(rect.x + rect.width, rect.y + rect.height - r);
ctx.arcTo(rect.x + rect.width, rect.y + rect.height, rect.x + rect.width - r, rect.y + rect.height, r);
ctx.lineTo(rect.x + r, rect.y + rect.height);
ctx.arcTo(rect.x, rect.y + rect.height, rect.x, rect.y + rect.height - r, r);
ctx.lineTo(rect.x, rect.y + r);
ctx.arcTo(rect.x, rect.y, rect.x + r, rect.y, r);
ctx.closePath();
ctx.fill()
Behavior on y {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on width {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on height {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
}
Shape {
anchors.fill: parent
layer.enabled: true
layer.samples: 4
layer.smooth: true
ShapePath {
fillColor: "#88000000"
strokeWidth: 0
strokeColor: "transparent"
// draw background
PathMove {
x: 0
y: 0
}
PathLine {
x: control.width
y: 0
}
PathLine {
x: control.width
y: control.height
}
PathLine {
x: 0
y: control.height
}
PathLine {
x: 0
y: 0
}
// draw highlight
PathMove {
x: targetRect.x + control.targetRadius
y: targetRect.y
}
PathLine {
x: targetRect.x + targetRect.width - control.targetRadius
y: targetRect.y
}
PathArc {
x: targetRect.x + targetRect.width
y: targetRect.y + control.targetRadius
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
PathLine {
x: targetRect.x + targetRect.width
y: targetRect.y + targetRect.height - control.targetRadius
}
PathArc {
x: targetRect.x + targetRect.width - control.targetRadius
y: targetRect.y + targetRect.height
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
PathLine {
x: targetRect.x + control.targetRadius
y: targetRect.y + targetRect.height
}
PathArc {
x: targetRect.x
y: targetRect.y + targetRect.height - control.targetRadius
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
PathLine {
x: targetRect.x
y: targetRect.y + control.targetRadius
}
PathArc {
x: targetRect.x + control.targetRadius
y: targetRect.y
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
}
}
FluFrame{
@ -151,6 +271,18 @@ Popup{
return 0
}
border.width: 0
Behavior on x {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on y {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
FluShadow{
radius: 5
}
@ -193,10 +325,21 @@ Popup{
leftMargin: 15
}
}
FluLoader{
readonly property int total: steps.length
readonly property int current: control.index
sourceComponent: control.indicator
anchors{
bottom: parent.bottom
left: parent.left
bottomMargin: 15
leftMargin: 15
}
}
FluLoader{
id: loader_next
property bool isEnd: control.index === steps.length-1
sourceComponent: com_next_button
sourceComponent: control.nextButton
anchors{
top: text_desc.bottom
topMargin: 10
@ -207,7 +350,7 @@ Popup{
FluLoader{
id: loader_prev
visible: control.index !== 0
sourceComponent: com_prev_button
sourceComponent: control.prevButton
anchors{
right: loader_next.left
top: loader_next.top
@ -246,5 +389,17 @@ Popup{
}
return 0
}
Behavior on x {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on y {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
}
}

View File

@ -474,6 +474,7 @@ Rectangle {
}
return {}
}
active: rowModel !== undefined && rowModel !== null
sourceComponent: {
if(column === 0)
return com_column

View File

@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -nonrelocatable -noinstantiate FluentUI 1.0 F:/FluentUI/build/Desktop_Qt_5_15_2_MSVC2019_32bit-Release/src'
// 'qmlplugindump -nonrelocatable -noinstantiate FluentUI 1.0 E:/develop/QtCode/opensource/FluentUI/build/Desktop_Qt_5_15_2_MinGW_64_bit-Release/src'
Module {
dependencies: ["QtQuick 2.0"]
@ -231,6 +231,10 @@ Module {
exportMetaObjectRevisions: [0]
Property { name: "color"; type: "QColor" }
Property { name: "radius"; type: "QList<int>" }
Property { name: "borderWidth"; type: "double" }
Property { name: "borderColor"; type: "QColor" }
Property { name: "borderStyle"; type: "Qt::PenStyle" }
Property { name: "dashPattern"; type: "QVector<qreal>" }
}
Component {
name: "FluSheetType"
@ -2776,7 +2780,7 @@ Module {
}
Property {
name: "layoutMacosButtons"
type: "FluLoader_QMLTYPE_11"
type: "FluLoader_QMLTYPE_12"
isReadonly: true
isPointer: true
}
@ -2797,12 +2801,16 @@ Module {
Property { name: "items"; type: "QVariant" }
Property { name: "emptyText"; type: "string" }
Property { name: "autoSuggestBoxReplacement"; type: "int" }
Property { name: "itemHeight"; type: "int" }
Property { name: "itemRows"; type: "int" }
Property { name: "showSuggestWhenPressed"; type: "bool" }
Property { name: "textRole"; type: "string" }
Property { name: "filter"; type: "QVariant" }
Signal {
name: "itemClicked"
Parameter { name: "data"; type: "QVariant" }
}
Method { name: "showSuggest"; type: "QVariant" }
Method {
name: "updateText"
type: "QVariant"
@ -2830,8 +2838,9 @@ Module {
defaultProperty: "data"
Property { name: "isDot"; type: "bool" }
Property { name: "showZero"; type: "bool" }
Property { name: "count"; type: "int" }
Property { name: "topRight"; type: "bool" }
Property { name: "count"; type: "QVariant" }
Property { name: "max"; type: "int" }
Property { name: "position"; type: "string" }
}
Component {
prototype: "QQuickItem"
@ -2898,6 +2907,7 @@ Module {
isComposite: true
defaultProperty: "data"
Property { name: "autoPlay"; type: "bool" }
Property { name: "orientation"; type: "int" }
Property { name: "loopTime"; type: "int" }
Property { name: "model"; type: "QVariant" }
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
@ -2955,12 +2965,12 @@ Module {
Property { name: "checkedDisableColor"; type: "QColor" }
Property { name: "disableColor"; type: "QColor" }
Property { name: "size"; type: "double" }
Property { name: "textColor"; type: "QColor" }
Property { name: "textRight"; type: "bool" }
Property { name: "textSpacing"; type: "double" }
Property { name: "animationEnabled"; type: "bool" }
Property { name: "clickListener"; type: "QVariant" }
Property { name: "indeterminate"; type: "bool" }
Property { name: "textColor"; type: "QColor" }
}
Component {
prototype: "FluRectangle"
@ -3189,6 +3199,8 @@ Module {
isComposite: true
defaultProperty: "content"
Property { name: "headerText"; type: "string" }
Property { name: "headerHeight"; type: "int" }
Property { name: "headerDelegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "expand"; type: "bool" }
Property { name: "contentHeight"; type: "int" }
Property { name: "content"; type: "QObject"; isList: true; isReadonly: true }
@ -3469,15 +3481,15 @@ Module {
defaultProperty: "data"
Property { name: "logo"; type: "QUrl" }
Property { name: "title"; type: "string" }
Property { name: "items"; type: "FluObject_QMLTYPE_176"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_176"; isPointer: true }
Property { name: "items"; type: "FluObject_QMLTYPE_182"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_182"; isPointer: true }
Property { name: "displayMode"; type: "int" }
Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true }
Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "topPadding"; type: "int" }
Property { name: "pageMode"; type: "int" }
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_48"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_48"; isPointer: true }
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_49"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_49"; isPointer: true }
Property { name: "navCompactWidth"; type: "int" }
Property { name: "navTopMargin"; type: "int" }
Property { name: "cellHeight"; type: "int" }
@ -3676,6 +3688,7 @@ Module {
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "content"
Property { name: "textHighlightColor"; type: "QColor" }
Property { name: "textNormalColor"; type: "QColor" }
Property { name: "textHoverColor"; type: "QColor" }
Property { name: "textSpacing"; type: "int" }
@ -3772,11 +3785,11 @@ Module {
Property { name: "normalColor"; type: "QColor" }
Property { name: "hoverColor"; type: "QColor" }
Property { name: "disableColor"; type: "QColor" }
Property { name: "textColor"; type: "QColor" }
Property { name: "size"; type: "double" }
Property { name: "textRight"; type: "bool" }
Property { name: "textSpacing"; type: "double" }
Property { name: "clickListener"; type: "QVariant" }
Property { name: "textColor"; type: "QColor" }
}
Component {
prototype: "QQuickItem"
@ -3899,7 +3912,9 @@ Module {
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "content"
Property { name: "autoResetScroll"; type: "bool" }
Property { name: "content"; type: "QObject"; isList: true; isReadonly: true }
Method { name: "resetScroll"; type: "QVariant" }
Property { name: "launchMode"; type: "int" }
Property { name: "animationEnabled"; type: "bool" }
Property { name: "url"; type: "string" }
@ -4079,6 +4094,7 @@ Module {
Property { name: "borderColor"; type: "QColor" }
Property { name: "horizonalHeaderVisible"; type: "bool" }
Property { name: "verticalHeaderVisible"; type: "bool" }
Property { name: "startRowIndex"; type: "int" }
Property { name: "selectedBorderColor"; type: "QColor" }
Property { name: "selectedColor"; type: "QColor" }
Property { name: "columnWidthProvider"; type: "QVariant" }
@ -4294,8 +4310,8 @@ Module {
Property { name: "dotDisableColor"; type: "QColor" }
Property { name: "textSpacing"; type: "double" }
Property { name: "textRight"; type: "bool" }
Property { name: "clickListener"; type: "QVariant" }
Property { name: "textColor"; type: "QColor" }
Property { name: "clickListener"; type: "QVariant" }
}
Component {
prototype: "QQuickToolTip"
@ -4314,8 +4330,10 @@ Module {
defaultProperty: "contentData"
Property { name: "steps"; type: "QVariant" }
Property { name: "targetMargins"; type: "int" }
Property { name: "targetRadius"; type: "int" }
Property { name: "nextButton"; type: "QQmlComponent"; isPointer: true }
Property { name: "prevButton"; type: "QQmlComponent"; isPointer: true }
Property { name: "indicator"; type: "QQmlComponent"; isPointer: true }
Property { name: "index"; type: "int" }
Property { name: "finishText"; type: "string" }
Property { name: "nextText"; type: "string" }
@ -4379,7 +4397,6 @@ Module {
Property { name: "fitsAppBarWindows"; type: "bool" }
Property { name: "tintOpacity"; type: "QVariant" }
Property { name: "blurRadius"; type: "int" }
Property { name: "availableEffects"; type: "QVariant"; isReadonly: true }
Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
Property { name: "backgroundColor"; type: "QColor" }
Property { name: "stayTop"; type: "bool" }
@ -4403,6 +4420,7 @@ Module {
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "effect"; type: "string" }
Property { name: "effective"; type: "bool"; isReadonly: true }
Property { name: "availableEffects"; type: "QStringList"; isReadonly: true }
Signal {
name: "initArgument"
Parameter { name: "argument"; type: "QVariant" }
@ -4485,7 +4503,6 @@ Module {
Property { name: "fitsAppBarWindows"; type: "bool" }
Property { name: "tintOpacity"; type: "QVariant" }
Property { name: "blurRadius"; type: "int" }
Property { name: "availableEffects"; type: "QVariant"; isReadonly: true }
Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
Property { name: "backgroundColor"; type: "QColor" }
Property { name: "stayTop"; type: "bool" }
@ -4509,6 +4526,7 @@ Module {
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "effect"; type: "string" }
Property { name: "effective"; type: "bool"; isReadonly: true }
Property { name: "availableEffects"; type: "QStringList"; isReadonly: true }
Signal {
name: "initArgument"
Parameter { name: "argument"; type: "QVariant" }

View File

@ -6,9 +6,12 @@ FluTextBox{
property var items:[]
property string emptyText: qsTr("No results found")
property int autoSuggestBoxReplacement: FluentIcons.Search
property int itemHeight: 38
property int itemRows: 8
property bool showSuggestWhenPressed: false
property string textRole: "title"
property var filter: function(item){
if(item.title.indexOf(control.text)!==-1){
if(item[textRole].indexOf(control.text)!==-1){
return true
}
return false
@ -28,17 +31,11 @@ FluTextBox{
control.updateText(modelData[textRole])
}
function loadData(){
var result = []
if(items==null){
list_view.model = result
list_view.model = []
return
}
items.map(function(item){
if(control.filter(item)){
result.push(item)
}
})
list_view.model = result
list_view.model = items.filter(item => control.filter(item))
}
}
onActiveFocusChanged: {
@ -68,7 +65,7 @@ FluTextBox{
ScrollBar.vertical: FluScrollBar {}
header: Item{
width: control.width
height: visible ? 38 : 0
height: visible ? control.itemHeight : 0
visible: list_view.count === 0
FluText{
text: emptyText
@ -81,7 +78,7 @@ FluTextBox{
}
delegate:FluControl{
id: item_control
height: 38
height: control.itemHeight
width: control.width
onClicked: {
d.handleClick(modelData)
@ -113,7 +110,7 @@ FluTextBox{
background:Rectangle{
id: rect_background
implicitWidth: control.width
implicitHeight: 38*Math.min(Math.max(list_view.count,1),8)
implicitHeight: control.itemHeight*Math.min(Math.max(list_view.count,1),control.itemRows)
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)
@ -123,6 +120,14 @@ FluTextBox{
}
}
onTextChanged: {
control.showSuggest()
}
onPressed: {
if(control.showSuggestWhenPressed){
control.showSuggest()
}
}
function showSuggest(){
d.loadData()
if(d.flagVisible){
var pos = control.mapToItem(null, 0, 0)

View File

@ -5,19 +5,15 @@ import FluentUI
Rectangle{
property bool isDot: false
property bool showZero: false
property int count: 0
property bool topRight: false
property var count: 0
property int max: 99
property string position: "" // topLeft, topRight, bottomLeft, bottomRight
id:control
color:Qt.rgba(255/255,77/255,79/255,1)
width: {
if(isDot)
return 10
if(count<10){
return 20
}else if(count<100){
return 30
}
return 40
return content_text.implicitWidth + 12
}
height: {
if(isDot)
@ -31,49 +27,74 @@ Rectangle{
}
border.width: 1
border.color: Qt.rgba(1,1,1,1)
anchors{
anchors {
left: {
if(!parent){
return undefined
}
return (position === "topLeft" || position === "bottomLeft") ? parent.left : undefined
}
right: {
if(parent && topRight)
return parent.right
return undefined
if(!parent){
return undefined
}
return (position === "topRight" || position === "bottomRight") ? parent.right : undefined
}
top: {
if(parent && topRight)
return parent.top
return undefined
if(!parent){
return undefined
}
return (position === "topLeft" || position === "topRight") ? parent.top : undefined
}
bottom: {
if(!parent){
return undefined
}
return (position === "bottomLeft" || position === "bottomRight") ? parent.bottom : undefined
}
leftMargin: {
if(!parent){
return 0
}
return (position === "topLeft" || position === "bottomLeft") ? (isDot ? -2.5 : -(width / 2)) : 0
}
rightMargin: {
if(parent && topRight){
if(isDot){
return -2.5
}
return -(control.width/2)
if(!parent){
return 0
}
return 0
return (position === "topRight" || position === "bottomRight") ? (isDot ? -2.5 : -(width / 2)) : 0
}
topMargin: {
if(parent && topRight){
if(isDot){
return -2.5
}
return -10
if(!parent){
return 0
}
return 0
return (position === "topLeft" || position === "topRight") ? (isDot ? -2.5 : -10) : 0
}
bottomMargin: {
if(!parent){
return 0
}
return (position === "bottomLeft" || position === "bottomRight") ? (isDot ? -2.5 : -10) : 0
}
}
visible: {
if(showZero)
return true
return count!==0
if(typeof(count) === "number"){
return showZero ? true : count !== 0
}
return true
}
FluText{
id: content_text
anchors.centerIn: parent
color: Qt.rgba(1,1,1,1)
visible: !isDot
text:{
if(count<100)
if(typeof(count) === "string"){
return count
return "100+"
}else if(typeof(count) === "number"){
return count <= max ? count.toString() : "%1+".arg(max.toString())
}
return ""
}
}
}

View File

@ -4,6 +4,7 @@ import FluentUI
Item {
property bool autoPlay: true
property int orientation: Qt.Horizontal
property int loopTime: 2000
property var model
property Component delegate
@ -14,7 +15,7 @@ Item {
property int indicatorMarginTop: 0
property int indicatorMarginBottom: 20
property int indicatorSpacing: 10
property alias indicatorAnchors: layout_indicator.anchors
property alias indicatorAnchors: indicator_loader.anchors
property Component indicatorDelegate : com_indicator
id:control
width: 400
@ -24,13 +25,24 @@ Item {
}
QtObject{
id:d
property bool flagXChanged: true
property bool isManualMoving: false
property bool isAnimEnable: control.autoPlay && list_view.count>3
onIsAnimEnableChanged: {
if(isAnimEnable){
timer_run.restart()
}else{
timer_run.stop()
}
}
function setData(data){
if(!data){
if(!data || !Array.isArray(data)){
return
}
content_model.clear()
list_view.resetPos()
if(data.length === 0){
return
}
content_model.append(data[data.length-1])
content_model.append(data)
content_model.append(data[0])
@ -49,7 +61,7 @@ Item {
clip: true
boundsBehavior: ListView.StopAtBounds
model:content_model
maximumFlickVelocity: 4 * (list_view.orientation === Qt.Horizontal ? width : height)
maximumFlickVelocity: 4 * (control.orientation === Qt.Vertical ? height : width)
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
@ -63,7 +75,7 @@ Item {
d.setData(control.model)
}
}
orientation : ListView.Horizontal
orientation : control.orientation
delegate: Item{
id:item_control
width: ListView.view.width
@ -88,31 +100,63 @@ Item {
}
}
onMovementEnded:{
currentIndex = list_view.contentX/list_view.width
if(currentIndex === 0){
currentIndex = list_view.count-2
}else if(currentIndex === list_view.count-1){
currentIndex = 1
d.isManualMoving = false
list_view.highlightMoveDuration = 0
if(control.orientation === Qt.Vertical){
currentIndex = (list_view.contentY - list_view.originY) / list_view.height
if(currentIndex === 0){
currentIndex = list_view.count - 2
}else if(currentIndex === list_view.count - 1) {
currentIndex = 1
}
} else {
currentIndex = (list_view.contentX - list_view.originX) / list_view.width
if(currentIndex === 0){
currentIndex = list_view.count - 2
}else if(currentIndex === list_view.count - 1){
currentIndex = 1
}
}
if(d.isAnimEnable){
timer_run.restart()
}
d.flagXChanged = false
timer_run.restart()
}
onMovementStarted: {
d.flagXChanged = true
d.isManualMoving = true
timer_run.stop()
}
onContentXChanged: {
if(d.flagXChanged){
var maxX = Math.min(list_view.width*(currentIndex+1),list_view.count*list_view.width)
var minY = Math.max(0,(list_view.width*(currentIndex-1)))
if(contentX>=maxX){
contentX = maxX
if(d.isManualMoving && control.orientation === Qt.Horizontal){
const range = getPosRange(list_view.width, currentIndex)
if(contentX >= range.max){
contentX = range.max
}
if(contentX<=minY){
contentX = minY
if(contentX <= range.min){
contentX = range.min
}
}
}
onContentYChanged: {
if(d.isManualMoving && control.orientation === Qt.Vertical){
const range = getPosRange(list_view.height, currentIndex)
if(contentY >= range.max){
contentY = range.max
}
if(contentY <= range.min){
contentY = range.min
}
}
}
function resetPos() {
contentX = 0
contentY = 0
}
function getPosRange(size, index) {
return {
"min": Math.max(0, size * (index - 1)),
"max": Math.min(size * (index + 1), list_view.count * size)
}
}
}
Component{
id:com_indicator
@ -137,9 +181,9 @@ Item {
}
}
}
Row{
id:layout_indicator
spacing: control.indicatorSpacing
Loader{
id: indicator_loader
anchors{
horizontalCenter:(indicatorGravity & Qt.AlignHCenter) ? parent.horizontalCenter : undefined
verticalCenter: (indicatorGravity & Qt.AlignVCenter) ? parent.verticalCenter : undefined
@ -152,28 +196,66 @@ Item {
rightMargin: control.indicatorMarginBottom
topMargin: control.indicatorMarginBottom
}
visible: showIndicator
Repeater{
id:repeater_indicator
model: list_view.count
FluLoader{
property int displayIndex: {
if(index === 0)
return list_view.count-3
if(index === list_view.count-1)
return 0
return index-1
}
property int realIndex: index
property bool checked: list_view.currentIndex === index
sourceComponent: {
if(index===0 || index===list_view.count-1)
return undefined
return control.indicatorDelegate
active: showIndicator
sourceComponent: control.orientation === Qt.Vertical ? column_indicator : row_indicator
}
Component{
id: row_indicator
Row{
id:layout_indicator
spacing: control.indicatorSpacing
Repeater{
id:repeater_indicator
model: list_view.count
FluLoader{
property int displayIndex: {
if(index === 0)
return list_view.count-3
if(index === list_view.count-1)
return 0
return index-1
}
property int realIndex: index
property bool checked: list_view.currentIndex === index
sourceComponent: {
if(index===0 || index===list_view.count-1)
return undefined
return control.indicatorDelegate
}
}
}
}
}
Component{
id: column_indicator
Column{
id:layout_indicator
spacing: control.indicatorSpacing
Repeater{
id:repeater_indicator
model: list_view.count
FluLoader{
property int displayIndex: {
if(index === 0)
return list_view.count-3
if(index === list_view.count-1)
return 0
return index-1
}
property int realIndex: index
property bool checked: list_view.currentIndex === index
sourceComponent: {
if(index===0 || index===list_view.count-1)
return undefined
return control.indicatorDelegate
}
}
}
}
}
Timer{
id:timer_anim
interval: 250
@ -195,10 +277,10 @@ Item {
}
}
function changedIndex(index){
d.flagXChanged = true
d.isManualMoving = true
timer_run.stop()
list_view.currentIndex = index
d.flagXChanged = false
d.isManualMoving = false
if(d.isAnimEnable){
timer_run.restart()
}

View File

@ -48,6 +48,17 @@ Button{
implicitWidth: 326
implicitHeight: 560
closePolicy: Popup.CloseOnEscape
onClosed: {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
}
onOpened: {
layout_color_hue.updateColorText(current);
text_box_color.textEdited();
}
Rectangle{
id:layout_actions
width: parent.width
@ -149,7 +160,9 @@ Button{
if(color.a===1){
colorString = "FF"+colorString
}
text_box_color.text = colorString.toUpperCase()
if (!text_box_color.activeFocus) {
text_box_color.text = colorString.toUpperCase();
}
}
property color blackColor: {
var c = whiteColor
@ -280,6 +293,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
pickerCursor.x = Math.max(0,Math.min(mouse.x - colorHandleRadius,width-2*colorHandleRadius));
pickerCursor.y = Math.max(0,Math.min(mouse.y - colorHandleRadius,height-2*colorHandleRadius));
}
@ -370,6 +388,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
blackCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
blackCursor.y = 0
}
@ -439,6 +462,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
opacityCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
opacityCursor.y = 0
}
@ -473,7 +501,7 @@ Button{
id:text_box_color
width: 136
validator: RegularExpressionValidator {
regularExpression: /^[0-9A-F]{8}$/
regularExpression: /^[0-9A-Fa-f]{8}$/
}
anchors{
right: parent.right
@ -496,6 +524,11 @@ Button{
parseInt(colorString.substring(6, 8), 16) / 255,
parseInt(colorString.substring(0, 2), 16) / 255)
layout_color_hue.colorValue = c
layout_color_hue.updateColorText(c);
text_box_r.textEdited();
text_box_g.textEdited();
text_box_b.textEdited();
text_box_a.textEdited();
}
}
}

View File

@ -55,7 +55,7 @@ T.ComboBox {
font:control.font
readOnly: control.down
color: {
if(control.disabled) {
if(!control.enabled) {
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
}
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
@ -97,7 +97,7 @@ T.ComboBox {
anchors.margins: -2
}
color:{
if(disabled){
if(!enabled){
return disableColor
}
return hovered ? hoverColor :normalColor

View File

@ -178,7 +178,12 @@ FluButton {
}
if(type === 1){
text_month.text = model
let day = list_view_3.model[list_view_3.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
if(list_view_3.model.indexOf(day) === -1){
day = list_view_3.model[list_view_3.model.length - 1]
}
list_view_3.currentIndex = list_view_3.model.indexOf(day)
text_day.text = list_view_3.model[list_view_3.currentIndex]
}

View File

@ -5,6 +5,8 @@ import FluentUI
Item {
property string headerText: ""
property int headerHeight : 45
property Component headerDelegate: com_header
property bool expand: false
property int contentHeight : 300
default property alias content: container.data
@ -21,10 +23,23 @@ Item {
}
}
clip: true
Component {
id: com_header
Item {
FluText {
text: control.headerText
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 15
}
}
}
}
Rectangle{
id:layout_header
width: parent.width
height: 45
height: control.headerHeight
radius: 4
border.color: FluTheme.dividerColor
color: {
@ -41,15 +56,17 @@ Item {
d.toggle()
}
}
FluText{
text: headerText
anchors{
verticalCenter: parent.verticalCenter
FluLoader {
anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
leftMargin: 15
right: btn_toggle.left
}
sourceComponent: control.headerDelegate
}
FluIconButton{
id: btn_toggle
anchors{
verticalCenter: parent.verticalCenter
right: parent.right

View File

@ -7,7 +7,7 @@ T.MenuBarItem {
property bool disabled: false
property color textColor: {
if(FluTheme.dark){
if(disabled){
if(!enabled){
return Qt.rgba(131/255,131/255,131/255,1)
}
if(pressed){
@ -15,7 +15,7 @@ T.MenuBarItem {
}
return Qt.rgba(1,1,1,1)
}else{
if(disabled){
if(!enabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){

View File

@ -32,21 +32,15 @@ Page {
interactive: false
orientation: ListView.Horizontal
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
highlight: Item{
clip: true
Rectangle{
height: 3
radius: 1.5
color: FluTheme.primaryColor
width: nav_list.currentItem ? nav_list.currentItem.width : 0
width: nav_list.currentItem.width
y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
}
}
delegate: Button{

View File

@ -15,13 +15,6 @@ ProgressBar{
id:d
property real _radius: strokeWidth/2
}
onIndeterminateChanged:{
if(!indeterminate){
animator_x.duration = 0
rect_progress.x = 0
animator_x.duration = control.duration
}
}
background: Rectangle {
implicitWidth: 150
implicitHeight: control.strokeWidth
@ -46,6 +39,11 @@ ProgressBar{
id: animator_x
running: control.indeterminate && control.visible
loops: Animation.Infinite
onRunningChanged: {
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width

View File

@ -140,13 +140,13 @@ T.SpinBox {
radius: 4
border.width: 1
border.color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(73/255,73/255,73/255,1) : Qt.rgba(237/255,237/255,237/255,1)
}
return FluTheme.dark ? Qt.rgba(76/255,76/255,76/255,1) : Qt.rgba(240/255,240/255,240/255,1)
}
color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(contentItem.activeFocus){

View File

@ -17,6 +17,7 @@ Rectangle {
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 verticalHeaderVisible: true
property int startRowIndex: 1
property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
property alias view: table_view
@ -266,30 +267,18 @@ Rectangle {
d.rowHoverIndex = row
}
onWidthChanged: {
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
updatePosition()
}
onHeightChanged: {
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
updatePosition()
}
onXChanged: {
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
updatePosition()
}
onYChanged: {
updatePosition()
}
function updatePosition(){
if(editVisible){
updateEditPosition()
}
@ -310,9 +299,11 @@ Rectangle {
}
function updateTableItem(){
var columnModel = control.columnSource[column]
columnModel.x = item_table_mouse.x
columnModel.y = item_table_mouse.y
d.tableItemLayout(column)
if(columnModel.x !== item_table_mouse.x || columnModel.y !== item_table_mouse.y){
columnModel.x = item_table_mouse.x
columnModel.y = item_table_mouse.y
d.tableItemLayout(column)
}
}
Rectangle{
anchors.fill: parent
@ -352,6 +343,7 @@ Rectangle {
}
FluLoader{
id: item_table_loader
property var tableView: control
property var model: item_table_mouse._model
property var display: rowModel[columnModel.dataIndex]
property var rowModel : model.rowModel
@ -445,10 +437,6 @@ Rectangle {
}
}
onWidthChanged:{
table_view.forceLayout()
}
MouseArea{
id:layout_mouse_table
hoverEnabled: true
@ -479,6 +467,9 @@ Rectangle {
table_view.flick(0,1)
}
delegate: com_table_delegate
onWidthChanged: {
Qt.callLater(forceLayout)
}
}
}
@ -851,7 +842,13 @@ Rectangle {
Connections{
target: table_view
function onRowsChanged(){
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
header_vertical.updateRowIndex()
}
}
Connections {
target: control
function onStartRowIndexChanged(){
header_vertical.updateRowIndex()
}
}
Timer{
@ -861,6 +858,9 @@ Rectangle {
header_vertical.forceLayout()
}
}
function updateRowIndex(){
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+control.startRowIndex}))
}
}
Item{
anchors{
@ -955,18 +955,18 @@ Rectangle {
target: d
function onTableItemLayout(column){
if(item_layout_frozen._index === column){
updateLayout()
Qt.callLater(updateLayout)
}
}
}
Connections{
target: table_view
function onContentXChanged(){
updateLayout()
Qt.callLater(updateLayout)
}
}
function updateLayout(){
width = table_view.columnWidthProvider(_index)
width = Qt.binding(() => table_view.columnWidthProvider(_index))
x = Qt.binding(function(){
var minX = 0
var maxX = table_view.width-width

View File

@ -6,7 +6,7 @@ FluControlBackground{
property Item inputItem
id:control
color: {
if(inputItem && inputItem.disabled){
if(inputItem && !inputItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(inputItem && inputItem.activeFocus){

View File

@ -7,8 +7,10 @@ import FluentUI
Popup{
property var steps : []
property int targetMargins: 5
property int targetRadius: 2
property Component nextButton: com_next_button
property Component prevButton: com_prev_button
property Component indicator: com_indicator
property int index : 0
property string finishText: qsTr("Finish")
property string nextText: qsTr("Next")
@ -22,12 +24,12 @@ Popup{
contentItem: Item{}
onVisibleChanged: {
if(visible){
d.animationEnabled = false
control.index = 0
d.updatePos()
d.animationEnabled = true
}
}
onIndexChanged: {
canvas.requestPaint()
}
Component{
id: com_next_button
FluFilledButton{
@ -50,10 +52,32 @@ Popup{
}
}
}
Component{
id: com_indicator
Row{
spacing: 10
Repeater{
model: total
delegate: Rectangle{
width: 8
height: 8
radius: 4
scale: current === index ? 1.2 : 1
color:{
if(current === index){
return FluTheme.primaryColor
}
return FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
}
}
}
}
}
Item{
id:d
property var window: Window.window
property point pos: Qt.point(0,0)
property bool animationEnabled: true
property var step: steps[index]
property var target: {
if(steps[index]){
@ -73,15 +97,22 @@ Popup{
}
return control.width
}
function updatePos(){
if(d.target && d.window){
d.pos = d.target.mapToGlobal(0,0)
d.pos = Qt.point(d.pos.x-d.window.x,d.pos.y-d.window.y)
}
}
onTargetChanged: {
updatePos()
}
}
Connections{
target: d.window
function onWidthChanged(){
canvas.requestPaint()
timer_delay.restart()
}
function onHeightChanged(){
canvas.requestPaint()
timer_delay.restart()
}
}
@ -89,39 +120,128 @@ Popup{
id: timer_delay
interval: 200
onTriggered: {
canvas.requestPaint()
d.updatePos()
}
}
Canvas{
id: canvas
anchors.fill: parent
onPaint: {
d.pos = d.target.mapToGlobal(0,0)
d.pos = Qt.point(d.pos.x-d.window.x,d.pos.y-d.window.y)
var ctx = canvas.getContext("2d")
ctx.clearRect(0, 0, canvasSize.width, canvasSize.height)
ctx.save()
ctx.fillStyle = "#88000000"
ctx.fillRect(0, 0, canvasSize.width, canvasSize.height)
ctx.globalCompositeOperation = 'destination-out'
ctx.fillStyle = 'black'
var rect = Qt.rect(d.pos.x-control.targetMargins,d.pos.y-control.targetMargins, d.target.width+control.targetMargins*2, d.target.height+control.targetMargins*2)
drawRoundedRect(rect,2,ctx)
ctx.restore()
Item{
id: targetRect
x: d.pos.x - control.targetMargins
y: d.pos.y - control.targetMargins
width: d.target ? d.target.width + control.targetMargins * 2 : 0
height: d.target ? d.target.height + control.targetMargins * 2 : 0
Behavior on x {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
function drawRoundedRect(rect, r, ctx) {
ctx.beginPath();
ctx.moveTo(rect.x + r, rect.y);
ctx.lineTo(rect.x + rect.width - r, rect.y);
ctx.arcTo(rect.x + rect.width, rect.y, rect.x + rect.width, rect.y + r, r);
ctx.lineTo(rect.x + rect.width, rect.y + rect.height - r);
ctx.arcTo(rect.x + rect.width, rect.y + rect.height, rect.x + rect.width - r, rect.y + rect.height, r);
ctx.lineTo(rect.x + r, rect.y + rect.height);
ctx.arcTo(rect.x, rect.y + rect.height, rect.x, rect.y + rect.height - r, r);
ctx.lineTo(rect.x, rect.y + r);
ctx.arcTo(rect.x, rect.y, rect.x + r, rect.y, r);
ctx.closePath();
ctx.fill()
Behavior on y {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on width {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on height {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
}
Shape {
anchors.fill: parent
layer.enabled: true
layer.samples: 4
layer.smooth: true
ShapePath {
fillColor: "#88000000"
strokeWidth: 0
strokeColor: "transparent"
// draw background
PathMove {
x: 0
y: 0
}
PathLine {
x: control.width
y: 0
}
PathLine {
x: control.width
y: control.height
}
PathLine {
x: 0
y: control.height
}
PathLine {
x: 0
y: 0
}
// draw highlight
PathMove {
x: targetRect.x + control.targetRadius
y: targetRect.y
}
PathLine {
x: targetRect.x + targetRect.width - control.targetRadius
y: targetRect.y
}
PathArc {
x: targetRect.x + targetRect.width
y: targetRect.y + control.targetRadius
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
PathLine {
x: targetRect.x + targetRect.width
y: targetRect.y + targetRect.height - control.targetRadius
}
PathArc {
x: targetRect.x + targetRect.width - control.targetRadius
y: targetRect.y + targetRect.height
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
PathLine {
x: targetRect.x + control.targetRadius
y: targetRect.y + targetRect.height
}
PathArc {
x: targetRect.x
y: targetRect.y + targetRect.height - control.targetRadius
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
PathLine {
x: targetRect.x
y: targetRect.y + control.targetRadius
}
PathArc {
x: targetRect.x + control.targetRadius
y: targetRect.y
radiusX: control.targetRadius
radiusY: control.targetRadius
useLargeArc: false
direction: PathArc.Clockwise
}
}
}
FluFrame{
@ -151,6 +271,18 @@ Popup{
return 0
}
border.width: 0
Behavior on x {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on y {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
FluShadow{
radius: 5
}
@ -193,10 +325,21 @@ Popup{
leftMargin: 15
}
}
FluLoader{
readonly property int total: steps.length
readonly property int current: control.index
sourceComponent: control.indicator
anchors{
bottom: parent.bottom
left: parent.left
bottomMargin: 15
leftMargin: 15
}
}
FluLoader{
id: loader_next
property bool isEnd: control.index === steps.length-1
sourceComponent: com_next_button
sourceComponent: control.nextButton
anchors{
top: text_desc.bottom
topMargin: 10
@ -207,7 +350,7 @@ Popup{
FluLoader{
id: loader_prev
visible: control.index !== 0
sourceComponent: com_prev_button
sourceComponent: control.prevButton
anchors{
right: loader_next.left
top: loader_next.top
@ -246,5 +389,17 @@ Popup{
}
return 0
}
Behavior on x {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
Behavior on y {
enabled: d.animationEnabled && FluTheme.animationEnabled
NumberAnimation {
duration: 167
}
}
}
}

View File

@ -474,6 +474,7 @@ Rectangle {
}
return {}
}
active: rowModel !== undefined && rowModel !== null
sourceComponent: {
if(column === 0)
return com_column

View File

@ -355,8 +355,8 @@
<context>
<name>FluWindow</name>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="375"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="374"/>
<source>Loading...</source>
<translation type="unfinished"></translation>
</message>

View File

@ -355,8 +355,8 @@
<context>
<name>FluWindow</name>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="375"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="374"/>
<source>Loading...</source>
<translation type="unfinished">...</translation>
</message>

View File

@ -5,9 +5,9 @@
FluentUIPlugin::FluentUIPlugin() = default;
void FluentUIPlugin::registerTypes(const char *uri) {
FluentUI::getInstance()->registerTypes(uri);
FluentUI::registerTypes(uri);
}
void FluentUIPlugin::initializeEngine(QQmlEngine *engine, const char *uri) {
FluentUI::getInstance()->initializeEngine(engine, uri);
FluentUI::initializeEngine(engine, uri);
}