Compare commits

..

2 Commits

Author SHA1 Message Date
f4def3a183 Merge 875bba2bd6 into c9e0732f99 2024-11-17 15:11:59 +08:00
875bba2bd6 修复icon按钮,单选按钮等控件disable后,控件文本仍然高亮问题
为flutext 和 fluicon增加disable时的alpha值,简化其他控件中对text的disable时颜色的独立控制
2024-11-06 10:13:07 +08:00
97 changed files with 784 additions and 2928 deletions

View File

@ -69,11 +69,6 @@ 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
View File

@ -1,20 +0,0 @@
{
"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,5 +1,3 @@
# 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 Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network Widgets)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network)
#添加国际化脚本
find_program(QT_LUPDATE NAMES lupdate lupdate-qt6)
@ -141,7 +141,6 @@ 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="53"/>
<location filename="qml/window/CrashWindow.qml" line="50"/>
<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="65"/>
<location filename="qml/window/CrashWindow.qml" line="62"/>
<source>Report Logs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/CrashWindow.qml" line="75"/>
<location filename="qml/window/CrashWindow.qml" line="72"/>
<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="88"/>
<location filename="qml/window/MainWindow.qml" line="96"/>
<location filename="qml/window/MainWindow.qml" line="86"/>
<location filename="qml/window/MainWindow.qml" line="94"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="89"/>
<location filename="qml/window/MainWindow.qml" line="87"/>
<source>Are you sure you want to exit the program?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="90"/>
<location filename="qml/window/MainWindow.qml" line="88"/>
<source>Minimize</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="93"/>
<location filename="qml/window/MainWindow.qml" line="91"/>
<source>Friendly Reminder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="93"/>
<location filename="qml/window/MainWindow.qml" line="91"/>
<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="97"/>
<location filename="qml/window/MainWindow.qml" line="339"/>
<location filename="qml/window/MainWindow.qml" line="95"/>
<location filename="qml/window/MainWindow.qml" line="337"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="108"/>
<location filename="qml/window/MainWindow.qml" line="106"/>
<source>Open in Separate Window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="205"/>
<location filename="qml/window/MainWindow.qml" line="203"/>
<source>Click Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="215"/>
<location filename="qml/window/MainWindow.qml" line="213"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="304"/>
<location filename="qml/window/MainWindow.qml" line="302"/>
<source>Finish</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="305"/>
<location filename="qml/window/MainWindow.qml" line="303"/>
<source>Next</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="306"/>
<location filename="qml/window/MainWindow.qml" line="304"/>
<source>Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="310"/>
<location filename="qml/window/MainWindow.qml" line="308"/>
<source>Dark Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="310"/>
<location filename="qml/window/MainWindow.qml" line="308"/>
<source>Here you can switch to night mode.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="312"/>
<location filename="qml/window/MainWindow.qml" line="310"/>
<source>Hide Easter eggs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="312"/>
<location filename="qml/window/MainWindow.qml" line="310"/>
<source>Try a few more clicks!!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="336"/>
<location filename="qml/window/MainWindow.qml" line="334"/>
<source>Upgrade Tips</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="337"/>
<location filename="qml/window/MainWindow.qml" line="335"/>
<source>FluentUI is currently up to date </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="337"/>
<location filename="qml/window/MainWindow.qml" line="335"/>
<source> -- The current app version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="337"/>
<location filename="qml/window/MainWindow.qml" line="335"/>
<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="340"/>
<location filename="qml/window/MainWindow.qml" line="338"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="367"/>
<location filename="qml/window/MainWindow.qml" line="365"/>
<source>The current version is already the latest</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/window/MainWindow.qml" line="374"/>
<location filename="qml/window/MainWindow.qml" line="372"/>
<source>The network is abnormal</source>
<translation type="unfinished"></translation>
</message>
@ -831,25 +831,9 @@ 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>
@ -879,22 +863,11 @@ 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>
@ -929,7 +902,7 @@ Updated content:
<location filename="qml/page/T_Buttons.qml" line="199"/>
<location filename="qml/page/T_Buttons.qml" line="320"/>
<location filename="qml/page/T_Buttons.qml" line="368"/>
<location filename="qml/page/T_Buttons.qml" line="419"/>
<location filename="qml/page/T_Buttons.qml" line="422"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
@ -969,16 +942,10 @@ 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>
@ -1050,17 +1017,17 @@ Updated content:
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Buttons.qml" line="404"/>
<location filename="qml/page/T_Buttons.qml" line="405"/>
<source>Radio Button_1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Buttons.qml" line="407"/>
<location filename="qml/page/T_Buttons.qml" line="409"/>
<source>Radio Button_2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Buttons.qml" line="410"/>
<location filename="qml/page/T_Buttons.qml" line="413"/>
<source>Radio Button_3</source>
<translation type="unfinished"></translation>
</message>
@ -1095,11 +1062,6 @@ 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>
@ -1123,11 +1085,6 @@ 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>
@ -1201,62 +1158,6 @@ 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>
@ -1413,26 +1314,6 @@ 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>
@ -1540,12 +1421,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="28"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="61"/>
<location filename="qml/page/T_Icons.qml" line="51"/>
<source>You Copied </source>
<translation type="unfinished"></translation>
</message>
@ -1591,21 +1467,11 @@ 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>
@ -1637,7 +1503,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&apos;</source>
<source>show &apos;%1</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -1647,34 +1513,11 @@ 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>
@ -1949,31 +1792,6 @@ 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>
@ -2215,37 +2033,6 @@ 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>
@ -2262,27 +2049,6 @@ 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>
@ -2296,48 +2062,6 @@ 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>
@ -2368,7 +2092,7 @@ Some contents...</source>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="504"/>
<location filename="qml/page/T_TableView.qml" line="503"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
@ -2418,37 +2142,37 @@ Some contents...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="509"/>
<location filename="qml/page/T_TableView.qml" line="508"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="523"/>
<location filename="qml/page/T_TableView.qml" line="522"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="531"/>
<location filename="qml/page/T_TableView.qml" line="530"/>
<source>Nickname</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="538"/>
<location filename="qml/page/T_TableView.qml" line="537"/>
<source>Long String</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="546"/>
<location filename="qml/page/T_TableView.qml" line="545"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="564"/>
<location filename="qml/page/T_TableView.qml" line="563"/>
<source>&lt;Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="565"/>
<location filename="qml/page/T_TableView.qml" line="564"/>
<source>Next&gt;</source>
<translation type="unfinished"></translation>
</message>
@ -2461,15 +2185,10 @@ Some contents...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Text.qml" line="19"/>
<location filename="qml/page/T_Text.qml" line="18"/>
<source>This is a text that can be copied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Text.qml" line="29"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_TextBox</name>
@ -2487,8 +2206,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="135"/>
<location filename="qml/page/T_TextBox.qml" line="168"/>
<location filename="qml/page/T_TextBox.qml" line="128"/>
<location filename="qml/page/T_TextBox.qml" line="157"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
@ -2507,11 +2226,6 @@ 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>
@ -2551,12 +2265,6 @@ 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>
@ -2572,6 +2280,11 @@ 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>
@ -2644,27 +2357,6 @@ 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>
@ -2732,60 +2424,49 @@ 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="24"/>
<location filename="qml/page/T_Tour.qml" line="74"/>
<location filename="qml/page/T_Tour.qml" line="76"/>
<location filename="qml/page/T_Tour.qml" line="52"/>
<location filename="qml/page/T_Tour.qml" line="54"/>
<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="46"/>
<location filename="qml/page/T_Tour.qml" line="31"/>
<source>Begin Tour</source>
<translation type="unfinished"></translation>
</message>
<message>
<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"/>
<location filename="qml/page/T_Tour.qml" line="45"/>
<location filename="qml/page/T_Tour.qml" line="47"/>
<source>Upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Tour.qml" line="83"/>
<location filename="qml/page/T_Tour.qml" line="61"/>
<source>More</source>
<translation type="unfinished"></translation>
</message>
@ -2803,57 +2484,22 @@ Some contents...</source>
<translation type="unfinished"></translation>
</message>
<message>
<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"/>
<location filename="qml/page/T_TreeView.qml" line="183"/>
<source>Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="186"/>
<location filename="qml/page/T_TreeView.qml" line="187"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="190"/>
<location filename="qml/page/T_TreeView.qml" line="191"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="194"/>
<location filename="qml/page/T_TreeView.qml" line="195"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
@ -2865,41 +2511,6 @@ 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>
@ -2908,45 +2519,5 @@ 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: qsTr("tintColor:")
text:"tintColor:"
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
@ -22,7 +22,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text: qsTr("tintOpacity:")
text:"tintOpacity:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -33,7 +33,7 @@ FluScrollablePage{
RowLayout{
spacing: 10
FluText{
text: qsTr("blurRadius:")
text:"blurRadius:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -69,7 +69,7 @@ FluScrollablePage{
y:(image.height-height)/2
FluText {
anchors.centerIn: parent
text: qsTr("Acrylic")
text: "Acrylic"
color: "#FFFFFF"
font: FluTextStyle.Subtitle
}

View File

@ -26,8 +26,7 @@ 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")
}
Flow{
width: parent.width
Row{
spacing: 20
Rectangle{
width: 40
@ -35,7 +34,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
topRight: true
showZero: true
count:0
}
@ -47,7 +46,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
topRight: true
showZero: true
count:5
}
@ -58,7 +57,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
topRight: true
showZero: true
count:50
}
@ -69,10 +68,9 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
topRight: true
showZero: true
count:1000
max: 999
count:100
}
}
Rectangle{
@ -81,7 +79,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
topRight: true
showZero: true
isDot:true
}
@ -92,7 +90,7 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
topRight: true
showZero: true
count:99
color: Qt.rgba(250/255,173/255,20/255,1)
@ -104,71 +102,12 @@ FluScrollablePage{
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
position: "topRight"
topRight: true
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)
}
}
}
}
}
@ -181,9 +120,7 @@ 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: qsTr("Item_%1").arg(i+1)})
items.push({title:"Item_"+(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: qsTr("Item_")+(i+1)})
items.push({title:"Item_"+(i+1)})
}
breadcrumb_2.items = items
}

View File

@ -1,4 +1,4 @@
import QtQuick 2.15
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
@ -219,7 +219,7 @@ FluScrollablePage{
FluLoadingButton{
id: btn_loading
loading: loading_button_switch.checked
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Loading Button")
text: qsTr("Loading Button")
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
@ -235,7 +235,7 @@ FluScrollablePage{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Normal")
text: qsTr("Loading")
}
}
CodeExpander{
@ -265,7 +265,7 @@ FluScrollablePage{
}
FluIconButton{
disabled: icon_button_switch.checked
iconDelegate: Image{ sourceSize: Qt.size(40,40) ; width: 20; height: 20; source: "qrc:/example/res/image/ic_home_github.png" }
iconDelegate: FluImage{ sourceSize: Qt.size(40,40) ; width: 20; height: 20; source: "qrc:/example/res/image/ic_home_github.png" }
onClicked:{
showSuccess(qsTr("Click IconButton"))
}
@ -395,18 +395,21 @@ FluScrollablePage{
Layout.topMargin: 20
FluRadioButtons{
spacing: 8
disabled: radio_button_switch.checked
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
disabled: radio_button_switch.checked
FluRadioButton{
disabled:radio_button_switch.checked
text: qsTr("Radio Button_1")
}
FluRadioButton{
disabled:radio_button_switch.checked
text: qsTr("Radio Button_2")
}
FluRadioButton{
disabled:radio_button_switch.checked
text: qsTr("Radio Button_3")
}
}

View File

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

View File

@ -121,89 +121,7 @@ FluScrollablePage{
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluCarousel{
id:carousel
width: 400
height: 300
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"}]
}
}'
}
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
@ -211,7 +129,6 @@ FluScrollablePage{
id:carousel
width: 400
height: 300
orientation: Qt.Vertical
delegate: Component{
Image {
anchors.fill: parent

View File

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

View File

@ -105,147 +105,5 @@ 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

@ -18,15 +18,6 @@ FluContentPage {
grid_view.model = FluApp.iconData(text_box.text)
}
}
FluToggleSwitch{
id: toggle_switch
anchors{
left: text_box.right
verticalCenter: text_box.verticalCenter
leftMargin: 10
}
text: qsTr("Disabled")
}
GridView{
id: grid_view
cellWidth: 110
@ -54,7 +45,6 @@ FluContentPage {
horizontalPadding: 0
bottomPadding: 30
anchors.fill: parent
disabled: toggle_switch.checked
onClicked: {
var text ="FluentIcons."+modelData.name;
FluTools.clipText(text)
@ -67,7 +57,6 @@ FluContentPage {
text: modelData.name
anchors.top: parent.top
anchors.topMargin: 60
enabled: !toggle_switch.checked
}
}
}

View File

@ -36,13 +36,13 @@ FluScrollablePage{
}
}
FluButton{
text: qsTr("Error")
text:"Error"
onClicked: {
showError(qsTr("This is an InfoBar in the Error Style"))
}
}
FluButton{
text: qsTr("Success")
text:"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(qsTr("info1"))
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info1")
onClicked: {
if(info1) {
info1.close()
return
}
info1 = showInfo(qsTr("This is an '%1'").arg(qsTr("info1")), 0)
info1 = showInfo(qsTr("This is an '%1'").arg("info1"), 0)
info1.close()
}
}
FluButton{
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info2"))
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info2")
onClicked: {
if(info2) {
info2.close()
return
}
info2 = showInfo(qsTr("This is an '%1'").arg(qsTr("info2")), 0)
info2 = showInfo(qsTr("This is an '%1'").arg("info2"), 0)
}
}
FluButton{
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info3"))
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info3")
onClicked: {
if(info3) {
info3.close()
return
}
info3 = showInfo(qsTr("This is an '%1'").arg(qsTr("info3")), 0)
info3 = showInfo(qsTr("This is an '%1'").arg("info3"), 0)
}
}
FluButton{
@ -100,7 +100,7 @@ FluScrollablePage{
}
FluButton{
text: qsTr("Loading")
text:"Loading"
onClicked: {
showLoading()
}

View File

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

View File

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

View File

@ -11,71 +11,53 @@ FluScrollablePage{
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 80
padding: 10
Flow{
width: parent.width
Column{
spacing: 15
FluRectangle{
width: 50
height: 50
color:"#0078d4"
radius:[0,0,0,0]
anchors{
left: parent.left
verticalCenter: parent.verticalCenter
}
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]
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]
}
}
}
}
@ -84,10 +66,6 @@ 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: qsTr("orientation:")
text:"orientation:"
}
FluDropDownButton{
id:btn_orientation
Layout.preferredWidth: 120
text: qsTr("Horizontal")
text:"Horizontal"
FluMenuItem{
text: qsTr("Horizontal")
text:"Horizontal"
onClicked: {
btn_orientation.text = text
split_layout.orientation = Qt.Horizontal
}
}
FluMenuItem{
text: qsTr("Vertical")
text:"Vertical"
onClicked: {
btn_orientation.text = text
split_layout.orientation = Qt.Vertical
@ -54,7 +54,7 @@ FluContentPage{
SplitView.maximumWidth: 400
SplitView.maximumHeight: 400
FluText {
text: qsTr("Page 1")
text: "Page 1"
anchors.centerIn: parent
}
}
@ -66,7 +66,7 @@ FluContentPage{
SplitView.fillWidth: true
SplitView.fillHeight: true
FluText {
text: qsTr("Page 2")
text: "Page 2"
anchors.centerIn: parent
}
}
@ -75,7 +75,7 @@ FluContentPage{
implicitWidth: 200
implicitHeight: 200
FluText {
text: qsTr("Page 3")
text: "Page 3"
anchors.centerIn: parent
}
}

View File

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

View File

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

View File

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

View File

@ -15,19 +15,10 @@ FluScrollablePage{
padding: 10
FluCopyableText{
enabled: !toggle_switch.checked
text: qsTr("This is a text that can be copied")
anchors.verticalCenter: parent.verticalCenter
}
FluToggleSwitch{
id: toggle_switch
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
}
CodeExpander{
Layout.fillWidth: true

View File

@ -114,26 +114,18 @@ 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
}
}
RowLayout{
FluToggleSwitch{
id:text_box_suggest_switch
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
}
FluToggleSwitch{
id:text_box_show_suggest_switch
text: qsTr("Show suggest when pressed")
}
FluToggleSwitch{
id:text_box_suggest_switch
text: qsTr("Disabled")
}
text: qsTr("Disabled")
}
}
CodeExpander{
@ -141,9 +133,6 @@ 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 === qsTr("dwm-blur")
visible: FluTheme.blurBehindWindowEnabled || window.effect === "dwm-blur"
text: qsTr("window tintOpacity")
Layout.topMargin: 20
}
FluSlider{
visible: FluTheme.blurBehindWindowEnabled || window.effect === qsTr("dwm-blur")
visible: FluTheme.blurBehindWindowEnabled || window.effect === "dwm-blur"
Layout.topMargin: 5
to:1
stepSize:0.1

View File

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

View File

@ -17,42 +17,20 @@ 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
Row{
FluFilledButton{
anchors{
top: parent.top
topMargin: 14
}
spacing: 20
FluFilledButton{
text: qsTr("Begin Tour")
onClicked: {
tour.open()
}
}
FluFilledButton{
text: qsTr("Begin Tour with custom indicator")
onClicked: {
tour_custom_indicator.open()
}
text: qsTr("Begin Tour")
onClicked: {
tour.open()
}
}

View File

@ -9,6 +9,7 @@ FluContentPage {
title: qsTr("TreeView")
function treeData(){
const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
function getRandomName(){
@ -89,7 +90,7 @@ FluContentPage {
RowLayout{
spacing: 10
FluText{
text: qsTr("cellHeight:")
text: "cellHeight:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -102,7 +103,7 @@ FluContentPage {
RowLayout{
spacing: 10
FluText{
text: qsTr("depthPadding:")
text: "depthPadding:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
@ -118,12 +119,12 @@ FluContentPage {
anchors.verticalCenter: parent.verticalCenter
FluToggleSwitch{
id: switch_showline
text: qsTr("showLine")
text:"showLine"
checked: false
}
FluToggleSwitch{
id: switch_checkable
text: qsTr("checkable")
text:"checkable"
checked: false
}
}
@ -131,20 +132,20 @@ FluContentPage {
spacing: 8
anchors.verticalCenter: parent.verticalCenter
FluButton{
text: qsTr("all expand")
text: "all expand"
onClicked: {
tree_view.allExpand()
}
}
FluButton{
text: qsTr("all collapse")
text: "all collapse"
onClicked: {
tree_view.allCollapse()
}
}
}
FluButton{
text: qsTr("print selection model")
text: "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: qsTr("Display")
text:"Display"
padding: 0
font: FluTextStyle.Display
}
FluText{
id:text_TitleLarge
text: qsTr("Title Large")
text:"Title Large"
padding: 0
font: FluTextStyle.TitleLarge
}
FluText{
id:text_Title
text: qsTr("Title")
text:"Title"
padding: 0
font: FluTextStyle.Title
}
FluText{
id:text_Subtitle
text: qsTr("Subtitle")
text:"Subtitle"
padding: 0
font: FluTextStyle.Subtitle
}
FluText{
id:text_BodyStrong
text: qsTr("Body Strong")
text:"Body Strong"
padding: 0
font: FluTextStyle.BodyStrong
}
FluText{
id:text_Body
text: qsTr("Body")
text:"Body"
padding: 0
font: FluTextStyle.Body
}
FluText{
id:text_Caption
text: qsTr("Caption")
text:"Caption"
padding: 0
font: FluTextStyle.Caption
}

View File

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

View File

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

View File

@ -69,8 +69,6 @@ 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::registerTypes(&engine);
FluentUI::getInstance()->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_BINARY_DIR}/FluentUI)
set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/FluentUI)
endif ()
qt_add_library(${PROJECT_NAME} ${LIB_TYPE})
qt_add_qml_module(${PROJECT_NAME}

View File

@ -441,9 +441,6 @@ 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,69 +2,33 @@
#include <QPainterPath>
FluRectangle::FluRectangle(QQuickItem *parent) : QQuickPaintedItem(parent) {
color(Qt::white);
color(QColor(255, 255, 255, 255));
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);
QRectF rect = boundingRect();
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);
// 填充背景
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);
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,15 +12,9 @@ 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,22 +282,7 @@ 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) {
_root->deleteLater();
delete _root;
_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(_root);
auto *node = new FluTreeNode(this);
node->_depth = item.value("__depth").toInt();
node->_parent = item.value("__parent").value<FluTreeNode *>();
node->_data = item;
@ -126,7 +126,6 @@ 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,14 +23,12 @@
#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) {
void FluentUI::registerTypes(const char *uri) const {
#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0))
Q_INIT_RESOURCE(fluentui);
int major = _major;

View File

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

View File

@ -7,12 +7,9 @@ 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[textRole].indexOf(control.text)!==-1){
if(item.title.indexOf(control.text)!==-1){
return true
}
return false
@ -32,11 +29,17 @@ FluTextBox{
control.updateText(modelData[textRole])
}
function loadData(){
var result = []
if(items==null){
list_view.model = []
list_view.model = result
return
}
list_view.model = items.filter(item => control.filter(item))
items.map(function(item){
if(control.filter(item)){
result.push(item)
}
})
list_view.model = result
}
}
onActiveFocusChanged: {
@ -66,7 +69,7 @@ FluTextBox{
ScrollBar.vertical: FluScrollBar {}
header: Item{
width: control.width
height: visible ? control.itemHeight : 0
height: visible ? 38 : 0
visible: list_view.count === 0
FluText{
text: emptyText
@ -79,7 +82,7 @@ FluTextBox{
}
delegate:FluControl{
id: item_control
height: control.itemHeight
height: 38
width: control.width
onClicked: {
d.handleClick(modelData)
@ -111,7 +114,7 @@ FluTextBox{
background:Rectangle{
id: rect_background
implicitWidth: control.width
implicitHeight: control.itemHeight*Math.min(Math.max(list_view.count,1),control.itemRows)
implicitHeight: 38*Math.min(Math.max(list_view.count,1),8)
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
@ -121,14 +124,6 @@ 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,15 +5,19 @@ import FluentUI 1.0
Rectangle{
property bool isDot: false
property bool showZero: false
property var count: 0
property int max: 99
property string position: "" // topLeft, topRight, bottomLeft, bottomRight
property int count: 0
property bool topRight: false
id:control
color:Qt.rgba(255/255,77/255,79/255,1)
width: {
if(isDot)
return 10
return content_text.implicitWidth + 12
if(count<10){
return 20
}else if(count<100){
return 30
}
return 40
}
height: {
if(isDot)
@ -27,74 +31,49 @@ Rectangle{
}
border.width: 1
border.color: Qt.rgba(1,1,1,1)
anchors {
left: {
if(!parent){
return undefined
}
return (position === "topLeft" || position === "bottomLeft") ? parent.left : undefined
}
anchors{
right: {
if(!parent){
return undefined
}
return (position === "topRight" || position === "bottomRight") ? parent.right : undefined
if(parent && topRight)
return parent.right
return undefined
}
top: {
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
if(parent && topRight)
return parent.top
return undefined
}
rightMargin: {
if(!parent){
return 0
if(parent && topRight){
if(isDot){
return -2.5
}
return -(control.width/2)
}
return (position === "topRight" || position === "bottomRight") ? (isDot ? -2.5 : -(width / 2)) : 0
return 0
}
topMargin: {
if(!parent){
return 0
if(parent && topRight){
if(isDot){
return -2.5
}
return -10
}
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
return 0
}
}
visible: {
if(typeof(count) === "number"){
return showZero ? true : count !== 0
}
return true
if(showZero)
return true
return count!==0
}
FluText{
id: content_text
anchors.centerIn: parent
color: Qt.rgba(1,1,1,1)
visible: !isDot
text:{
if(typeof(count) === "string"){
if(count<100)
return count
}else if(typeof(count) === "number"){
return count <= max ? count.toString() : "%1+".arg(max.toString())
}
return ""
return "100+"
}
}
}

View File

@ -1,4 +1,4 @@
import QtQuick 2.15
import QtQuick 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
@ -11,17 +11,11 @@ Button {
property color dividerColor: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(233/255,233/255,233/255,1)
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(131/255,131/255,131/255,1)
}
if(pressed){
return Qt.rgba(162/255,162/255,162/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){
return Qt.rgba(96/255,96/255,96/255,1)
}
@ -59,6 +53,6 @@ Button {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font: control.font
color: control.textColor
textColor: control.textColor
}
}

View File

@ -4,7 +4,6 @@ import FluentUI 1.0
Item {
property bool autoPlay: true
property int orientation: Qt.Horizontal
property int loopTime: 2000
property var model
property Component delegate
@ -15,7 +14,7 @@ Item {
property int indicatorMarginTop: 0
property int indicatorMarginBottom: 20
property int indicatorSpacing: 10
property alias indicatorAnchors: indicator_loader.anchors
property alias indicatorAnchors: layout_indicator.anchors
property Component indicatorDelegate : com_indicator
id:control
width: 400
@ -25,24 +24,13 @@ Item {
}
QtObject{
id:d
property bool isManualMoving: false
property bool flagXChanged: true
property bool isAnimEnable: control.autoPlay && list_view.count>3
onIsAnimEnableChanged: {
if(isAnimEnable){
timer_run.restart()
}else{
timer_run.stop()
}
}
function setData(data){
if(!data || !Array.isArray(data)){
if(!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])
@ -61,7 +49,7 @@ Item {
clip: true
boundsBehavior: ListView.StopAtBounds
model:content_model
maximumFlickVelocity: 4 * (control.orientation === Qt.Vertical ? height : width)
maximumFlickVelocity: 4 * (list_view.orientation === Qt.Horizontal ? width : height)
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
@ -75,7 +63,7 @@ Item {
d.setData(control.model)
}
}
orientation : control.orientation
orientation : ListView.Horizontal
delegate: Item{
id:item_control
width: ListView.view.width
@ -100,63 +88,31 @@ Item {
}
}
onMovementEnded:{
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()
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.flagXChanged = false
timer_run.restart()
}
onMovementStarted: {
d.isManualMoving = true
d.flagXChanged = true
timer_run.stop()
}
onContentXChanged: {
if(d.isManualMoving && control.orientation === Qt.Horizontal){
const range = getPosRange(list_view.width, currentIndex)
if(contentX >= range.max){
contentX = range.max
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(contentX <= range.min){
contentX = range.min
if(contentX<=minY){
contentX = minY
}
}
}
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
@ -181,9 +137,9 @@ Item {
}
}
}
Loader{
id: indicator_loader
Row{
id:layout_indicator
spacing: control.indicatorSpacing
anchors{
horizontalCenter:(indicatorGravity & Qt.AlignHCenter) ? parent.horizontalCenter : undefined
verticalCenter: (indicatorGravity & Qt.AlignVCenter) ? parent.verticalCenter : undefined
@ -196,66 +152,28 @@ Item {
rightMargin: control.indicatorMarginBottom
topMargin: control.indicatorMarginBottom
}
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
}
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
}
}
}
}
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
@ -277,10 +195,10 @@ Item {
}
}
function changedIndex(index){
d.isManualMoving = true
d.flagXChanged = true
timer_run.stop()
list_view.currentIndex = index
d.isManualMoving = false
d.flagXChanged = false
if(d.isAnimEnable){
timer_run.restart()
}

View File

@ -15,9 +15,7 @@ Canvas {
function animateToNewData()
{
chartAnimationProgress = 0.1;
if (d.jsChart) {
d.jsChart.update();
}
d.jsChart?.update();
chartAnimator.restart();
}
QtObject{

View File

@ -19,19 +19,7 @@ Button {
property color checkedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
property real size: 18
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property alias textColor: btn_text.textColor
property bool textRight: true
property real textSpacing: 6
property bool animationEnabled: FluTheme.animationEnabled
@ -139,7 +127,6 @@ Button {
Layout.alignment: Qt.AlignVCenter
visible: text !== ""
font: control.font
color: control.textColor
}
}
}

View File

@ -47,17 +47,6 @@ 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
@ -159,9 +148,7 @@ Button{
if(color.a===1){
colorString = "FF"+colorString
}
if (!text_box_color.activeFocus) {
text_box_color.text = colorString.toUpperCase();
}
text_box_color.text = colorString.toUpperCase()
}
property color blackColor: {
var c = whiteColor
@ -292,11 +279,6 @@ 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));
}
@ -387,11 +369,6 @@ 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
}
@ -461,11 +438,6 @@ 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
}
@ -500,7 +472,7 @@ Button{
id:text_box_color
width: 136
validator: RegularExpressionValidator {
regularExpression: /^[0-9A-Fa-f]{8}$/
regularExpression: /^[0-9A-F]{8}$/
}
anchors{
right: parent.right
@ -523,11 +495,6 @@ 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.enabled) {
if(control.disabled) {
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(!enabled){
if(disabled){
return disableColor
}
return hovered ? hoverColor :normalColor

View File

@ -3,19 +3,7 @@ import QtQuick.Controls 2.15
import FluentUI 1.0
TextEdit {
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
id:control
color: textColor
readOnly: true

View File

@ -178,12 +178,7 @@ 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,8 +5,6 @@ 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
@ -23,23 +21,10 @@ 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: control.headerHeight
height: 45
radius: 4
border.color: FluTheme.dividerColor
color: {
@ -56,17 +41,15 @@ Item {
d.toggle()
}
}
FluLoader {
anchors {
top: parent.top
bottom: parent.bottom
FluText{
text: headerText
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
right: btn_toggle.left
leftMargin: 15
}
sourceComponent: control.headerDelegate
}
FluIconButton{
id: btn_toggle
anchors{
verticalCenter: parent.verticalCenter
right: parent.right

View File

@ -1,29 +1,18 @@
import QtQuick 2.15
import QtQuick 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
Text {
property int iconSource
property int iconSize: 20
property color iconColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
id:control
font.family: font_loader.name
font.pixelSize: iconSize
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: iconColor
color: enabled ? iconColor : Qt.rgba(iconColor.r, iconColor.g, iconColor.b, iconColor.a * 0.5)
text: (String.fromCharCode(iconSource).toString(16))
opacity: iconSource>0
FontLoader{

View File

@ -1,4 +1,4 @@
import QtQuick 2.15
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
@ -26,30 +26,12 @@ Button {
}
property color iconColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property color textColor: FluTheme.fontPrimaryColor
Accessible.role: Accessible.Button
Accessible.name: control.text
Accessible.description: contentDescription
@ -94,7 +76,7 @@ Button {
text:control.text
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
visible: display !== Button.IconOnly
color: control.textColor
textColor: control.textColor
font: control.font
}
}
@ -111,7 +93,7 @@ Button {
text:control.text
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
visible: display !== Button.IconOnly
color: control.textColor
textColor: control.textColor
font: control.font
}
}

View File

@ -1,4 +1,4 @@
import QtQuick 2.15
import QtQuick 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
@ -11,6 +11,7 @@ Image {
property Component errorItem : com_error
property Component loadingItem: com_loading
id: control
opacity: enabled ? 1 : 0.5
FluLoader{
anchors.fill: parent
sourceComponent: {

View File

@ -1,4 +1,4 @@
import QtQuick 2.15
import QtQuick 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
@ -13,7 +13,7 @@ FluButton {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font: control.font
color: control.textColor
textColor: control.textColor
anchors.verticalCenter: parent.verticalCenter
}
Item{

View File

@ -6,7 +6,7 @@ T.MenuBarItem {
property bool disabled: false
property color textColor: {
if(FluTheme.dark){
if(!enabled){
if(disabled){
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(!enabled){
if(disabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){

View File

@ -1313,7 +1313,7 @@ Item {
d.stackItems = d.stackItems.concat(nav_list.model[nav_list.currentIndex])
}
function noStackPush(){
if(loader_content.source.toString() === url && Object.keys(argument).length === 0){
if(loader_content.source.toString() === url){
return
}
loader_content.setSource(url,argument)

View File

@ -5,9 +5,8 @@ import FluentUI 1.0
Page {
default property alias content: d.children
property alias currentIndex: nav_list.currentIndex
property color textHighlightColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
property color textNormalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120
property color textHoverColor: FluTheme.dark ? FluColors.Grey80 : FluColors.Grey150
property color textHoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
property int textSpacing: 10
property int headerSpacing: 20
property int headerHeight: 40
@ -31,15 +30,21 @@ 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.width
width: nav_list.currentItem ? nav_list.currentItem.width : 0
y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
}
}
delegate: Button{
@ -61,13 +66,9 @@ Page {
anchors.centerIn: parent
font: control.font
color: {
if(nav_list.currentIndex === index) {
return textHighlightColor;
}
if (item_button.hovered) {
return textHoverColor;
}
return textNormalColor;
if(item_button.hovered)
return textHoverColor
return textNormalColor
}
}
}

View File

@ -14,6 +14,13 @@ 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
@ -34,20 +41,13 @@ ProgressBar{
height: parent.height
radius: d._radius
color: control.color
SequentialAnimation on x {
id: animator_x
PropertyAnimation on x {
id:animator_x
running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite
onRunningChanged: {
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
duration: control.duration
}
duration: control.duration
}
}
}

View File

@ -11,19 +11,7 @@ Button {
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1)
property color hoverColor: checked ? FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(159/255,159/255,159/255,1) : Qt.rgba(159/255,159/255,159/255,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property alias textColor: btn_text.textColor
property real size: 18
property bool textRight: true
property real textSpacing: 6
@ -106,7 +94,6 @@ Button {
Layout.alignment: Qt.AlignVCenter
visible: text !== ""
font: control.font
color: control.textColor
}
}
}

View File

@ -139,13 +139,13 @@ T.SpinBox {
radius: 4
border.width: 1
border.color: {
if(!contentItem.enabled){
if(contentItem.disabled){
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.enabled){
if(contentItem.disabled){
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,7 +17,6 @@ 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
@ -267,18 +266,30 @@ Rectangle {
d.rowHoverIndex = row
}
onWidthChanged: {
updatePosition()
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
}
onHeightChanged: {
updatePosition()
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
}
onXChanged: {
updatePosition()
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
}
onYChanged: {
updatePosition()
}
function updatePosition(){
if(editVisible){
updateEditPosition()
}
@ -299,11 +310,9 @@ Rectangle {
}
function updateTableItem(){
var columnModel = control.columnSource[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)
}
columnModel.x = item_table_mouse.x
columnModel.y = item_table_mouse.y
d.tableItemLayout(column)
}
Rectangle{
anchors.fill: parent
@ -343,7 +352,6 @@ 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
@ -437,6 +445,10 @@ Rectangle {
}
}
onWidthChanged:{
table_view.forceLayout()
}
MouseArea{
id:layout_mouse_table
hoverEnabled: true
@ -467,9 +479,6 @@ Rectangle {
table_view.flick(0,1)
}
delegate: com_table_delegate
onWidthChanged: {
Qt.callLater(forceLayout)
}
}
}
@ -842,13 +851,7 @@ Rectangle {
Connections{
target: table_view
function onRowsChanged(){
header_vertical.updateRowIndex()
}
}
Connections {
target: control
function onStartRowIndexChanged(){
header_vertical.updateRowIndex()
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
}
}
Timer{
@ -858,9 +861,6 @@ 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){
Qt.callLater(updateLayout)
updateLayout()
}
}
}
Connections{
target: table_view
function onContentXChanged(){
Qt.callLater(updateLayout)
updateLayout()
}
}
function updateLayout(){
width = Qt.binding(() => table_view.columnWidthProvider(_index))
width = table_view.columnWidthProvider(_index)
x = Qt.binding(function(){
var minX = 0
var maxX = table_view.width-width

View File

@ -1,11 +1,11 @@
import QtQuick 2.15
import QtQuick 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
Text {
property color textColor: FluTheme.fontPrimaryColor
id:text
color: enabled ? textColor : (FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1))
color: enabled ? textColor : Qt.rgba(textColor.r, textColor.g, textColor.b, textColor.a * 0.7)
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
font: FluTextStyle.Body
}

View File

@ -6,7 +6,7 @@ FluControlBackground{
property Item inputItem
id:control
color: {
if(inputItem && !inputItem.enabled){
if(inputItem && inputItem.disabled){
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

@ -18,19 +18,7 @@ Button {
property color dotDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(150/255,150/255,150/255,1)
property real textSpacing: 6
property bool textRight: true
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property alias textColor: btn_text.textColor
property var clickListener : function(){
checked = !checked
}
@ -127,7 +115,6 @@ Button {
text: control.text
Layout.alignment: Qt.AlignVCenter
visible: text !== ""
color: control.textColor
}
}
}

View File

@ -7,10 +7,8 @@ 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")
@ -24,12 +22,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{
@ -52,32 +50,10 @@ 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]){
@ -97,22 +73,15 @@ 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()
}
}
@ -120,128 +89,39 @@ Popup{
id: timer_delay
interval: 200
onTriggered: {
d.updatePos()
canvas.requestPaint()
}
}
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
}
}
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 {
Canvas{
id: canvas
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
}
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()
}
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()
}
}
FluFrame{
@ -271,18 +151,6 @@ 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
}
@ -325,21 +193,10 @@ 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: control.nextButton
sourceComponent: com_next_button
anchors{
top: text_desc.bottom
topMargin: 10
@ -350,7 +207,7 @@ Popup{
FluLoader{
id: loader_prev
visible: control.index !== 0
sourceComponent: control.prevButton
sourceComponent: com_prev_button
anchors{
right: loader_next.left
top: loader_next.top
@ -389,17 +246,5 @@ 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,7 +474,6 @@ 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 E:/develop/QtCode/opensource/FluentUI/build/Desktop_Qt_5_15_2_MinGW_64_bit-Release/src'
// 'qmlplugindump -nonrelocatable -noinstantiate FluentUI 1.0 F:/FluentUI/build/Desktop_Qt_5_15_2_MSVC2019_32bit-Release/src'
Module {
dependencies: ["QtQuick 2.0"]
@ -231,10 +231,6 @@ 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"
@ -2780,7 +2776,7 @@ Module {
}
Property {
name: "layoutMacosButtons"
type: "FluLoader_QMLTYPE_12"
type: "FluLoader_QMLTYPE_11"
isReadonly: true
isPointer: true
}
@ -2801,16 +2797,12 @@ 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"
@ -2838,9 +2830,8 @@ Module {
defaultProperty: "data"
Property { name: "isDot"; type: "bool" }
Property { name: "showZero"; type: "bool" }
Property { name: "count"; type: "QVariant" }
Property { name: "max"; type: "int" }
Property { name: "position"; type: "string" }
Property { name: "count"; type: "int" }
Property { name: "topRight"; type: "bool" }
}
Component {
prototype: "QQuickItem"
@ -2907,7 +2898,6 @@ 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 }
@ -2965,12 +2955,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"
@ -3199,8 +3189,6 @@ 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 }
@ -3481,15 +3469,15 @@ Module {
defaultProperty: "data"
Property { name: "logo"; type: "QUrl" }
Property { name: "title"; type: "string" }
Property { name: "items"; type: "FluObject_QMLTYPE_182"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_182"; isPointer: true }
Property { name: "items"; type: "FluObject_QMLTYPE_176"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_176"; 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_49"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_49"; isPointer: true }
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_48"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_48"; isPointer: true }
Property { name: "navCompactWidth"; type: "int" }
Property { name: "navTopMargin"; type: "int" }
Property { name: "cellHeight"; type: "int" }
@ -3688,7 +3676,6 @@ 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" }
@ -3785,11 +3772,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"
@ -3912,9 +3899,7 @@ 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" }
@ -4094,7 +4079,6 @@ 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" }
@ -4310,8 +4294,8 @@ Module {
Property { name: "dotDisableColor"; type: "QColor" }
Property { name: "textSpacing"; type: "double" }
Property { name: "textRight"; type: "bool" }
Property { name: "textColor"; type: "QColor" }
Property { name: "clickListener"; type: "QVariant" }
Property { name: "textColor"; type: "QColor" }
}
Component {
prototype: "QQuickToolTip"
@ -4330,10 +4314,8 @@ 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" }
@ -4397,6 +4379,7 @@ 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" }
@ -4420,7 +4403,6 @@ 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" }
@ -4503,6 +4485,7 @@ 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" }
@ -4526,7 +4509,6 @@ 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,12 +6,9 @@ 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[textRole].indexOf(control.text)!==-1){
if(item.title.indexOf(control.text)!==-1){
return true
}
return false
@ -31,11 +28,17 @@ FluTextBox{
control.updateText(modelData[textRole])
}
function loadData(){
var result = []
if(items==null){
list_view.model = []
list_view.model = result
return
}
list_view.model = items.filter(item => control.filter(item))
items.map(function(item){
if(control.filter(item)){
result.push(item)
}
})
list_view.model = result
}
}
onActiveFocusChanged: {
@ -65,7 +68,7 @@ FluTextBox{
ScrollBar.vertical: FluScrollBar {}
header: Item{
width: control.width
height: visible ? control.itemHeight : 0
height: visible ? 38 : 0
visible: list_view.count === 0
FluText{
text: emptyText
@ -78,7 +81,7 @@ FluTextBox{
}
delegate:FluControl{
id: item_control
height: control.itemHeight
height: 38
width: control.width
onClicked: {
d.handleClick(modelData)
@ -110,7 +113,7 @@ FluTextBox{
background:Rectangle{
id: rect_background
implicitWidth: control.width
implicitHeight: control.itemHeight*Math.min(Math.max(list_view.count,1),control.itemRows)
implicitHeight: 38*Math.min(Math.max(list_view.count,1),8)
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
@ -120,14 +123,6 @@ 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,15 +5,19 @@ import FluentUI
Rectangle{
property bool isDot: false
property bool showZero: false
property var count: 0
property int max: 99
property string position: "" // topLeft, topRight, bottomLeft, bottomRight
property int count: 0
property bool topRight: false
id:control
color:Qt.rgba(255/255,77/255,79/255,1)
width: {
if(isDot)
return 10
return content_text.implicitWidth + 12
if(count<10){
return 20
}else if(count<100){
return 30
}
return 40
}
height: {
if(isDot)
@ -27,74 +31,49 @@ Rectangle{
}
border.width: 1
border.color: Qt.rgba(1,1,1,1)
anchors {
left: {
if(!parent){
return undefined
}
return (position === "topLeft" || position === "bottomLeft") ? parent.left : undefined
}
anchors{
right: {
if(!parent){
return undefined
}
return (position === "topRight" || position === "bottomRight") ? parent.right : undefined
if(parent && topRight)
return parent.right
return undefined
}
top: {
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
if(parent && topRight)
return parent.top
return undefined
}
rightMargin: {
if(!parent){
return 0
if(parent && topRight){
if(isDot){
return -2.5
}
return -(control.width/2)
}
return (position === "topRight" || position === "bottomRight") ? (isDot ? -2.5 : -(width / 2)) : 0
return 0
}
topMargin: {
if(!parent){
return 0
if(parent && topRight){
if(isDot){
return -2.5
}
return -10
}
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
return 0
}
}
visible: {
if(typeof(count) === "number"){
return showZero ? true : count !== 0
}
return true
if(showZero)
return true
return count!==0
}
FluText{
id: content_text
anchors.centerIn: parent
color: Qt.rgba(1,1,1,1)
visible: !isDot
text:{
if(typeof(count) === "string"){
if(count<100)
return count
}else if(typeof(count) === "number"){
return count <= max ? count.toString() : "%1+".arg(max.toString())
}
return ""
return "100+"
}
}
}

View File

@ -4,7 +4,6 @@ import FluentUI
Item {
property bool autoPlay: true
property int orientation: Qt.Horizontal
property int loopTime: 2000
property var model
property Component delegate
@ -15,7 +14,7 @@ Item {
property int indicatorMarginTop: 0
property int indicatorMarginBottom: 20
property int indicatorSpacing: 10
property alias indicatorAnchors: indicator_loader.anchors
property alias indicatorAnchors: layout_indicator.anchors
property Component indicatorDelegate : com_indicator
id:control
width: 400
@ -25,24 +24,13 @@ Item {
}
QtObject{
id:d
property bool isManualMoving: false
property bool flagXChanged: true
property bool isAnimEnable: control.autoPlay && list_view.count>3
onIsAnimEnableChanged: {
if(isAnimEnable){
timer_run.restart()
}else{
timer_run.stop()
}
}
function setData(data){
if(!data || !Array.isArray(data)){
if(!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])
@ -61,7 +49,7 @@ Item {
clip: true
boundsBehavior: ListView.StopAtBounds
model:content_model
maximumFlickVelocity: 4 * (control.orientation === Qt.Vertical ? height : width)
maximumFlickVelocity: 4 * (list_view.orientation === Qt.Horizontal ? width : height)
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
@ -75,7 +63,7 @@ Item {
d.setData(control.model)
}
}
orientation : control.orientation
orientation : ListView.Horizontal
delegate: Item{
id:item_control
width: ListView.view.width
@ -100,63 +88,31 @@ Item {
}
}
onMovementEnded:{
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()
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.flagXChanged = false
timer_run.restart()
}
onMovementStarted: {
d.isManualMoving = true
d.flagXChanged = true
timer_run.stop()
}
onContentXChanged: {
if(d.isManualMoving && control.orientation === Qt.Horizontal){
const range = getPosRange(list_view.width, currentIndex)
if(contentX >= range.max){
contentX = range.max
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(contentX <= range.min){
contentX = range.min
if(contentX<=minY){
contentX = minY
}
}
}
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
@ -181,9 +137,9 @@ Item {
}
}
}
Loader{
id: indicator_loader
Row{
id:layout_indicator
spacing: control.indicatorSpacing
anchors{
horizontalCenter:(indicatorGravity & Qt.AlignHCenter) ? parent.horizontalCenter : undefined
verticalCenter: (indicatorGravity & Qt.AlignVCenter) ? parent.verticalCenter : undefined
@ -196,66 +152,28 @@ Item {
rightMargin: control.indicatorMarginBottom
topMargin: control.indicatorMarginBottom
}
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
}
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
}
}
}
}
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
@ -277,10 +195,10 @@ Item {
}
}
function changedIndex(index){
d.isManualMoving = true
d.flagXChanged = true
timer_run.stop()
list_view.currentIndex = index
d.isManualMoving = false
d.flagXChanged = false
if(d.isAnimEnable){
timer_run.restart()
}

View File

@ -14,9 +14,7 @@ Canvas {
function animateToNewData()
{
chartAnimationProgress = 0.1;
if (d.jsChart) {
d.jsChart.update();
}
d.jsChart?.update();
chartAnimator.restart();
}
QtObject{

View File

@ -20,19 +20,7 @@ Button {
property color checkedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
property real size: 18
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property alias textColor: btn_text.textColor
property bool textRight: true
property real textSpacing: 6
property bool animationEnabled: FluTheme.animationEnabled
@ -141,7 +129,6 @@ Button {
Layout.alignment: Qt.AlignVCenter
visible: text !== ""
font: control.font
color: control.textColor
}
}
}

View File

@ -48,17 +48,6 @@ 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
@ -160,9 +149,7 @@ Button{
if(color.a===1){
colorString = "FF"+colorString
}
if (!text_box_color.activeFocus) {
text_box_color.text = colorString.toUpperCase();
}
text_box_color.text = colorString.toUpperCase()
}
property color blackColor: {
var c = whiteColor
@ -293,11 +280,6 @@ 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));
}
@ -388,11 +370,6 @@ 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
}
@ -462,11 +439,6 @@ 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
}
@ -501,7 +473,7 @@ Button{
id:text_box_color
width: 136
validator: RegularExpressionValidator {
regularExpression: /^[0-9A-Fa-f]{8}$/
regularExpression: /^[0-9A-F]{8}$/
}
anchors{
right: parent.right
@ -524,11 +496,6 @@ 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.enabled) {
if(control.disabled) {
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(!enabled){
if(disabled){
return disableColor
}
return hovered ? hoverColor :normalColor

View File

@ -3,19 +3,7 @@ import QtQuick.Controls
import FluentUI
TextEdit {
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
id:control
color: textColor
readOnly: true

View File

@ -178,12 +178,7 @@ 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,8 +5,6 @@ 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
@ -23,23 +21,10 @@ 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: control.headerHeight
height: 45
radius: 4
border.color: FluTheme.dividerColor
color: {
@ -56,17 +41,15 @@ Item {
d.toggle()
}
}
FluLoader {
anchors {
top: parent.top
bottom: parent.bottom
FluText{
text: headerText
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
right: btn_toggle.left
leftMargin: 15
}
sourceComponent: control.headerDelegate
}
FluIconButton{
id: btn_toggle
anchors{
verticalCenter: parent.verticalCenter
right: parent.right

View File

@ -5,19 +5,7 @@ import FluentUI
Text {
property int iconSource
property int iconSize: 20
property color iconColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
id:control
font.family: font_loader.name
font.pixelSize: iconSize

View File

@ -38,19 +38,7 @@ Button {
return Qt.rgba(0,0,0,1)
}
}
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property color textColor: FluTheme.fontPrimaryColor
Accessible.role: Accessible.Button
Accessible.name: control.text
Accessible.description: contentDescription

View File

@ -7,7 +7,7 @@ T.MenuBarItem {
property bool disabled: false
property color textColor: {
if(FluTheme.dark){
if(!enabled){
if(disabled){
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(!enabled){
if(disabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){

View File

@ -1314,7 +1314,7 @@ Item {
d.stackItems = d.stackItems.concat(nav_list.model[nav_list.currentIndex])
}
function noStackPush(){
if(loader_content.source.toString() === url && Object.keys(argument).length === 0){
if(loader_content.source.toString() === url){
return
}
loader_content.setSource(url,argument)

View File

@ -6,9 +6,8 @@ import FluentUI
Page {
default property alias content: d.children
property alias currentIndex: nav_list.currentIndex
property color textHighlightColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
property color textNormalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120
property color textHoverColor: FluTheme.dark ? FluColors.Grey80 : FluColors.Grey150
property color textHoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
property int textSpacing: 10
property int headerSpacing: 20
property int headerHeight: 40
@ -32,15 +31,21 @@ 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.width
width: nav_list.currentItem ? nav_list.currentItem.width : 0
y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
}
}
delegate: Button{
@ -62,13 +67,9 @@ Page {
anchors.centerIn: parent
font: control.font
color: {
if(nav_list.currentIndex === index) {
return textHighlightColor;
}
if (item_button.hovered) {
return textHoverColor;
}
return textNormalColor;
if(item_button.hovered)
return textHoverColor
return textNormalColor
}
}
}

View File

@ -15,6 +15,13 @@ 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
@ -35,20 +42,13 @@ ProgressBar{
height: parent.height
radius: d._radius
color: control.color
SequentialAnimation on x {
id: animator_x
PropertyAnimation on x {
id:animator_x
running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite
onRunningChanged: {
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
duration: control.duration
}
duration: control.duration
}
}
}

View File

@ -12,19 +12,7 @@ Button {
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1)
property color hoverColor: checked ? FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(159/255,159/255,159/255,1) : Qt.rgba(159/255,159/255,159/255,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property alias textColor: btn_text.textColor
property real size: 18
property bool textRight: true
property real textSpacing: 6
@ -102,7 +90,6 @@ Button {
Layout.alignment: Qt.AlignVCenter
font: control.font
visible: text !== ""
color: control.textColor
}
}
}

View File

@ -140,13 +140,13 @@ T.SpinBox {
radius: 4
border.width: 1
border.color: {
if(!contentItem.enabled){
if(contentItem.disabled){
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.enabled){
if(contentItem.disabled){
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,7 +17,6 @@ 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
@ -267,18 +266,30 @@ Rectangle {
d.rowHoverIndex = row
}
onWidthChanged: {
updatePosition()
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
}
onHeightChanged: {
updatePosition()
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
}
onXChanged: {
updatePosition()
if(editVisible){
updateEditPosition()
}
if(isMainTable){
updateTableItem()
}
}
onYChanged: {
updatePosition()
}
function updatePosition(){
if(editVisible){
updateEditPosition()
}
@ -299,11 +310,9 @@ Rectangle {
}
function updateTableItem(){
var columnModel = control.columnSource[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)
}
columnModel.x = item_table_mouse.x
columnModel.y = item_table_mouse.y
d.tableItemLayout(column)
}
Rectangle{
anchors.fill: parent
@ -343,7 +352,6 @@ 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
@ -437,6 +445,10 @@ Rectangle {
}
}
onWidthChanged:{
table_view.forceLayout()
}
MouseArea{
id:layout_mouse_table
hoverEnabled: true
@ -467,9 +479,6 @@ Rectangle {
table_view.flick(0,1)
}
delegate: com_table_delegate
onWidthChanged: {
Qt.callLater(forceLayout)
}
}
}
@ -842,13 +851,7 @@ Rectangle {
Connections{
target: table_view
function onRowsChanged(){
header_vertical.updateRowIndex()
}
}
Connections {
target: control
function onStartRowIndexChanged(){
header_vertical.updateRowIndex()
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
}
}
Timer{
@ -858,9 +861,6 @@ 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){
Qt.callLater(updateLayout)
updateLayout()
}
}
}
Connections{
target: table_view
function onContentXChanged(){
Qt.callLater(updateLayout)
updateLayout()
}
}
function updateLayout(){
width = Qt.binding(() => table_view.columnWidthProvider(_index))
width = table_view.columnWidthProvider(_index)
x = Qt.binding(function(){
var minX = 0
var maxX = table_view.width-width

View File

@ -5,7 +5,7 @@ import FluentUI
Text {
property color textColor: FluTheme.fontPrimaryColor
id:text
color: enabled ? textColor : (FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1))
color: textColor
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
font: FluTextStyle.Body
}

View File

@ -6,7 +6,7 @@ FluControlBackground{
property Item inputItem
id:control
color: {
if(inputItem && !inputItem.enabled){
if(inputItem && inputItem.disabled){
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

@ -19,19 +19,7 @@ Button {
property color dotDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(150/255,150/255,150/255,1)
property real textSpacing: 6
property bool textRight: true
property color textColor: {
if(FluTheme.dark){
if(!enabled){
return Qt.rgba(130/255,130/255,130/255,1)
}
return Qt.rgba(1,1,1,1)
}else{
if(!enabled){
return Qt.rgba(161/255,161/255,161/255,1)
}
return Qt.rgba(0,0,0,1)
}
}
property alias textColor: btn_text.textColor
property var clickListener : function(){
checked = !checked
}
@ -128,7 +116,6 @@ Button {
text: control.text
Layout.alignment: Qt.AlignVCenter
visible: text !== ""
color: control.textColor
}
}
}

View File

@ -7,10 +7,8 @@ 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")
@ -24,12 +22,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{
@ -52,32 +50,10 @@ 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]){
@ -97,22 +73,15 @@ 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()
}
}
@ -120,128 +89,39 @@ Popup{
id: timer_delay
interval: 200
onTriggered: {
d.updatePos()
canvas.requestPaint()
}
}
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
}
}
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 {
Canvas{
id: canvas
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
}
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()
}
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()
}
}
FluFrame{
@ -271,18 +151,6 @@ 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
}
@ -325,21 +193,10 @@ 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: control.nextButton
sourceComponent: com_next_button
anchors{
top: text_desc.bottom
topMargin: 10
@ -350,7 +207,7 @@ Popup{
FluLoader{
id: loader_prev
visible: control.index !== 0
sourceComponent: control.prevButton
sourceComponent: com_prev_button
anchors{
right: loader_next.left
top: loader_next.top
@ -389,17 +246,5 @@ 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,7 +474,6 @@ 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="375"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="374"/>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<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="375"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="374"/>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="354"/>
<source>Loading...</source>
<translation type="unfinished">...</translation>
</message>

View File

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