Compare commits

..

No commits in common. "main" and "1.7.7" have entirely different histories.
main ... 1.7.7

117 changed files with 658 additions and 3178 deletions

View File

@ -60,7 +60,7 @@ jobs:
# 拷贝依赖 # 拷贝依赖
sudo macdeployqt bin/Release/${targetName}.app -qmldir=. -dmg sudo macdeployqt bin/Release/${targetName}.app -qmldir=. -dmg
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v2
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}} name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
path: bin/release/${{ env.targetName }}.app path: bin/release/${{ env.targetName }}.app

View File

@ -69,11 +69,6 @@ jobs:
- name: Check if svg file exists - name: Check if svg file exists
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi 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 - name: package
run: | run: |
# make sure Qt plugin finds QML sources so it can deploy the imported files # make sure Qt plugin finds QML sources so it can deploy the imported files
@ -82,7 +77,7 @@ jobs:
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/Release/${targetName} --appdir bin/release/ linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/Release/${targetName} --appdir bin/release/
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v2
with: with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}} name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
path: ${{ env.targetName }}.AppImage path: ${{ env.targetName }}.AppImage

View File

@ -82,7 +82,7 @@ jobs:
$name = ${env:archiveName} $name = ${env:archiveName}
echo "::set-output name=packageName::$name" echo "::set-output name=packageName::$name"
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v2
with: with:
name: ${{ steps.package.outputs.packageName }} name: ${{ steps.package.outputs.packageName }}
path: dist path: dist

View File

@ -69,7 +69,7 @@ jobs:
$name = ${env:archiveName} $name = ${env:archiveName}
echo "::set-output name=packageName::$name" echo "::set-output name=packageName::$name"
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v2
with: with:
name: ${{ steps.package.outputs.packageName }} name: ${{ steps.package.outputs.packageName }}
path: dist path: dist

View File

@ -76,7 +76,7 @@ jobs:
$name = ${env:archiveName} $name = ${env:archiveName}
echo "::set-output name=packageName::$name" echo "::set-output name=packageName::$name"
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v2
with: with:
name: ${{ steps.package.outputs.packageName }} name: ${{ steps.package.outputs.packageName }}
path: dist path: dist

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> <div align=center>
<img width=64 src="doc/preview/fluent_design.svg"> <img width=64 src="doc/preview/fluent_design.svg">

View File

@ -24,8 +24,8 @@ else ()
endif () endif ()
#Qt #Qt
find_package(QT NAMES Qt6 Qt5 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 Widgets) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network)
# #
find_program(QT_LUPDATE NAMES lupdate lupdate-qt6) 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}::Quick
Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Svg
Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Widgets
fluentuiplugin fluentuiplugin
) )

View File

@ -639,7 +639,7 @@
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="95"/> <location filename="qml/window/MainWindow.qml" line="95"/>
<location filename="qml/window/MainWindow.qml" line="337"/> <location filename="qml/window/MainWindow.qml" line="339"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -659,57 +659,57 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="302"/> <location filename="qml/window/MainWindow.qml" line="304"/>
<source>Finish</source> <source>Finish</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="303"/> <location filename="qml/window/MainWindow.qml" line="305"/>
<source>Next</source> <source>Next</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="304"/> <location filename="qml/window/MainWindow.qml" line="306"/>
<source>Previous</source> <source>Previous</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="308"/> <location filename="qml/window/MainWindow.qml" line="310"/>
<source>Dark Mode</source> <source>Dark Mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="308"/> <location filename="qml/window/MainWindow.qml" line="310"/>
<source>Here you can switch to night mode.</source> <source>Here you can switch to night mode.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="310"/> <location filename="qml/window/MainWindow.qml" line="312"/>
<source>Hide Easter eggs</source> <source>Hide Easter eggs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="310"/> <location filename="qml/window/MainWindow.qml" line="312"/>
<source>Try a few more clicks!!</source> <source>Try a few more clicks!!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="334"/> <location filename="qml/window/MainWindow.qml" line="336"/>
<source>Upgrade Tips</source> <source>Upgrade Tips</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="335"/> <location filename="qml/window/MainWindow.qml" line="337"/>
<source>FluentUI is currently up to date </source> <source>FluentUI is currently up to date </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="335"/> <location filename="qml/window/MainWindow.qml" line="337"/>
<source> -- The current app version</source> <source> -- The current app version</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="335"/> <location filename="qml/window/MainWindow.qml" line="337"/>
<source> <source>
Now go and download the new version Now go and download the new version
@ -718,17 +718,17 @@ Updated content:
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="338"/> <location filename="qml/window/MainWindow.qml" line="340"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="365"/> <location filename="qml/window/MainWindow.qml" line="367"/>
<source>The current version is already the latest</source> <source>The current version is already the latest</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="372"/> <location filename="qml/window/MainWindow.qml" line="374"/>
<source>The network is abnormal</source> <source>The network is abnormal</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -831,25 +831,9 @@ Updated content:
<name>T_Acrylic</name> <name>T_Acrylic</name>
<message> <message>
<location filename="qml/page/T_Acrylic.qml" line="10"/> <location filename="qml/page/T_Acrylic.qml" line="10"/>
<location filename="qml/page/T_Acrylic.qml" line="72"/>
<source>Acrylic</source> <source>Acrylic</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_Badge</name> <name>T_Badge</name>
@ -879,22 +863,11 @@ Updated content:
<source>BreadcurmbBar</source> <source>BreadcurmbBar</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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> <message>
<location filename="qml/page/T_BreadcrumbBar.qml" line="50"/> <location filename="qml/page/T_BreadcrumbBar.qml" line="50"/>
<source>Reset sample</source> <source>Reset sample</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_BreadcrumbBar.qml" line="54"/>
<source>Item_</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_BubbleChart</name> <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="199"/>
<location filename="qml/page/T_Buttons.qml" line="320"/> <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="368"/>
<location filename="qml/page/T_Buttons.qml" line="419"/> <location filename="qml/page/T_Buttons.qml" line="421"/>
<source>Disabled</source> <source>Disabled</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -969,16 +942,10 @@ Updated content:
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Buttons.qml" line="222"/>
<location filename="qml/page/T_Buttons.qml" line="238"/> <location filename="qml/page/T_Buttons.qml" line="238"/>
<source>Loading</source> <source>Loading</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_Buttons.qml" line="238"/>
<source>Normal</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="qml/page/T_Buttons.qml" line="270"/> <location filename="qml/page/T_Buttons.qml" line="270"/>
<source>Click IconButton</source> <source>Click IconButton</source>
@ -1055,12 +1022,12 @@ Updated content:
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Buttons.qml" line="407"/> <location filename="qml/page/T_Buttons.qml" line="408"/>
<source>Radio Button_2</source> <source>Radio Button_2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Buttons.qml" line="410"/> <location filename="qml/page/T_Buttons.qml" line="412"/>
<source>Radio Button_3</source> <source>Radio Button_3</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1095,11 +1062,6 @@ Updated content:
<source>Please enter a verification code</source> <source>Please enter a verification code</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_Captcha.qml" line="48"/>
<source>verify</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="qml/page/T_Captcha.qml" line="52"/> <location filename="qml/page/T_Captcha.qml" line="52"/>
<source>The verification code is correct</source> <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> <source>Carousel map, support infinite carousel, infinite swipe, and components implemented with ListView</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_Carousel.qml" line="203"/>
<source>Auto play</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_CheckBox</name> <name>T_CheckBox</name>
@ -1201,62 +1158,6 @@ Updated content:
<source>ComboBox</source> <source>ComboBox</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_CustomPlot</name> <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> 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> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_FlipView</name> <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> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_Icons.qml" line="28"/> <location filename="qml/page/T_Icons.qml" line="51"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="61"/>
<source>You Copied </source> <source>You Copied </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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> <source>This is an InfoBar in the Warning Style</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="39"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="41"/> <location filename="qml/page/T_InfoBar.qml" line="41"/>
<source>This is an InfoBar in the Error Style</source> <source>This is an InfoBar in the Error Style</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="45"/>
<source>Success</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="47"/> <location filename="qml/page/T_InfoBar.qml" line="47"/>
<source>This is an InfoBar in the Success Style</source> <source>This is an InfoBar in the Success Style</source>
@ -1628,53 +1494,30 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="64"/> <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="74"/>
<location filename="qml/page/T_InfoBar.qml" line="85"/> <location filename="qml/page/T_InfoBar.qml" line="84"/>
<source>close &apos;%1&apos;</source> <source>close &apos;%1&apos;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="64"/> <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="74"/>
<location filename="qml/page/T_InfoBar.qml" line="85"/> <location filename="qml/page/T_InfoBar.qml" line="84"/>
<source>show &apos;%1&apos;</source> <source>show &apos;%1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="70"/> <location filename="qml/page/T_InfoBar.qml" line="70"/>
<location filename="qml/page/T_InfoBar.qml" line="81"/> <location filename="qml/page/T_InfoBar.qml" line="80"/>
<location filename="qml/page/T_InfoBar.qml" line="91"/> <location filename="qml/page/T_InfoBar.qml" line="90"/>
<source>This is an &apos;%1&apos;</source> <source>This is an &apos;%1&apos;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_InfoBar.qml" line="64"/> <location filename="qml/page/T_InfoBar.qml" line="94"/>
<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> <source>clear all info</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_InfoBar.qml" line="103"/>
<source>Loading</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_LineChart</name> <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> <source>QRCode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_RadarChart</name> <name>T_RadarChart</name>
@ -2215,37 +2033,6 @@ Some contents...</source>
<source>SplitLayout</source> <source>SplitLayout</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_StaggeredLayout</name> <name>T_StaggeredLayout</name>
@ -2262,27 +2049,6 @@ Some contents...</source>
<source>StatusLayout</source> <source>StatusLayout</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_StatusLayout.qml" line="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>
<context> <context>
<name>T_TabView</name> <name>T_TabView</name>
@ -2296,48 +2062,6 @@ Some contents...</source>
<source>Document </source> <source>Document </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_TableView</name> <name>T_TableView</name>
@ -2368,7 +2092,7 @@ Some contents...</source>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="176"/> <location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="503"/> <location filename="qml/page/T_TableView.qml" line="508"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2388,67 +2112,67 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="359"/> <location filename="qml/page/T_TableView.qml" line="364"/>
<source>Age</source> <source>Age</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="434"/> <location filename="qml/page/T_TableView.qml" line="439"/>
<source>Clear All</source> <source>Clear All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="441"/> <location filename="qml/page/T_TableView.qml" line="446"/>
<source>Delete Selection</source> <source>Delete Selection</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="464"/> <location filename="qml/page/T_TableView.qml" line="469"/>
<source>Add a row of Data</source> <source>Add a row of Data</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="470"/> <location filename="qml/page/T_TableView.qml" line="475"/>
<source>Insert a Row</source> <source>Insert a Row</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="477"/> <location filename="qml/page/T_TableView.qml" line="482"/>
<source>Focus not acquired: Please click any item in the form as the target for insertion!</source> <source>Focus not acquired: Please click any item in the form as the target for insertion!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="508"/> <location filename="qml/page/T_TableView.qml" line="513"/>
<source>Avatar</source> <source>Avatar</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="522"/> <location filename="qml/page/T_TableView.qml" line="527"/>
<source>Address</source> <source>Address</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="530"/> <location filename="qml/page/T_TableView.qml" line="535"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="537"/> <location filename="qml/page/T_TableView.qml" line="542"/>
<source>Long String</source> <source>Long String</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="545"/> <location filename="qml/page/T_TableView.qml" line="550"/>
<source>Options</source> <source>Options</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="563"/> <location filename="qml/page/T_TableView.qml" line="568"/>
<source>&lt;Previous</source> <source>&lt;Previous</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="564"/> <location filename="qml/page/T_TableView.qml" line="569"/>
<source>Next&gt;</source> <source>Next&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2461,15 +2185,10 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>This is a text that can be copied</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_Text.qml" line="29"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_TextBox</name> <name>T_TextBox</name>
@ -2543,35 +2262,8 @@ Some contents...</source>
<message> <message>
<location filename="qml/page/T_Theme.qml" line="123"/> <location filename="qml/page/T_Theme.qml" line="123"/>
<source>Open Blur Window</source> <source>Open Blur Window</source>
<oldsource>Rounded Window</oldsource>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Theme.qml" line="175"/>
<source>window blurRadius</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Theme.qml" line="135"/>
<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>
<context> <context>
<name>T_TimePicker</name> <name>T_TimePicker</name>
@ -2644,27 +2336,6 @@ Some contents...</source>
<source>clear</source> <source>clear</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_ToggleSwitch</name> <name>T_ToggleSwitch</name>
@ -2792,57 +2463,22 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="92"/> <location filename="qml/page/T_TreeView.qml" line="183"/>
<source>cellHeight:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="105"/>
<source>depthPadding:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="121"/>
<source>showLine</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="126"/>
<source>checkable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="134"/>
<source>all expand</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="140"/>
<source>all collapse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="147"/>
<source>print selection model</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="182"/>
<source>Title</source> <source>Title</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="186"/> <location filename="qml/page/T_TreeView.qml" line="187"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="190"/> <location filename="qml/page/T_TreeView.qml" line="191"/>
<source>Avatar</source> <source>Avatar</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TreeView.qml" line="194"/> <location filename="qml/page/T_TreeView.qml" line="195"/>
<source>Address</source> <source>Address</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2854,41 +2490,6 @@ Some contents...</source>
<source>Typography</source> <source>Typography</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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>
<context> <context>
<name>T_Watermark</name> <name>T_Watermark</name>
@ -2897,45 +2498,5 @@ Some contents...</source>
<source>Watermark</source> <source>Watermark</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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> </context>
</TS> </TS>

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -12,7 +12,7 @@ FluScrollablePage{
Component.onCompleted: { Component.onCompleted: {
var items = [] var items = []
for(var i=0;i<10;i++){ 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_1.items = items
breadcrumb_2.items = items breadcrumb_2.items = items
@ -51,7 +51,7 @@ FluScrollablePage{
onClicked:{ onClicked:{
var items = [] var items = []
for(var i=0;i<10;i++){ for(var i=0;i<10;i++){
items.push({title: qsTr("Item_")+(i+1)}) items.push({title:"Item_"+(i+1)})
} }
breadcrumb_2.items = items breadcrumb_2.items = items
} }

View File

@ -219,7 +219,7 @@ FluScrollablePage{
FluLoadingButton{ FluLoadingButton{
id: btn_loading id: btn_loading
loading: loading_button_switch.checked loading: loading_button_switch.checked
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Loading Button") text: qsTr("Loading Button")
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: parent.left
@ -235,7 +235,7 @@ FluScrollablePage{
right: parent.right right: parent.right
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Normal") text: qsTr("Loading")
} }
} }
CodeExpander{ CodeExpander{
@ -399,14 +399,16 @@ FluScrollablePage{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: parent.left
} }
disabled: radio_button_switch.checked
FluRadioButton{ FluRadioButton{
disabled:radio_button_switch.checked
text: qsTr("Radio Button_1") text: qsTr("Radio Button_1")
} }
FluRadioButton{ FluRadioButton{
disabled:radio_button_switch.checked
text: qsTr("Radio Button_2") text: qsTr("Radio Button_2")
} }
FluRadioButton{ FluRadioButton{
disabled:radio_button_switch.checked
text: qsTr("Radio Button_3") text: qsTr("Radio Button_3")
} }
} }

View File

@ -45,7 +45,7 @@ FluScrollablePage{
Layout.preferredWidth: 240 Layout.preferredWidth: 240
} }
FluButton{ FluButton{
text: qsTr("verify") text:"verify"
onClicked: { onClicked: {
var success = captcha.verify(text_box.text) var success = captcha.verify(text_box.text)
if(success){ 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{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -6 Layout.topMargin: -6
@ -211,7 +129,6 @@ FluScrollablePage{
id:carousel id:carousel
width: 400 width: 400
height: 300 height: 300
orientation: Qt.Vertical
delegate: Component{ delegate: Component{
Image { Image {
anchors.fill: parent anchors.fill: parent

View File

@ -17,15 +17,15 @@ FluScrollablePage{
spacing: 5 spacing: 5
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
FluText{ FluText{
text: qsTr("editable=false") text: "editable=false"
x:10 x:10
} }
FluComboBox { FluComboBox {
model: ListModel { model: ListModel {
id: model_1 id: model_1
ListElement { text: qsTr("Banana") } ListElement { text: "Banana" }
ListElement { text: qsTr("Apple") } ListElement { text: "Apple" }
ListElement { text: qsTr("Coconut") } ListElement { text: "Coconut" }
} }
} }
} }
@ -40,16 +40,16 @@ FluScrollablePage{
spacing: 5 spacing: 5
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
FluText{ FluText{
text: qsTr("disabled=true") text: "disabled=true"
x:10 x:10
} }
FluComboBox { FluComboBox {
disabled: true disabled: true
model: ListModel { model: ListModel {
id: model_2 id: model_2
ListElement { text: qsTr("Banana") } ListElement { text: "Banana" }
ListElement { text: qsTr("Apple") } ListElement { text: "Apple" }
ListElement { text: qsTr("Coconut") } ListElement { text: "Coconut" }
} }
} }
} }
@ -64,16 +64,16 @@ FluScrollablePage{
spacing: 5 spacing: 5
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
FluText{ FluText{
text: qsTr("editable=true") text: "editable=true"
x:5 x:5
} }
FluComboBox { FluComboBox {
editable: true editable: true
model: ListModel { model: ListModel {
id: model_3 id: model_3
ListElement { text: qsTr("Banana") } ListElement { text: "Banana" }
ListElement { text: qsTr("Apple") } ListElement { text: "Apple" }
ListElement { text: qsTr("Coconut") } ListElement { text: "Coconut" }
} }
onAccepted: { onAccepted: {
if (find(editText) === -1) if (find(editText) === -1)
@ -85,21 +85,19 @@ FluScrollablePage{
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -6 Layout.topMargin: -6
code:qsTr('FluComboBox{ code:'FluComboBox{
editable: true editable: true
model: ListModel { model: ListModel {
id: model id: model
ListElement { text: "%1" } ListElement { text: "Banana" }
ListElement { text: "%2" } ListElement { text: "Apple" }
ListElement { text: "%3" } ListElement { text: "Coconut" }
} }
onAccepted: { onAccepted: {
if (find(editText) === -1) if (find(editText) === -1)
model.append({text: editText}) 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) 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{ GridView{
id: grid_view id: grid_view
cellWidth: 110 cellWidth: 110
@ -54,7 +45,6 @@ FluContentPage {
horizontalPadding: 0 horizontalPadding: 0
bottomPadding: 30 bottomPadding: 30
anchors.fill: parent anchors.fill: parent
disabled: toggle_switch.checked
onClicked: { onClicked: {
var text ="FluentIcons."+modelData.name; var text ="FluentIcons."+modelData.name;
FluTools.clipText(text) FluTools.clipText(text)
@ -67,7 +57,6 @@ FluContentPage {
text: modelData.name text: modelData.name
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 60 anchors.topMargin: 60
enabled: !toggle_switch.checked
} }
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -315,7 +315,12 @@ FluContentPage{
radius: [20,20,20,20] radius: [20,20,20,20]
Image{ Image{
anchors.fill: parent anchors.fill: parent
source: options && options.avatar ? options.avatar : "" source: {
if(options && options.avatar){
return options.avatar
}
return ""
}
sourceSize: Qt.size(80,80) sourceSize: Qt.size(80,80)
} }
} }

View File

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

View File

@ -13,7 +13,7 @@ FluScrollablePage{
FluFrame{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.preferredHeight: 408
padding: 10 padding: 10
ColumnLayout{ ColumnLayout{
@ -124,69 +124,12 @@ FluScrollablePage{
Layout.topMargin: 20 Layout.topMargin: 20
} }
FluToggleSwitch{ FluToggleSwitch{
id: toggle_blur
Layout.topMargin: 5 Layout.topMargin: 5
checked: FluTheme.blurBehindWindowEnabled checked: FluTheme.blurBehindWindowEnabled
onClicked: { onClicked: {
FluTheme.blurBehindWindowEnabled = !FluTheme.blurBehindWindowEnabled FluTheme.blurBehindWindowEnabled = !FluTheme.blurBehindWindowEnabled
} }
} }
FluText{
text: qsTr("window effect")
Layout.topMargin: 20
}
Row{
spacing: 10
Repeater{
model: window.availableEffects
delegate: FluRadioButton{
checked: window.effect === modelData
text: qsTr(`${modelData}`)
clickListener:function(){
window.effect = modelData
if(window.effective){
FluTheme.blurBehindWindowEnabled = false
toggle_blur.checked = Qt.binding( function() {return FluTheme.blurBehindWindowEnabled})
}
}
}
}
}
FluText{
visible: FluTheme.blurBehindWindowEnabled || window.effect === qsTr("dwm-blur")
text: qsTr("window tintOpacity")
Layout.topMargin: 20
}
FluSlider{
visible: FluTheme.blurBehindWindowEnabled || window.effect === qsTr("dwm-blur")
Layout.topMargin: 5
to:1
stepSize:0.1
onValueChanged: {
window.tintOpacity = value
}
Component.onCompleted: {
value = window.tintOpacity
}
}
FluText{
visible: FluTheme.blurBehindWindowEnabled
text: qsTr("window blurRadius")
Layout.topMargin: 20
}
FluSlider{
visible: FluTheme.blurBehindWindowEnabled
Layout.topMargin: 5
to:100
stepSize:1
onValueChanged: {
window.blurRadius = value
}
Component.onCompleted: {
value = window.blurRadius
}
}
} }
} }
CodeExpander{ CodeExpander{

View File

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

View File

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

View File

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

View File

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

View File

@ -236,7 +236,6 @@ FluWindow {
id: reveal id: reveal
target: window.containerItem() target: window.containerItem()
anchors.fill: parent anchors.fill: parent
darkToLight: FluTheme.dark
onAnimationFinished:{ onAnimationFinished:{
// //
loader_reveal.sourceComponent = undefined loader_reveal.sourceComponent = undefined
@ -257,14 +256,17 @@ FluWindow {
} }
function handleDarkChanged(button){ function handleDarkChanged(button){
if(FluTools.isMacos() || !FluTheme.animationEnabled){ if(!FluTheme.animationEnabled || window.fitsAppBarWindows === false){
changeDark() changeDark()
}else{ }else{
if(loader_reveal.sourceComponent){
return
}
loader_reveal.sourceComponent = com_reveal loader_reveal.sourceComponent = com_reveal
var target = window.containerItem() var target = window.containerItem()
var pos = button.mapToItem(target,0,0) var pos = button.mapToItem(target,0,0)
var mouseX = pos.x + button.width / 2 var mouseX = pos.x
var mouseY = pos.y + button.height / 2 var mouseY = pos.y
var radius = Math.max(distance(mouseX,mouseY,0,0),distance(mouseX,mouseY,target.width,0),distance(mouseX,mouseY,0,target.height),distance(mouseX,mouseY,target.width,target.height)) var radius = Math.max(distance(mouseX,mouseY,0,0),distance(mouseX,mouseY,target.width,0),distance(mouseX,mouseY,0,target.height),distance(mouseX,mouseY,target.width,target.height))
var reveal = loader_reveal.item var reveal = loader_reveal.item
reveal.start(reveal.width*Screen.devicePixelRatio,reveal.height*Screen.devicePixelRatio,Qt.point(mouseX,mouseY),radius) reveal.start(reveal.width*Screen.devicePixelRatio,reveal.height*Screen.devicePixelRatio,Qt.point(mouseX,mouseY),radius)

View File

@ -72,6 +72,11 @@ install(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION . BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(QT_VERSION_MAJOR EQUAL 6)
qt_import_qml_plugins(${PROJECT_NAME})
qt_finalize_executable(${PROJECT_NAME})
endif()
if (CMAKE_BUILD_TYPE MATCHES "Release") if (CMAKE_BUILD_TYPE MATCHES "Release")
if (APPLE) if (APPLE)
find_program(QT_DEPLOY_QT NAMES macdeployqt) find_program(QT_DEPLOY_QT NAMES macdeployqt)

View File

@ -25,32 +25,13 @@ void CircularReveal::paint(QPainter *painter) {
path.moveTo(_center.x(), _center.y()); path.moveTo(_center.x(), _center.y());
path.addEllipse(QPointF(_center.x(), _center.y()), _radius, _radius); path.addEllipse(QPointF(_center.x(), _center.y()), _radius, _radius);
painter->setCompositionMode(QPainter::CompositionMode_Clear); painter->setCompositionMode(QPainter::CompositionMode_Clear);
if(_darkToLight){ painter->fillPath(path, Qt::black);
painter->fillPath(path, Qt::white);
}else{
QPainterPath outerRect;
outerRect.addRect(0, 0, width(), height());
outerRect = outerRect.subtracted(path);
painter->fillPath(outerRect, Qt::black);
}
painter->restore(); painter->restore();
} }
[[maybe_unused]] void CircularReveal::start(int w, int h, const QPoint &center, int radius) { [[maybe_unused]] void CircularReveal::start(int w, int h, const QPoint &center, int radius) {
if (_anim->state() == QAbstractAnimation::Running) { _anim->setStartValue(0);
_anim->stop(); _anim->setEndValue(radius);
int currentRadius = _radius;
_anim->setStartValue(currentRadius);
_anim->setEndValue(_darkToLight ? 0 : radius);
} else {
if(_darkToLight){
_anim->setStartValue(radius);
_anim->setEndValue(0);
}else{
_anim->setStartValue(0);
_anim->setEndValue(radius);
}
}
_center = center; _center = center;
_grabResult = _target->grabToImage(QSize(w, h)); _grabResult = _target->grabToImage(QSize(w, h));
connect(_grabResult.data(), &QQuickItemGrabResult::ready, this, connect(_grabResult.data(), &QQuickItemGrabResult::ready, this,

View File

@ -10,7 +10,6 @@ class CircularReveal : public QQuickPaintedItem {
Q_OBJECT Q_OBJECT
Q_PROPERTY_AUTO_P(QQuickItem *, target) Q_PROPERTY_AUTO_P(QQuickItem *, target)
Q_PROPERTY_AUTO(int, radius) Q_PROPERTY_AUTO(int, radius)
Q_PROPERTY_AUTO(bool, darkToLight)
public: public:
explicit CircularReveal(QQuickItem *parent = nullptr); explicit CircularReveal(QQuickItem *parent = nullptr);
void paint(QPainter *painter) override; void paint(QPainter *painter) override;

View File

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

View File

@ -145,7 +145,7 @@ endif ()
if (QT_VERSION VERSION_GREATER_EQUAL "6.2") if (QT_VERSION VERSION_GREATER_EQUAL "6.2")
#Qt6.2使qt_add_libraryqt_add_qml_module #Qt6.2使qt_add_libraryqt_add_qml_module
if (FLUENTUI_BUILD_STATIC_LIB) 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 () endif ()
qt_add_library(${PROJECT_NAME} ${LIB_TYPE}) qt_add_library(${PROJECT_NAME} ${LIB_TYPE})
qt_add_qml_module(${PROJECT_NAME} qt_add_qml_module(${PROJECT_NAME}
@ -227,7 +227,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release")) if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release"))
find_program(QML_PLUGIN_DUMP NAMES qmlplugindump) find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)
add_custom_target(Script-Generate-QmlTypes add_custom_target(Script-Generate-QmlTypes
COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable -noinstantiate FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
COMMENT "Generate qmltypes........." COMMENT "Generate qmltypes........."
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -4,156 +4,32 @@
#include <QGuiApplication> #include <QGuiApplication>
#include <QScreen> #include <QScreen>
#include <QDateTime> #include <QDateTime>
#include <optional>
#include "FluTools.h" #include "FluTools.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
static DwmSetWindowAttributeFunc pDwmSetWindowAttribute = nullptr; #pragma comment (lib, "user32.lib")
static DwmExtendFrameIntoClientAreaFunc pDwmExtendFrameIntoClientArea = nullptr; #pragma comment (lib, "dwmapi.lib")
static DwmIsCompositionEnabledFunc pDwmIsCompositionEnabled = nullptr;
static DwmEnableBlurBehindWindowFunc pDwmEnableBlurBehindWindow = nullptr;
static SetWindowCompositionAttributeFunc pSetWindowCompositionAttribute = nullptr;
static GetDpiForWindowFunc pGetDpiForWindow = nullptr;
static GetSystemMetricsForDpiFunc pGetSystemMetricsForDpi = nullptr;
static RTL_OSVERSIONINFOW GetRealOSVersionImpl() { #include <windows.h>
HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll"); #include <windowsx.h>
using RtlGetVersionPtr = NTSTATUS(WINAPI *)(PRTL_OSVERSIONINFOW); #include <dwmapi.h>
auto pRtlGetVersion =
reinterpret_cast<RtlGetVersionPtr>(::GetProcAddress(hMod, "RtlGetVersion"));
RTL_OSVERSIONINFOW rovi{};
rovi.dwOSVersionInfoSize = sizeof(rovi);
pRtlGetVersion(&rovi);
return rovi;
}
RTL_OSVERSIONINFOW GetRealOSVersion() {
static const auto result = GetRealOSVersionImpl();
return result;
}
static inline bool isWin8OrGreater() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return (rovi.dwMajorVersion > 6) || (rovi.dwMajorVersion == 6 && rovi.dwMinorVersion >= 2);
}
static inline bool isWin8Point1OrGreater() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return (rovi.dwMajorVersion > 6) || (rovi.dwMajorVersion == 6 && rovi.dwMinorVersion >= 3);
}
static inline bool isWin10OrGreater() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return (rovi.dwMajorVersion > 10) || (rovi.dwMajorVersion == 10 && rovi.dwMinorVersion >= 0);
}
static inline bool isWin101809OrGreater() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return (rovi.dwMajorVersion > 10) ||
(rovi.dwMajorVersion == 10 && rovi.dwMinorVersion >= 0 && rovi.dwBuildNumber >= 17763);
}
static inline bool isWin101903OrGreater() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return (rovi.dwMajorVersion > 10) ||
(rovi.dwMajorVersion == 10 && rovi.dwMinorVersion >= 0 && rovi.dwBuildNumber >= 18362);
}
static inline bool isWin11OrGreater() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return (rovi.dwMajorVersion > 10) ||
(rovi.dwMajorVersion == 10 && rovi.dwMinorVersion >= 0 && rovi.dwBuildNumber >= 22000);
}
static inline bool isWin1122H2OrGreater() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return (rovi.dwMajorVersion > 10) ||
(rovi.dwMajorVersion == 10 && rovi.dwMinorVersion >= 0 && rovi.dwBuildNumber >= 22621);
}
static inline bool isWin10Only() {
return isWin10OrGreater() && !isWin11OrGreater();
}
static inline bool isWin7Only() {
RTL_OSVERSIONINFOW rovi = GetRealOSVersion();
return rovi.dwMajorVersion == 7;
}
static inline QByteArray qtNativeEventType() { static inline QByteArray qtNativeEventType() {
static const auto result = "windows_generic_MSG"; static const auto result = "windows_generic_MSG";
return result; return result;
} }
static inline bool initializeFunctionPointers() {
HMODULE module = LoadLibraryW(L"dwmapi.dll");
if (module) {
if (!pDwmSetWindowAttribute) {
pDwmSetWindowAttribute = reinterpret_cast<DwmSetWindowAttributeFunc>(
GetProcAddress(module, "DwmSetWindowAttribute"));
if (!pDwmSetWindowAttribute) {
return false;
}
}
if (!pDwmExtendFrameIntoClientArea) {
pDwmExtendFrameIntoClientArea = reinterpret_cast<DwmExtendFrameIntoClientAreaFunc>(
GetProcAddress(module, "DwmExtendFrameIntoClientArea"));
if (!pDwmExtendFrameIntoClientArea) {
return false;
}
}
if (!pDwmIsCompositionEnabled) {
pDwmIsCompositionEnabled = reinterpret_cast<DwmIsCompositionEnabledFunc>(
::GetProcAddress(module, "DwmIsCompositionEnabled"));
if (!pDwmIsCompositionEnabled) {
return false;
}
}
if (!pDwmEnableBlurBehindWindow) {
pDwmEnableBlurBehindWindow = reinterpret_cast<DwmEnableBlurBehindWindowFunc>(
GetProcAddress(module, "DwmEnableBlurBehindWindow"));
if (!pDwmEnableBlurBehindWindow) {
return false;
}
}
}
HMODULE user32 = LoadLibraryW(L"user32.dll");
if (module) {
if (!pSetWindowCompositionAttribute) {
pSetWindowCompositionAttribute = reinterpret_cast<SetWindowCompositionAttributeFunc>(
GetProcAddress(user32, "SetWindowCompositionAttribute"));
if (!pSetWindowCompositionAttribute) {
return false;
}
}
if (!pGetDpiForWindow) {
pGetDpiForWindow =
reinterpret_cast<GetDpiForWindowFunc>(GetProcAddress(user32, "GetDpiForWindow"));
if (!pGetDpiForWindow) {
return false;
}
}
if (!pGetSystemMetricsForDpi) {
pGetSystemMetricsForDpi = reinterpret_cast<GetSystemMetricsForDpiFunc>(
GetProcAddress(user32, "GetSystemMetricsForDpi"));
if (!pGetSystemMetricsForDpi) {
return false;
}
}
}
return true;
}
static inline bool isCompositionEnabled() { static inline bool isCompositionEnabled() {
if (initializeFunctionPointers()) { typedef HRESULT (WINAPI *DwmIsCompositionEnabledPtr)(BOOL *pfEnabled);
HMODULE module = ::LoadLibraryW(L"dwmapi.dll");
if (module) {
BOOL composition_enabled = false; BOOL composition_enabled = false;
pDwmIsCompositionEnabled(&composition_enabled); DwmIsCompositionEnabledPtr dwm_is_composition_enabled;
dwm_is_composition_enabled = reinterpret_cast<DwmIsCompositionEnabledPtr>(::GetProcAddress(module, "DwmIsCompositionEnabled"));
if (dwm_is_composition_enabled) {
dwm_is_composition_enabled(&composition_enabled);
}
return composition_enabled; return composition_enabled;
} }
return false; return false;
@ -161,195 +37,15 @@ static inline bool isCompositionEnabled() {
static inline void setShadow(HWND hwnd) { static inline void setShadow(HWND hwnd) {
const MARGINS shadow = {1, 0, 0, 0}; const MARGINS shadow = {1, 0, 0, 0};
if (initializeFunctionPointers()) { typedef HRESULT (WINAPI *DwmExtendFrameIntoClientAreaPtr)(HWND hWnd, const MARGINS *pMarInset);
pDwmExtendFrameIntoClientArea(hwnd, &shadow); HMODULE module = LoadLibraryW(L"dwmapi.dll");
} if (module) {
if (isWin7Only()) { DwmExtendFrameIntoClientAreaPtr dwm_extendframe_into_client_area_;
SetClassLong(hwnd, GCL_STYLE, GetClassLong(hwnd, GCL_STYLE) | CS_DROPSHADOW); dwm_extendframe_into_client_area_ = reinterpret_cast<DwmExtendFrameIntoClientAreaPtr>(GetProcAddress(module, "DwmExtendFrameIntoClientArea"));
} if (dwm_extendframe_into_client_area_) {
} dwm_extendframe_into_client_area_(hwnd, &shadow);
static inline bool setWindowDarkMode(HWND hwnd, const BOOL enable) {
if (!initializeFunctionPointers()) {
return false;
}
return bool(pDwmSetWindowAttribute(hwnd, 20, &enable, sizeof(BOOL)));
}
static inline std::optional<MONITORINFOEXW> getMonitorForWindow(const HWND hwnd) {
Q_ASSERT(hwnd);
if (!hwnd) {
return std::nullopt;
}
const HMONITOR monitor = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
if (!monitor) {
return std::nullopt;
}
MONITORINFOEXW monitorInfo;
::SecureZeroMemory(&monitorInfo, sizeof(monitorInfo));
monitorInfo.cbSize = sizeof(monitorInfo);
if (::GetMonitorInfoW(monitor, &monitorInfo) == FALSE) {
return std::nullopt;
}
return monitorInfo;
};
static inline bool isFullScreen(const HWND hwnd) {
RECT windowRect = {};
if (::GetWindowRect(hwnd, &windowRect) == FALSE) {
return false;
}
const std::optional<MONITORINFOEXW> mi = getMonitorForWindow(hwnd);
if (!mi.has_value()) {
return false;
}
RECT rcMonitor = mi.value().rcMonitor;
return windowRect.top == rcMonitor.top && windowRect.left == rcMonitor.left &&
windowRect.right == rcMonitor.right && windowRect.bottom == rcMonitor.bottom;
}
static inline bool isMaximized(const HWND hwnd) {
WINDOWPLACEMENT wp;
::GetWindowPlacement(hwnd, &wp);
return wp.showCmd == SW_MAXIMIZE;
}
static inline quint32 getDpiForWindow(const HWND hwnd, const bool horizontal) {
if (const UINT dpi = pGetDpiForWindow(hwnd)) {
return dpi;
}
if (const HDC hdc = ::GetDC(hwnd)) {
bool valid = false;
const int dpiX = ::GetDeviceCaps(hdc, LOGPIXELSX);
const int dpiY = ::GetDeviceCaps(hdc, LOGPIXELSY);
if ((dpiX > 0) && (dpiY > 0)) {
valid = true;
}
::ReleaseDC(hwnd, hdc);
if (valid) {
return (horizontal ? dpiX : dpiY);
} }
} }
return 96;
}
static inline int getSystemMetrics(const HWND hwnd, const int index, const bool horizontal) {
const UINT dpi = getDpiForWindow(hwnd, horizontal);
if (const int result = pGetSystemMetricsForDpi(index, dpi); result > 0) {
return result;
}
return ::GetSystemMetrics(index);
}
static inline quint32 getResizeBorderThickness(const HWND hwnd, const bool horizontal,
const qreal devicePixelRatio) {
auto frame = horizontal ? SM_CXSIZEFRAME : SM_CYSIZEFRAME;
auto result =
getSystemMetrics(hwnd, frame, horizontal) + getSystemMetrics(hwnd, 92, horizontal);
if (result > 0) {
return result;
}
int thickness = isCompositionEnabled() ? 8 : 4;
return qRound(thickness * devicePixelRatio);
}
static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &enable) {
static constexpr const MARGINS extendedMargins = {-1, -1, -1, -1};
if (key == QStringLiteral("mica")) {
if (!isWin11OrGreater() || !initializeFunctionPointers()) {
return false;
}
if (enable) {
pDwmExtendFrameIntoClientArea(hwnd, &extendedMargins);
if (isWin1122H2OrGreater()) {
const DWORD backdropType = _DWMSBT_MAINWINDOW;
pDwmSetWindowAttribute(hwnd, 38, &backdropType, sizeof(backdropType));
} else {
const BOOL enable = TRUE;
pDwmSetWindowAttribute(hwnd, 1029, &enable, sizeof(enable));
}
} else {
if (isWin1122H2OrGreater()) {
const DWORD backdropType = _DWMSBT_AUTO;
pDwmSetWindowAttribute(hwnd, 38, &backdropType, sizeof(backdropType));
} else {
const BOOL enable = FALSE;
pDwmSetWindowAttribute(hwnd, 1029, &enable, sizeof(enable));
}
}
return true;
}
if (key == QStringLiteral("mica-alt")) {
if (!isWin1122H2OrGreater() || !initializeFunctionPointers()) {
return false;
}
if (enable) {
pDwmExtendFrameIntoClientArea(hwnd, &extendedMargins);
const DWORD backdropType = _DWMSBT_TABBEDWINDOW;
pDwmSetWindowAttribute(hwnd, 38, &backdropType, sizeof(backdropType));
} else {
const DWORD backdropType = _DWMSBT_AUTO;
pDwmSetWindowAttribute(hwnd, 38, &backdropType, sizeof(backdropType));
}
return true;
}
if (key == QStringLiteral("acrylic")) {
if (!isWin11OrGreater() || !initializeFunctionPointers()) {
return false;
}
if (enable) {
pDwmExtendFrameIntoClientArea(hwnd, &extendedMargins);
DWORD system_backdrop_type = _DWMSBT_TRANSIENTWINDOW;
pDwmSetWindowAttribute(hwnd, 38, &system_backdrop_type, sizeof(DWORD));
} else {
const DWORD backdropType = _DWMSBT_AUTO;
pDwmSetWindowAttribute(hwnd, 38, &backdropType, sizeof(backdropType));
}
return true;
}
if (key == QStringLiteral("dwm-blur")) {
if ((isWin7Only() && !isCompositionEnabled()) || !initializeFunctionPointers()) {
return false;
}
if (enable) {
if (isWin8OrGreater()) {
ACCENT_POLICY policy{};
policy.dwAccentState = ACCENT_ENABLE_BLURBEHIND;
policy.dwAccentFlags = ACCENT_NONE;
WINDOWCOMPOSITIONATTRIBDATA wcad{};
wcad.Attrib = WCA_ACCENT_POLICY;
wcad.pvData = &policy;
wcad.cbData = sizeof(policy);
pSetWindowCompositionAttribute(hwnd, &wcad);
} else {
DWM_BLURBEHIND bb{};
bb.fEnable = TRUE;
bb.dwFlags = DWM_BB_ENABLE;
pDwmEnableBlurBehindWindow(hwnd, &bb);
}
} else {
if (isWin8OrGreater()) {
ACCENT_POLICY policy{};
policy.dwAccentState = ACCENT_DISABLED;
policy.dwAccentFlags = ACCENT_NONE;
WINDOWCOMPOSITIONATTRIBDATA wcad{};
wcad.Attrib = WCA_ACCENT_POLICY;
wcad.pvData = &policy;
wcad.cbData = sizeof(policy);
pSetWindowCompositionAttribute(hwnd, &wcad);
} else {
DWM_BLURBEHIND bb{};
bb.fEnable = FALSE;
bb.dwFlags = DWM_BB_ENABLE;
pDwmEnableBlurBehindWindow(hwnd, &bb);
}
}
return true;
}
return false;
} }
#endif #endif
@ -374,8 +70,6 @@ FluFrameless::FluFrameless(QQuickItem *parent) : QQuickItem{parent} {
_closeButton = nullptr; _closeButton = nullptr;
_topmost = false; _topmost = false;
_disabled = false; _disabled = false;
_effect = "normal";
_effective = false;
_isWindows11OrGreater = FluTools::getInstance()->isWindows11OrGreater(); _isWindows11OrGreater = FluTools::getInstance()->isWindows11OrGreater();
} }
@ -386,62 +80,16 @@ FluFrameless::~FluFrameless() = default;
} }
void FluFrameless::componentComplete() { void FluFrameless::componentComplete() {
#ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
if (isWin11OrGreater()) {
availableEffects({"mica", "mica-alt", "acrylic", "dwm-blur", "normal"});
} else {
availableEffects({"dwm-blur", "normal"});
}
if (!_effect.isEmpty() && _useSystemEffect) {
effective(setWindowEffect(hwnd, _effect, true));
if (effective()) {
_currentEffect = effect();
}
}
connect(this, &FluFrameless::effectChanged, this, [hwnd, this] {
if (effect() == _currentEffect) {
return;
}
if (effective()) {
setWindowEffect(hwnd, _currentEffect, false);
}
effective(setWindowEffect(hwnd, effect(), true));
if (effective()) {
_currentEffect = effect();
_useSystemEffect = true;
} else {
_effect = "normal";
_currentEffect = "normal";
_useSystemEffect = false;
}
});
connect(this, &FluFrameless::useSystemEffectChanged, this, [this] {
if (!_useSystemEffect) {
effect("normal");
}
});
connect(this, &FluFrameless::isDarkModeChanged, this, [hwnd, this] {
if (effective() && !_currentEffect.isEmpty() && _currentEffect != "normal") {
setWindowDarkMode(hwnd, _isDarkMode);
}
});
#endif
if (_disabled) { if (_disabled) {
return; return;
} }
int w = window()->width(); int w = window()->width();
int h = window()->height(); int h = window()->height();
_current = window()->winId(); _current = window()->winId();
#ifdef Q_OS_MACOS window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
window()->setFlag(Qt::FramelessWindowHint, true); if (!_fixSize) {
window()->setProperty("__borderWidth", 1); window()->setFlag(Qt::WindowMaximizeButtonHint);
#endif }
#ifdef Q_OS_LINUX
window()->setFlag(Qt::CustomizeWindowHint, true);
window()->setFlag(Qt::FramelessWindowHint, true);
window()->setProperty("__borderWidth", 1);
#endif
window()->installEventFilter(this); window()->installEventFilter(this);
QGuiApplication::instance()->installNativeEventFilter(this); QGuiApplication::instance()->installNativeEventFilter(this);
if (_maximizeButton) { if (_maximizeButton) {
@ -454,36 +102,24 @@ void FluFrameless::componentComplete() {
setHitTestVisible(_closeButton); setHitTestVisible(_closeButton);
} }
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3)) #if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3))
qWarning() qWarning()<<"Qt's own frameless bug, currently only exist in 6.5.3, please use other versions";
<< "Qt's own frameless bug, currently only exist in 6.5.3, please use other versions"; #endif
# endif HWND hwnd = reinterpret_cast<HWND>(window()->winId());
if (!hwnd) {
hwnd = reinterpret_cast<HWND>(window()->winId());
}
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE); DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
# if (QT_VERSION == QT_VERSION_CHECK(6, 7, 2))
style &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU);
# endif
if (_fixSize) { if (_fixSize) {
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_CAPTION); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_CAPTION);;
;
for (int i = 0; i <= QGuiApplication::screens().count() - 1; ++i) { for (int i = 0; i <= QGuiApplication::screens().count() - 1; ++i) {
connect( connect(QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] {
QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] { SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, });
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
});
} }
} else { } else {
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CAPTION); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CAPTION);
} }
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
connect(window(), &QQuickWindow::screenChanged, this, [hwnd] { connect(window(), &QQuickWindow::screenChanged, this, [hwnd] {
::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, ::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOOWNERZORDER);
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED |
SWP_NOOWNERZORDER);
::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); ::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
}); });
if (!window()->property("_hideShadow").toBool()) { if (!window()->property("_hideShadow").toBool()) {
@ -500,12 +136,13 @@ void FluFrameless::componentComplete() {
window()->setMaximumHeight(window()->maximumHeight() + appBarHeight); window()->setMaximumHeight(window()->maximumHeight() + appBarHeight);
} }
window()->resize(QSize(w, h)); window()->resize(QSize(w, h));
connect(this, &FluFrameless::topmostChanged, this, [this] { _setWindowTopmost(topmost()); }); connect(this, &FluFrameless::topmostChanged, this, [this] {
_setWindowTopmost(topmost());
});
_setWindowTopmost(topmost()); _setWindowTopmost(topmost());
} }
[[maybe_unused]] bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message, [[maybe_unused]] bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message, QT_NATIVE_EVENT_RESULT_TYPE *result) {
QT_NATIVE_EVENT_RESULT_TYPE *result) {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
if ((eventType != qtNativeEventType()) || !message) { if ((eventType != qtNativeEventType()) || !message) {
return false; return false;
@ -526,71 +163,19 @@ void FluFrameless::componentComplete() {
auto *wp = reinterpret_cast<WINDOWPOS *>(lParam); auto *wp = reinterpret_cast<WINDOWPOS *>(lParam);
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) { if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) {
wp->flags |= SWP_NOCOPYBITS; wp->flags |= SWP_NOCOPYBITS;
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>( *result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(::DefWindowProcW(hwnd, uMsg, wParam, lParam));
::DefWindowProcW(hwnd, uMsg, wParam, lParam));
return true; return true;
} }
return false; return false;
} else if (uMsg == WM_NCCALCSIZE && wParam == TRUE) { } else if (uMsg == WM_NCCALCSIZE && wParam == TRUE) {
const auto clientRect = bool isMaximum = ::IsZoomed(hwnd);
((wParam == FALSE) ? reinterpret_cast<LPRECT>(lParam) if (isMaximum) {
: &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]); window()->setProperty("__margins",7);
bool isMax = ::isMaximized(hwnd); }else{
bool isFull = ::isFullScreen(hwnd); window()->setProperty("__margins",0);
if (isMax && !isFull) {
auto ty = getResizeBorderThickness(hwnd, false, window()->devicePixelRatio());
clientRect->top += ty;
clientRect->bottom -= ty;
auto tx = getResizeBorderThickness(hwnd, true, window()->devicePixelRatio());
clientRect->left += tx;
clientRect->right -= tx;
} }
if (isMax || isFull) { _setMaximizeHovered(false);
APPBARDATA abd; *result = WVR_REDRAW;
SecureZeroMemory(&abd, sizeof(abd));
abd.cbSize = sizeof(abd);
const UINT taskbarState = ::SHAppBarMessage(ABM_GETSTATE, &abd);
if (taskbarState & ABS_AUTOHIDE) {
bool top = false, bottom = false, left = false, right = false;
int edge = -1;
APPBARDATA abd2;
SecureZeroMemory(&abd2, sizeof(abd2));
abd2.cbSize = sizeof(abd2);
abd2.hWnd = ::FindWindowW(L"Shell_TrayWnd", nullptr);
if (abd2.hWnd) {
const HMONITOR windowMonitor =
::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
if (windowMonitor) {
const HMONITOR taskbarMonitor =
::MonitorFromWindow(abd2.hWnd, MONITOR_DEFAULTTOPRIMARY);
if (taskbarMonitor) {
if (taskbarMonitor == windowMonitor) {
::SHAppBarMessage(ABM_GETTASKBARPOS, &abd2);
edge = abd2.uEdge;
}
}
}
}
top = (edge == ABE_TOP);
bottom = (edge == ABE_BOTTOM);
left = (edge == ABE_LEFT);
right = (edge == ABE_RIGHT);
if (top) {
clientRect->top += 1;
} else if (bottom) {
clientRect->bottom -= 1;
} else if (left) {
clientRect->left += 1;
} else if (right) {
clientRect->right -= 1;
} else {
clientRect->bottom -= 1;
}
} else {
clientRect->bottom += 1;
}
}
*result = 0;
return true; return true;
} else if (uMsg == WM_NCHITTEST) { } else if (uMsg == WM_NCHITTEST) {
if (_isWindows11OrGreater) { if (_isWindows11OrGreater) {
@ -646,29 +231,21 @@ void FluFrameless::componentComplete() {
*result = HTCLIENT; *result = HTCLIENT;
return true; return true;
} else if (uMsg == WM_NCPAINT) { } else if (uMsg == WM_NCPAINT) {
if (isCompositionEnabled() && !this->_isFullScreen()) {
return false;
}
*result = FALSE; *result = FALSE;
return true; return false;
} else if (uMsg == WM_NCACTIVATE) { } else if (uMsg == WM_NCACTIVATE) {
if (isCompositionEnabled()) { *result = TRUE;
return false;
}
*result = true;
return true; return true;
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) { } else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
if (_hitMaximizeButton()) { if (_hitMaximizeButton()) {
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QGuiApplication::sendEvent(_maximizeButton, &event); QGuiApplication::sendEvent(_maximizeButton, &event);
_setMaximizePressed(true); _setMaximizePressed(true);
return true; return true;
} }
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP)) { } else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP)) {
if (_hitMaximizeButton()) { if (_hitMaximizeButton()) {
QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QGuiApplication::sendEvent(_maximizeButton, &event); QGuiApplication::sendEvent(_maximizeButton, &event);
_setMaximizePressed(false); _setMaximizePressed(false);
return true; return true;
@ -723,8 +300,7 @@ void FluFrameless::_showSystemMenu(QPoint point) {
return; return;
} }
const QPoint origin = screen->geometry().topLeft(); const QPoint origin = screen->geometry().topLeft();
auto nativePos = auto nativePos = QPointF(QPointF(point - origin) * window()->devicePixelRatio()).toPoint() + origin;
QPointF(QPointF(point - origin) * window()->devicePixelRatio()).toPoint() + origin;
HWND hwnd = reinterpret_cast<HWND>(window()->winId()); HWND hwnd = reinterpret_cast<HWND>(window()->winId());
auto hMenu = ::GetSystemMenu(hwnd, FALSE); auto hMenu = ::GetSystemMenu(hwnd, FALSE);
if (_isMaximized() || _isFullScreen()) { if (_isMaximized() || _isFullScreen()) {
@ -741,10 +317,8 @@ void FluFrameless::_showSystemMenu(QPoint point) {
::EnableMenuItem(hMenu, SC_SIZE, MFS_DISABLED); ::EnableMenuItem(hMenu, SC_SIZE, MFS_DISABLED);
::EnableMenuItem(hMenu, SC_MAXIMIZE, MFS_DISABLED); ::EnableMenuItem(hMenu, SC_MAXIMIZE, MFS_DISABLED);
} }
const int result = ::TrackPopupMenu( const int result = ::TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)), nativePos.x(),
hMenu, nativePos.y(), 0, hwnd, nullptr);
(TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)),
nativePos.x(), nativePos.y(), 0, hwnd, nullptr);
if (result) { if (result) {
::PostMessageW(hwnd, WM_SYSCOMMAND, result, 0); ::PostMessageW(hwnd, WM_SYSCOMMAND, result, 0);
} }
@ -785,27 +359,27 @@ void FluFrameless::_setMaximizeHovered(bool val) {
void FluFrameless::_updateCursor(int edges) { void FluFrameless::_updateCursor(int edges) {
switch (edges) { switch (edges) {
case 0: case 0:
window()->setCursor(Qt::ArrowCursor); window()->setCursor(Qt::ArrowCursor);
break; break;
case Qt::LeftEdge: case Qt::LeftEdge:
case Qt::RightEdge: case Qt::RightEdge:
window()->setCursor(Qt::SizeHorCursor); window()->setCursor(Qt::SizeHorCursor);
break; break;
case Qt::TopEdge: case Qt::TopEdge:
case Qt::BottomEdge: case Qt::BottomEdge:
window()->setCursor(Qt::SizeVerCursor); window()->setCursor(Qt::SizeVerCursor);
break; break;
case Qt::LeftEdge | Qt::TopEdge: case Qt::LeftEdge | Qt::TopEdge:
case Qt::RightEdge | Qt::BottomEdge: case Qt::RightEdge | Qt::BottomEdge:
window()->setCursor(Qt::SizeFDiagCursor); window()->setCursor(Qt::SizeFDiagCursor);
break; break;
case Qt::RightEdge | Qt::TopEdge: case Qt::RightEdge | Qt::TopEdge:
case Qt::LeftEdge | Qt::BottomEdge: case Qt::LeftEdge | Qt::BottomEdge:
window()->setCursor(Qt::SizeBDiagCursor); window()->setCursor(Qt::SizeBDiagCursor);
break; break;
default: default:
break; break;
} }
} }
@ -850,80 +424,79 @@ void FluFrameless::_setWindowTopmost(bool topmost) {
::SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); ::SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
} }
#else #else
window()->setFlag(Qt::WindowStaysOnTopHint, topmost); window()->setFlag(Qt::WindowStaysOnTopHint,topmost);
#endif #endif
} }
bool FluFrameless::eventFilter(QObject *obj, QEvent *ev) { bool FluFrameless::eventFilter(QObject *obj, QEvent *ev) {
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
switch (ev->type()) { switch (ev->type()) {
case QEvent::MouseButtonPress: case QEvent::MouseButtonPress:
if (_edges != 0) { if(_edges!=0){
QMouseEvent *event = static_cast<QMouseEvent *>(ev); QMouseEvent *event = static_cast<QMouseEvent*>(ev);
if (event->button() == Qt::LeftButton) { if(event->button() == Qt::LeftButton){
_updateCursor(_edges); _updateCursor(_edges);
window()->startSystemResize(Qt::Edges(_edges)); window()->startSystemResize(Qt::Edges(_edges));
} }
} else { }else{
if (_hitAppBar()) { if(_hitAppBar()){
qint64 clickTimer = QDateTime::currentMSecsSinceEpoch(); qint64 clickTimer = QDateTime::currentMSecsSinceEpoch();
qint64 offset = clickTimer - this->_clickTimer; qint64 offset = clickTimer - this->_clickTimer;
this->_clickTimer = clickTimer; this->_clickTimer = clickTimer;
if (offset < 300) { if(offset<300){
if (_isMaximized()) { if(_isMaximized()){
showNormal(); showNormal();
} else { }else{
showMaximized(); showMaximized();
}
} else {
window()->startSystemMove();
} }
}else{
window()->startSystemMove();
} }
} }
break; }
case QEvent::MouseButtonRelease: break;
_edges = 0; case QEvent::MouseButtonRelease:
break; _edges = 0;
case QEvent::MouseMove: { break;
if (_isMaximized() || _isFullScreen()) { case QEvent::MouseMove: {
break; if(_isMaximized() || _isFullScreen()){
}
if (_fixSize) {
break;
}
QMouseEvent *event = static_cast<QMouseEvent *>(ev);
QPoint p =
# if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
event->pos();
# else
event->position().toPoint();
# endif
if (p.x() >= _margins && p.x() <= (window()->width() - _margins) && p.y() >= _margins &&
p.y() <= (window()->height() - _margins)) {
if (_edges != 0) {
_edges = 0;
_updateCursor(_edges);
}
break;
}
_edges = 0;
if (p.x() < _margins) {
_edges |= Qt::LeftEdge;
}
if (p.x() > (window()->width() - _margins)) {
_edges |= Qt::RightEdge;
}
if (p.y() < _margins) {
_edges |= Qt::TopEdge;
}
if (p.y() > (window()->height() - _margins)) {
_edges |= Qt::BottomEdge;
}
_updateCursor(_edges);
break; break;
} }
default: if(_fixSize){
break; break;
}
QMouseEvent *event = static_cast<QMouseEvent*>(ev);
QPoint p =
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
event->pos();
#else
event->position().toPoint();
#endif
if(p.x() >= _margins && p.x() <= (window()->width() - _margins) && p.y() >= _margins && p.y() <= (window()->height() - _margins)){
if(_edges != 0){
_edges = 0;
_updateCursor(_edges);
}
break;
}
_edges = 0;
if ( p.x() < _margins ) {
_edges |= Qt::LeftEdge;
}
if ( p.x() > (window()->width() - _margins) ) {
_edges |= Qt::RightEdge;
}
if ( p.y() < _margins ) {
_edges |= Qt::TopEdge;
}
if ( p.y() > (window()->height() - _margins) ) {
_edges |= Qt::BottomEdge;
}
_updateCursor(_edges);
break;
}
default:
break;
} }
#endif #endif
return QObject::eventFilter(obj, ev); return QObject::eventFilter(obj, ev);

View File

@ -6,102 +6,6 @@
#include <QQmlProperty> #include <QQmlProperty>
#include "stdafx.h" #include "stdafx.h"
#ifdef Q_OS_WIN
# pragma comment(lib, "user32.lib")
# pragma comment(lib, "dwmapi.lib")
# include <windows.h>
# include <windowsx.h>
# include <dwmapi.h>
enum _DWM_SYSTEMBACKDROP_TYPE {
_DWMSBT_AUTO, // [Default] Let DWM automatically decide the system-drawn backdrop for this
// window.
_DWMSBT_NONE, // [Disable] Do not draw any system backdrop.
_DWMSBT_MAINWINDOW, // [Mica] Draw the backdrop material effect corresponding to a
// long-lived window.
_DWMSBT_TRANSIENTWINDOW, // [Acrylic] Draw the backdrop material effect corresponding to a
// transient window.
_DWMSBT_TABBEDWINDOW, // [Mica Alt] Draw the backdrop material effect corresponding to a
// window with a tabbed title bar.
};
enum WINDOWCOMPOSITIONATTRIB {
WCA_UNDEFINED = 0,
WCA_NCRENDERING_ENABLED = 1,
WCA_NCRENDERING_POLICY = 2,
WCA_TRANSITIONS_FORCEDISABLED = 3,
WCA_ALLOW_NCPAINT = 4,
WCA_CAPTION_BUTTON_BOUNDS = 5,
WCA_NONCLIENT_RTL_LAYOUT = 6,
WCA_FORCE_ICONIC_REPRESENTATION = 7,
WCA_EXTENDED_FRAME_BOUNDS = 8,
WCA_HAS_ICONIC_BITMAP = 9,
WCA_THEME_ATTRIBUTES = 10,
WCA_NCRENDERING_EXILED = 11,
WCA_NCADORNMENTINFO = 12,
WCA_EXCLUDED_FROM_LIVEPREVIEW = 13,
WCA_VIDEO_OVERLAY_ACTIVE = 14,
WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15,
WCA_DISALLOW_PEEK = 16,
WCA_CLOAK = 17,
WCA_CLOAKED = 18,
WCA_ACCENT_POLICY = 19,
WCA_FREEZE_REPRESENTATION = 20,
WCA_EVER_UNCLOAKED = 21,
WCA_VISUAL_OWNER = 22,
WCA_HOLOGRAPHIC = 23,
WCA_EXCLUDED_FROM_DDA = 24,
WCA_PASSIVEUPDATEMODE = 25,
WCA_USEDARKMODECOLORS = 26,
WCA_CORNER_STYLE = 27,
WCA_PART_COLOR = 28,
WCA_DISABLE_MOVESIZE_FEEDBACK = 29,
WCA_LAST = 30
};
enum ACCENT_STATE {
ACCENT_DISABLED = 0,
ACCENT_ENABLE_GRADIENT = 1,
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3, // Traditional DWM blur
ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, // RS4 1803
ACCENT_ENABLE_HOST_BACKDROP = 5, // RS5 1809
ACCENT_INVALID_STATE = 6 // Using this value will remove the window background
};
enum ACCENT_FLAG {
ACCENT_NONE = 0,
ACCENT_ENABLE_ACRYLIC = 1,
ACCENT_ENABLE_ACRYLIC_WITH_LUMINOSITY = 482
};
struct ACCENT_POLICY {
DWORD dwAccentState;
DWORD dwAccentFlags;
DWORD dwGradientColor; // #AABBGGRR
DWORD dwAnimationId;
};
using PACCENT_POLICY = ACCENT_POLICY *;
struct WINDOWCOMPOSITIONATTRIBDATA {
WINDOWCOMPOSITIONATTRIB Attrib;
PVOID pvData;
SIZE_T cbData;
};
using PWINDOWCOMPOSITIONATTRIBDATA = WINDOWCOMPOSITIONATTRIBDATA *;
typedef HRESULT(WINAPI *DwmSetWindowAttributeFunc)(HWND hwnd, DWORD dwAttribute,
LPCVOID pvAttribute, DWORD cbAttribute);
typedef HRESULT(WINAPI *DwmExtendFrameIntoClientAreaFunc)(HWND hwnd, const MARGINS *pMarInset);
typedef HRESULT(WINAPI *DwmIsCompositionEnabledFunc)(BOOL *pfEnabled);
typedef HRESULT(WINAPI *DwmEnableBlurBehindWindowFunc)(HWND hWnd,
const DWM_BLURBEHIND *pBlurBehind);
typedef BOOL(WINAPI *SetWindowCompositionAttributeFunc)(HWND hwnd,
const WINDOWCOMPOSITIONATTRIBDATA *);
typedef UINT(WINAPI *GetDpiForWindowFunc)(HWND hWnd);
typedef int(WINAPI *GetSystemMetricsForDpiFunc)(int nIndex, UINT dpi);
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
using QT_NATIVE_EVENT_RESULT_TYPE = qintptr; using QT_NATIVE_EVENT_RESULT_TYPE = qintptr;
using QT_ENTER_EVENT_TYPE = QEnterEvent; using QT_ENTER_EVENT_TYPE = QEnterEvent;
@ -119,11 +23,6 @@ class FluFrameless : public QQuickItem, QAbstractNativeEventFilter {
Q_PROPERTY_AUTO(bool, topmost) Q_PROPERTY_AUTO(bool, topmost)
Q_PROPERTY_AUTO(bool, disabled) Q_PROPERTY_AUTO(bool, disabled)
Q_PROPERTY_AUTO(bool, fixSize) Q_PROPERTY_AUTO(bool, fixSize)
Q_PROPERTY_AUTO(QString, effect)
Q_PROPERTY_READONLY_AUTO(bool, effective)
Q_PROPERTY_READONLY_AUTO(QStringList, availableEffects)
Q_PROPERTY_AUTO(bool, isDarkMode)
Q_PROPERTY_AUTO(bool, useSystemEffect)
QML_NAMED_ELEMENT(FluFrameless) QML_NAMED_ELEMENT(FluFrameless)
public: public:
explicit FluFrameless(QQuickItem *parent = nullptr); explicit FluFrameless(QQuickItem *parent = nullptr);
@ -169,7 +68,6 @@ private:
void _setMaximizeHovered(bool val); void _setMaximizeHovered(bool val);
private: private:
quint64 _current = 0; quint64 _current = 0;
int _edges = 0; int _edges = 0;
@ -177,5 +75,4 @@ private:
quint64 _clickTimer = 0; quint64 _clickTimer = 0;
bool _isWindows11OrGreater = false; bool _isWindows11OrGreater = false;
QList<QPointer<QQuickItem>> _hitTestList; QList<QPointer<QQuickItem>> _hitTestList;
QString _currentEffect;
}; };

View File

@ -282,22 +282,7 @@ QString FluTools::getWallpaperFilePath() {
auto path = result.mid(startIndex + 7, result.length() - startIndex - 8); auto path = result.mid(startIndex + 7, result.length() - startIndex - 8);
return path; 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) #elif defined(Q_OS_MACOS)
QProcess process; QProcess process;
QStringList args; QStringList args;

View File

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

View File

@ -23,14 +23,12 @@
#include "qmlcustomplot/ticker.h" #include "qmlcustomplot/ticker.h"
#include "qmlcustomplot/grid.h" #include "qmlcustomplot/grid.h"
const char* FluentUI::_uri = "FluentUI";
void FluentUI::registerTypes(QQmlEngine *engine) { void FluentUI::registerTypes(QQmlEngine *engine) {
initializeEngine(engine, _uri); initializeEngine(engine, _uri);
registerTypes(_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)) #if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0))
Q_INIT_RESOURCE(fluentui); Q_INIT_RESOURCE(fluentui);
int major = _major; int major = _major;
@ -164,41 +162,31 @@ void FluentUI::registerTypes(const char *uri) {
qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only");
qmlRegisterSingletonType<FluApp>(uri, major, minor, "FluApp", qmlRegisterSingletonType(uri, major, minor, "FluApp", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { Q_UNUSED(engine)
Q_UNUSED(scriptEngine) return scriptEngine->newQObject(FluApp::getInstance());
QObject *instance = FluApp::getInstance(); });
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership); qmlRegisterSingletonType(uri, major, minor, "FluColors", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
return instance; Q_UNUSED(engine)
}); return scriptEngine->newQObject(FluColors::getInstance());
qmlRegisterSingletonType<FluColors>(uri, major, minor, "FluColors", });
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { qmlRegisterSingletonType(uri, major, minor, "FluTheme", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(scriptEngine) Q_UNUSED(engine)
QObject *instance = FluColors::getInstance(); return scriptEngine->newQObject(FluTheme::getInstance());
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership); });
return instance; qmlRegisterSingletonType(uri, major, minor, "FluTools", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
}); Q_UNUSED(engine)
qmlRegisterSingletonType<FluTheme>(uri, major, minor, "FluTheme", return scriptEngine->newQObject(FluTools::getInstance());
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { });
Q_UNUSED(scriptEngine) qmlRegisterSingletonType(uri, major, minor, "FluTextStyle", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
QObject *instance = FluTheme::getInstance(); Q_UNUSED(engine)
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership); return scriptEngine->newQObject(FluTextStyle::getInstance());
return instance; });
}); // qmlRegisterSingletonInstance(uri, major, minor, "FluApp", FluApp::getInstance());
qmlRegisterSingletonType<FluTools>(uri, major, minor, "FluTools", // qmlRegisterSingletonInstance(uri, major, minor, "FluColors", FluColors::getInstance());
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { // qmlRegisterSingletonInstance(uri, major, minor, "FluTheme", FluTheme::getInstance());
Q_UNUSED(scriptEngine) // qmlRegisterSingletonInstance(uri, major, minor, "FluTools", FluTools::getInstance());
QObject *instance = FluTools::getInstance(); // qmlRegisterSingletonInstance(uri, major, minor, "FluTextStyle", FluTextStyle::getInstance());
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
return instance;
});
qmlRegisterSingletonType<FluTextStyle>(uri, major, minor, "FluTextStyle",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(scriptEngine)
QObject *instance = FluTextStyle::getInstance();
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
return instance;
});
qmlRegisterModule(uri, major, minor); qmlRegisterModule(uri, major, minor);
#endif #endif
} }

View File

@ -2,22 +2,25 @@
#include <QObject> #include <QObject>
#include <QQmlEngine> #include <QQmlEngine>
#include "singleton.h"
/** /**
* @brief The FluentUI class * @brief The FluentUI class
*/ */
class FluentUI{ class FluentUI : public QObject {
Q_OBJECT
public: 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: private:
static const int _major = 1; const int _major = 1;
static const int _minor = 0; const int _minor = 0;
static const char *_uri; const char *_uri = "FluentUI";
}; };

View File

@ -73,7 +73,7 @@ Rectangle{
text:{ text:{
if(count<100) if(count<100)
return count return count
return "100+" return count+"+"
} }
} }
} }

View File

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

View File

@ -15,9 +15,7 @@ Canvas {
function animateToNewData() function animateToNewData()
{ {
chartAnimationProgress = 0.1; chartAnimationProgress = 0.1;
if (d.jsChart) { d.jsChart.update();
d.jsChart.update();
}
chartAnimator.restart(); chartAnimator.restart();
} }
QtObject{ 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 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 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 real size: 18
property color textColor: { property alias textColor: btn_text.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 bool textRight: true property bool textRight: true
property real textSpacing: 6 property real textSpacing: 6
property bool animationEnabled: FluTheme.animationEnabled property bool animationEnabled: FluTheme.animationEnabled
@ -139,7 +127,6 @@ Button {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
visible: text !== "" visible: text !== ""
font: control.font font: control.font
color: control.textColor
} }
} }
} }

View File

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

@ -107,7 +107,7 @@ T.ComboBox {
y: control.height y: control.height
width: control.width width: control.width
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
topMargin: 32 topMargin: 6
bottomMargin: 6 bottomMargin: 6
modal: true modal: true
contentItem: ListView { contentItem: ListView {

View File

@ -41,7 +41,7 @@ FluPopup {
FluText{ FluText{
id:text_message id:text_message
font: FluTextStyle.Body font: FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text:message text:message
width: parent.width width: parent.width
topPadding: 4 topPadding: 4
@ -67,7 +67,7 @@ FluPopup {
topPadding: 20 topPadding: 20
leftPadding: 20 leftPadding: 20
rightPadding: 20 rightPadding: 20
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
} }
FluLoader{ FluLoader{
sourceComponent: com_message sourceComponent: com_message

View File

@ -3,19 +3,7 @@ import QtQuick.Controls 2.15
import FluentUI 1.0 import FluentUI 1.0
TextEdit { TextEdit {
property color textColor: { property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
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)
}
}
id:control id:control
color: textColor color: textColor
readOnly: true readOnly: true

View File

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

View File

@ -5,19 +5,7 @@ import FluentUI 1.0
Text { Text {
property int iconSource property int iconSource
property int iconSize: 20 property int iconSize: 20
property color iconColor: { property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
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)
}
}
id:control id:control
font.family: font_loader.name font.family: font_loader.name
font.pixelSize: iconSize font.pixelSize: iconSize

View File

@ -37,19 +37,7 @@ Button {
return Qt.rgba(0,0,0,1) return Qt.rgba(0,0,0,1)
} }
} }
property color textColor: { property color textColor: FluTheme.fontPrimaryColor
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)
}
}
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: control.text Accessible.name: control.text
Accessible.description: contentDescription Accessible.description: contentDescription

View File

@ -190,13 +190,13 @@ FluObject {
spacing: 5 spacing: 5
FluText{ FluText{
text:_super.text text:_super.text
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }
FluText{ FluText{
text: _super.moremsg text: _super.moremsg
visible: _super.moremsg visible: _super.moremsg
wrapMode : Text.WordWrap wrapMode : Text.WrapAnywhere
textColor: FluColors.Grey120 textColor: FluColors.Grey120
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }

View File

@ -20,7 +20,7 @@ TextArea{
return normalColor return normalColor
} }
font:FluTextStyle.Body font:FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 8 padding: 8
leftPadding: padding+4 leftPadding: padding+4
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering

View File

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

View File

@ -5,9 +5,8 @@ import FluentUI 1.0
Page { Page {
default property alias content: d.children default property alias content: d.children
property alias currentIndex: nav_list.currentIndex 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 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 textSpacing: 10
property int headerSpacing: 20 property int headerSpacing: 20
property int headerHeight: 40 property int headerHeight: 40
@ -31,15 +30,21 @@ Page {
interactive: false interactive: false
orientation: ListView.Horizontal orientation: ListView.Horizontal
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0 highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
highlight: Item{ highlight: Item{
clip: true clip: true
Rectangle{ Rectangle{
height: 3 height: 3
radius: 1.5 radius: 1.5
color: FluTheme.primaryColor color: FluTheme.primaryColor
width: nav_list.currentItem.width width: nav_list.currentItem ? nav_list.currentItem.width : 0
y:d.tabY y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
} }
} }
delegate: Button{ delegate: Button{
@ -61,13 +66,9 @@ Page {
anchors.centerIn: parent anchors.centerIn: parent
font: control.font font: control.font
color: { color: {
if(nav_list.currentIndex === index) { if(item_button.hovered)
return textHighlightColor; return textHoverColor
} return textNormalColor
if (item_button.hovered) {
return textHoverColor;
}
return textNormalColor;
} }
} }
} }

View File

@ -14,6 +14,13 @@ ProgressBar{
id:d id:d
property real _radius: strokeWidth/2 property real _radius: strokeWidth/2
} }
onIndeterminateChanged:{
if(!indeterminate){
animator_x.duration = 0
rect_progress.x = 0
animator_x.duration = control.duration
}
}
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
implicitHeight: control.strokeWidth implicitHeight: control.strokeWidth
@ -34,20 +41,13 @@ ProgressBar{
height: parent.height height: parent.height
radius: d._radius radius: d._radius
color: control.color color: control.color
SequentialAnimation on x { PropertyAnimation on x {
id: animator_x id:animator_x
running: control.indeterminate && control.visible running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite loops: Animation.Infinite
onRunningChanged: { duration: control.duration
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
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 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 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 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: { property alias textColor: btn_text.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 real size: 18 property real size: 18
property bool textRight: true property bool textRight: true
property real textSpacing: 6 property real textSpacing: 6
@ -106,7 +94,6 @@ Button {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
visible: text !== "" visible: text !== ""
font: control.font font: control.font
color: control.textColor
} }
} }
} }

View File

@ -5,11 +5,8 @@ import QtQuick.Controls 2.15
import FluentUI 1.0 import FluentUI 1.0
FluPage { FluPage {
property bool autoResetScroll: false
default property alias content: container.data default property alias content: container.data
Flickable{ Flickable{
id: flickable
clip: true clip: true
anchors.fill: parent anchors.fill: parent
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
@ -20,14 +17,4 @@ FluPage {
width: parent.width width: parent.width
} }
} }
function resetScroll() {
flickable.contentY = 0;
}
StackView.onActivated: {
if (autoResetScroll) {
resetScroll(); // Call this function to reset the scroll position to the top
}
}
} }

View File

@ -5,7 +5,7 @@ import FluentUI 1.0
Text { Text {
property color textColor: FluTheme.fontPrimaryColor property color textColor: FluTheme.fontPrimaryColor
id:text 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 renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
font: FluTextStyle.Body font: FluTextStyle.Body
} }

View File

@ -335,7 +335,7 @@ FluButton {
if (hours === "12") { if (hours === "12") {
hours24 = (period === control.amText) ? 0 : 12; hours24 = (period === control.amText) ? 0 : 12;
} else { } else {
hours24 = (period === control.pmText) ? hours24 + 12 : hours24; hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
} }
} }
date.setHours(hours24); date.setHours(hours24);

View File

@ -98,7 +98,7 @@ Item{
Component{ Component{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: { text: {
if(modelData.lable){ if(modelData.lable){
@ -113,7 +113,7 @@ Item{
Component{ Component{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
textFormat: Text.RichText textFormat: Text.RichText

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 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 real textSpacing: 6
property bool textRight: true property bool textRight: true
property color textColor: { property alias textColor: btn_text.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 var clickListener : function(){ property var clickListener : function(){
checked = !checked checked = !checked
} }
@ -127,7 +115,6 @@ Button {
text: control.text text: control.text
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
visible: text !== "" visible: text !== ""
color: control.textColor
} }
} }
} }

View File

@ -175,7 +175,7 @@ Popup{
FluText{ FluText{
id: text_desc id: text_desc
font: FluTextStyle.Body font: FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
maximumLineCount: 4 maximumLineCount: 4
elide: Text.ElideRight elide: Text.ElideRight
text: { text: {

View File

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

View File

@ -13,11 +13,6 @@ Window {
property bool fixSize: false property bool fixSize: false
property Component loadingItem: com_loading property Component loadingItem: com_loading
property bool fitsAppBarWindows: false property bool fitsAppBarWindows: false
property var tintOpacity: FluTheme.dark ? 0.80 : 0.75
property int blurRadius: 60
property alias effect: frameless.effect
readonly property alias effective: frameless.effective
readonly property alias availableEffects: frameless.availableEffects
property Item appBar: FluAppBar { property Item appBar: FluAppBar {
title: window.title title: window.title
height: 30 height: 30
@ -29,15 +24,6 @@ Window {
icon: window.windowIcon icon: window.windowIcon
} }
property color backgroundColor: { property color backgroundColor: {
if(frameless.effective && active){
var backcolor
if(frameless.effect==="dwm-blur"){
backcolor = FluTools.withOpacity(FluTheme.windowActiveBackgroundColor, window.tintOpacity)
}else{
backcolor = "transparent"
}
return backcolor
}
if(active){ if(active){
return FluTheme.windowActiveBackgroundColor return FluTheme.windowActiveBackgroundColor
} }
@ -114,8 +100,6 @@ Window {
fixSize: window.fixSize fixSize: window.fixSize
topmost: window.stayTop topmost: window.stayTop
disabled: FluApp.useSystemAppBar disabled: FluApp.useSystemAppBar
isDarkMode: FluTheme.dark
useSystemEffect: !FluTheme.blurBehindWindowEnabled
Component.onCompleted: { Component.onCompleted: {
frameless.setHitTestVisible(appBar.layoutMacosButtons) frameless.setHitTestVisible(appBar.layoutMacosButtons)
frameless.setHitTestVisible(appBar.layoutStandardbuttons) frameless.setHitTestVisible(appBar.layoutStandardbuttons)
@ -123,11 +107,6 @@ Window {
Component.onDestruction: { Component.onDestruction: {
frameless.onDestruction() frameless.onDestruction()
} }
onEffectiveChanged: {
if(effective){
FluTheme.blurBehindWindowEnabled = false
}
}
} }
Component{ Component{
id:com_background id:com_background
@ -183,8 +162,8 @@ Window {
FluAcrylic{ FluAcrylic{
anchors.fill: parent anchors.fill: parent
target: img_back target: img_back
tintOpacity: window.tintOpacity tintOpacity: FluTheme.dark ? 0.80 : 0.75
blurRadius: window.blurRadius blurRadius: 64
visible: window.active && FluTheme.blurBehindWindowEnabled visible: window.active && FluTheme.blurBehindWindowEnabled
tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1) tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
targetRect: Qt.rect(window.x-window.screen.virtualX,window.y-window.screen.virtualY,window.width,window.height) targetRect: Qt.rect(window.x-window.screen.virtualX,window.y-window.screen.virtualY,window.width,window.height)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 266 KiB

View File

@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only. // It is used for QML tooling purposes only.
// //
// This file was auto-generated by: // This file was auto-generated by:
// 'qmlplugindump -nonrelocatable -noinstantiate FluentUI 1.0 E:/develop/QtCode/opensource/FluentUI/build/Desktop_Qt_5_15_2_MinGW_64_bit-Release/src' // 'qmlplugindump -nonrelocatable FluentUI 1.0 D:/QtProjects/build-FluentUI-Desktop_Qt_5_15_2_MSVC2019_64bit-Release/src'
Module { Module {
dependencies: ["QtQuick 2.0"] dependencies: ["QtQuick 2.0"]
@ -150,11 +150,6 @@ Module {
Property { name: "topmost"; type: "bool" } Property { name: "topmost"; type: "bool" }
Property { name: "disabled"; type: "bool" } Property { name: "disabled"; type: "bool" }
Property { name: "fixSize"; type: "bool" } Property { name: "fixSize"; type: "bool" }
Property { name: "effect"; type: "string" }
Property { name: "effective"; type: "bool"; isReadonly: true }
Property { name: "availableEffects"; type: "QStringList"; isReadonly: true }
Property { name: "isDarkMode"; type: "bool" }
Property { name: "useSystemEffect"; type: "bool" }
Method { name: "showFullScreen" } Method { name: "showFullScreen" }
Method { name: "showMaximized" } Method { name: "showMaximized" }
Method { name: "showMinimized" } Method { name: "showMinimized" }
@ -674,12 +669,12 @@ Module {
} }
} }
Component { Component {
name: "FluentIcons" name: "Fluent_Icons"
exports: ["FluentUI/FluentIcons 1.0"] exports: ["FluentUI/FluentIcons 1.0"]
isCreatable: false isCreatable: false
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Enum { Enum {
name: "Type" name: "Fluent_IconType"
values: { values: {
"GlobalNavButton": 59136, "GlobalNavButton": 59136,
"Wifi": 59137, "Wifi": 59137,
@ -2454,240 +2449,6 @@ Module {
Method { name: "clear" } Method { name: "clear" }
Method { name: "invalidate" } Method { name: "invalidate" }
} }
Component {
name: "QmlQCustomPlot::Axis"
prototype: "QObject"
exports: ["FluentUI/Axis 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "TickerType"
values: {
"Fixed": 0,
"Log": 1,
"Pi": 2,
"Text": 3,
"DateTime": 4,
"Time": 5
}
}
Property { name: "visible"; type: "bool" }
Property { name: "label"; type: "string" }
Property { name: "upper"; type: "float" }
Property { name: "lower"; type: "float" }
Property { name: "grid"; type: "QmlQCustomPlot::Grid"; isReadonly: true; isPointer: true }
Property { name: "ticker"; type: "QmlQCustomPlot::Ticker"; isReadonly: true; isPointer: true }
Signal {
name: "visibleChanged"
Parameter { type: "bool" }
}
Signal {
name: "labelChanged"
Parameter { type: "string" }
}
Signal {
name: "upperChanged"
Parameter { type: "float" }
}
Signal {
name: "lowerChanged"
Parameter { type: "float" }
}
Signal {
name: "gridChanged"
Parameter { type: "QmlQCustomPlot::Grid"; isPointer: true }
}
Signal {
name: "tickerChanged"
Parameter { type: "QmlQCustomPlot::Ticker"; isPointer: true }
}
Method {
name: "setTickerType"
Parameter { name: "type"; type: "TickerType" }
}
Method {
name: "setRange"
Parameter { name: "position"; type: "float" }
Parameter { name: "size"; type: "float" }
Parameter { name: "align"; type: "Qt::AlignmentFlag" }
}
Method {
name: "setRange"
Parameter { name: "lower"; type: "float" }
Parameter { name: "upper"; type: "float" }
}
}
Component {
name: "QmlQCustomPlot::BasePlot"
defaultProperty: "data"
prototype: "QQuickPaintedItem"
exports: ["FluentUI/BasePlot 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "backgroundColor"; type: "QColor" }
Property { name: "xAxis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "x1Axis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "yAxis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "y1Axis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "graphs"; type: "QVariantMap"; isReadonly: true }
Signal {
name: "backgroundColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "xAxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Signal {
name: "x1AxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Signal {
name: "yAxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Signal {
name: "y1AxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Method {
name: "addGraph"
Parameter { name: "key"; type: "string" }
}
Method {
name: "removeGraph"
Parameter { name: "key"; type: "string" }
}
Method {
name: "rescaleAxes"
Parameter { name: "onlyVisiblePlottables"; type: "bool" }
}
Method { name: "rescaleAxes" }
}
Component {
name: "QmlQCustomPlot::Grid"
prototype: "QObject"
exports: ["FluentUI/PlotGrid 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "LineType"
values: {
"NoPen": 0,
"SolidLine": 1,
"DashLine": 2,
"DotLine": 3,
"DashDotLine": 4,
"DashDotDotLine": 5
}
}
Property { name: "visible"; type: "bool" }
Property { name: "subVisible"; type: "bool" }
Property { name: "lineWidth"; type: "int" }
Property { name: "lineColor"; type: "QColor" }
Property { name: "lineType"; type: "LineType" }
Property { name: "subLineWidth"; type: "int" }
Property { name: "subLineColor"; type: "QColor" }
Property { name: "subLineType"; type: "LineType" }
Signal {
name: "visibleChanged"
Parameter { type: "bool" }
}
Signal {
name: "subVisibleChanged"
Parameter { type: "bool" }
}
Signal {
name: "lineWidthChanged"
Parameter { type: "int" }
}
Signal {
name: "lineColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "lineTypeChanged"
Parameter { type: "LineType" }
}
Signal {
name: "subLineWidthChanged"
Parameter { type: "int" }
}
Signal {
name: "subLineColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "subLineTypeChanged"
Parameter { type: "LineType" }
}
}
Component {
name: "QmlQCustomPlot::Ticker"
prototype: "QObject"
exports: ["FluentUI/Ticker 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "ticks"; type: "bool" }
Property { name: "subTicks"; type: "bool" }
Property { name: "tickCount"; type: "int" }
Property { name: "baseWidth"; type: "int" }
Property { name: "baseColor"; type: "QColor" }
Property { name: "tickColor"; type: "QColor" }
Property { name: "subTickColor"; type: "QColor" }
Signal {
name: "ticksChanged"
Parameter { type: "bool" }
}
Signal {
name: "subTicksChanged"
Parameter { type: "bool" }
}
Signal {
name: "tickCountChanged"
Parameter { type: "int" }
}
Signal {
name: "baseWidthChanged"
Parameter { type: "int" }
}
Signal {
name: "baseColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "tickColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "subTickColorChanged"
Parameter { type: "QColor" }
}
}
Component {
name: "QmlQCustomPlot::TimePlot"
defaultProperty: "data"
prototype: "QmlQCustomPlot::BasePlot"
exports: ["FluentUI/TimePlot 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "plotTimeRangeInMilliseconds"; type: "int" }
Signal {
name: "plotTimeRangeInMillisecondsChanged"
Parameter { type: "int" }
}
Method {
name: "setTimeFormat"
Parameter { name: "format"; type: "string" }
}
Method {
name: "addCurrentTimeValue"
Parameter { name: "name"; type: "string" }
Parameter { name: "value"; type: "double" }
}
Method {
name: "addCurrentTimeValues"
Parameter { name: "values"; type: "QVariantMap" }
}
}
Component { Component {
prototype: "QQuickItem" prototype: "QQuickItem"
name: "FluentUI/FluAcrylic 1.0" name: "FluentUI/FluAcrylic 1.0"
@ -2746,37 +2507,37 @@ Module {
Property { name: "darkClickListener"; type: "QVariant" } Property { name: "darkClickListener"; type: "QVariant" }
Property { Property {
name: "buttonStayTop" name: "buttonStayTop"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonMinimize" name: "buttonMinimize"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonMaximize" name: "buttonMaximize"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonClose" name: "buttonClose"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonDark" name: "buttonDark"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "layoutMacosButtons" name: "layoutMacosButtons"
type: "FluLoader_QMLTYPE_14" type: "FluLoader_QMLTYPE_16"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
@ -2898,7 +2659,6 @@ Module {
isComposite: true isComposite: true
defaultProperty: "data" defaultProperty: "data"
Property { name: "autoPlay"; type: "bool" } Property { name: "autoPlay"; type: "bool" }
Property { name: "orientation"; type: "int" }
Property { name: "loopTime"; type: "int" } Property { name: "loopTime"; type: "int" }
Property { name: "model"; type: "QVariant" } Property { name: "model"; type: "QVariant" }
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
@ -2956,12 +2716,12 @@ Module {
Property { name: "checkedDisableColor"; type: "QColor" } Property { name: "checkedDisableColor"; type: "QColor" }
Property { name: "disableColor"; type: "QColor" } Property { name: "disableColor"; type: "QColor" }
Property { name: "size"; type: "double" } Property { name: "size"; type: "double" }
Property { name: "textColor"; type: "QColor" }
Property { name: "textRight"; type: "bool" } Property { name: "textRight"; type: "bool" }
Property { name: "textSpacing"; type: "double" } Property { name: "textSpacing"; type: "double" }
Property { name: "animationEnabled"; type: "bool" } Property { name: "animationEnabled"; type: "bool" }
Property { name: "clickListener"; type: "QVariant" } Property { name: "clickListener"; type: "QVariant" }
Property { name: "indeterminate"; type: "bool" } Property { name: "indeterminate"; type: "bool" }
Property { name: "textColor"; type: "QColor" }
} }
Component { Component {
prototype: "FluRectangle" prototype: "FluRectangle"
@ -3190,8 +2950,6 @@ Module {
isComposite: true isComposite: true
defaultProperty: "content" defaultProperty: "content"
Property { name: "headerText"; type: "string" } Property { name: "headerText"; type: "string" }
Property { name: "headerHeight"; type: "int" }
Property { name: "headerDelegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "expand"; type: "bool" } Property { name: "expand"; type: "bool" }
Property { name: "contentHeight"; type: "int" } Property { name: "contentHeight"; type: "int" }
Property { name: "content"; type: "QObject"; isList: true; isReadonly: true } Property { name: "content"; type: "QObject"; isList: true; isReadonly: true }
@ -3472,15 +3230,15 @@ Module {
defaultProperty: "data" defaultProperty: "data"
Property { name: "logo"; type: "QUrl" } Property { name: "logo"; type: "QUrl" }
Property { name: "title"; type: "string" } Property { name: "title"; type: "string" }
Property { name: "items"; type: "FluObject_QMLTYPE_182"; isPointer: true } Property { name: "items"; type: "FluObject_QMLTYPE_164"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_182"; isPointer: true } Property { name: "footerItems"; type: "FluObject_QMLTYPE_164"; isPointer: true }
Property { name: "displayMode"; type: "int" } Property { name: "displayMode"; type: "int" }
Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true } Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true }
Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true } Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "topPadding"; type: "int" } Property { name: "topPadding"; type: "int" }
Property { name: "pageMode"; type: "int" } Property { name: "pageMode"; type: "int" }
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_47"; isPointer: true } Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_47"; isPointer: true } Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
Property { name: "navCompactWidth"; type: "int" } Property { name: "navCompactWidth"; type: "int" }
Property { name: "navTopMargin"; type: "int" } Property { name: "navTopMargin"; type: "int" }
Property { name: "cellHeight"; type: "int" } Property { name: "cellHeight"; type: "int" }
@ -3488,13 +3246,13 @@ Module {
Property { name: "hideNavAppBar"; type: "bool" } Property { name: "hideNavAppBar"; type: "bool" }
Property { Property {
name: "buttonMenu" name: "buttonMenu"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
Property { Property {
name: "buttonBack" name: "buttonBack"
type: "FluIconButton_QMLTYPE_19" type: "FluIconButton_QMLTYPE_18"
isReadonly: true isReadonly: true
isPointer: true isPointer: true
} }
@ -3679,7 +3437,6 @@ Module {
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
isComposite: true isComposite: true
defaultProperty: "content" defaultProperty: "content"
Property { name: "textHighlightColor"; type: "QColor" }
Property { name: "textNormalColor"; type: "QColor" } Property { name: "textNormalColor"; type: "QColor" }
Property { name: "textHoverColor"; type: "QColor" } Property { name: "textHoverColor"; type: "QColor" }
Property { name: "textSpacing"; type: "int" } Property { name: "textSpacing"; type: "int" }
@ -3776,11 +3533,11 @@ Module {
Property { name: "normalColor"; type: "QColor" } Property { name: "normalColor"; type: "QColor" }
Property { name: "hoverColor"; type: "QColor" } Property { name: "hoverColor"; type: "QColor" }
Property { name: "disableColor"; type: "QColor" } Property { name: "disableColor"; type: "QColor" }
Property { name: "textColor"; type: "QColor" }
Property { name: "size"; type: "double" } Property { name: "size"; type: "double" }
Property { name: "textRight"; type: "bool" } Property { name: "textRight"; type: "bool" }
Property { name: "textSpacing"; type: "double" } Property { name: "textSpacing"; type: "double" }
Property { name: "clickListener"; type: "QVariant" } Property { name: "clickListener"; type: "QVariant" }
Property { name: "textColor"; type: "QColor" }
} }
Component { Component {
prototype: "QQuickItem" prototype: "QQuickItem"
@ -3863,7 +3620,7 @@ Module {
Method { Method {
name: "removeWindow" name: "removeWindow"
type: "QVariant" type: "QVariant"
Parameter { name: "win"; type: "QVariant" } Parameter { name: "window"; type: "QVariant" }
} }
Method { Method {
name: "exit" name: "exit"
@ -3903,9 +3660,7 @@ Module {
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
isComposite: true isComposite: true
defaultProperty: "content" defaultProperty: "content"
Property { name: "autoResetScroll"; type: "bool" }
Property { name: "content"; type: "QObject"; isList: true; isReadonly: true } Property { name: "content"; type: "QObject"; isList: true; isReadonly: true }
Method { name: "resetScroll"; type: "QVariant" }
Property { name: "launchMode"; type: "int" } Property { name: "launchMode"; type: "int" }
Property { name: "animationEnabled"; type: "bool" } Property { name: "animationEnabled"; type: "bool" }
Property { name: "url"; type: "string" } Property { name: "url"; type: "string" }
@ -4300,8 +4055,8 @@ Module {
Property { name: "dotDisableColor"; type: "QColor" } Property { name: "dotDisableColor"; type: "QColor" }
Property { name: "textSpacing"; type: "double" } Property { name: "textSpacing"; type: "double" }
Property { name: "textRight"; type: "bool" } Property { name: "textRight"; type: "bool" }
Property { name: "textColor"; type: "QColor" }
Property { name: "clickListener"; type: "QVariant" } Property { name: "clickListener"; type: "QVariant" }
Property { name: "textColor"; type: "QColor" }
} }
Component { Component {
prototype: "QQuickToolTip" prototype: "QQuickToolTip"
@ -4383,8 +4138,6 @@ Module {
Property { name: "fixSize"; type: "bool" } Property { name: "fixSize"; type: "bool" }
Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true } Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "fitsAppBarWindows"; type: "bool" } Property { name: "fitsAppBarWindows"; type: "bool" }
Property { name: "tintOpacity"; type: "QVariant" }
Property { name: "blurRadius"; type: "int" }
Property { name: "appBar"; type: "QQuickItem"; isPointer: true } Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
Property { name: "backgroundColor"; type: "QColor" } Property { name: "backgroundColor"; type: "QColor" }
Property { name: "stayTop"; type: "bool" } Property { name: "stayTop"; type: "bool" }
@ -4398,7 +4151,6 @@ Module {
Property { name: "autoCenter"; type: "bool" } Property { name: "autoCenter"; type: "bool" }
Property { name: "autoDestroy"; type: "bool" } Property { name: "autoDestroy"; type: "bool" }
Property { name: "useSystemAppBar"; type: "bool" } Property { name: "useSystemAppBar"; type: "bool" }
Property { name: "__margins"; type: "int" }
Property { name: "resizeBorderColor"; type: "QColor" } Property { name: "resizeBorderColor"; type: "QColor" }
Property { name: "resizeBorderWidth"; type: "int" } Property { name: "resizeBorderWidth"; type: "int" }
Property { name: "closeListener"; type: "QVariant" } Property { name: "closeListener"; type: "QVariant" }
@ -4406,9 +4158,6 @@ Module {
Property { name: "_route"; type: "string" } Property { name: "_route"; type: "string" }
Property { name: "_hideShadow"; type: "bool" } Property { name: "_hideShadow"; type: "bool" }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } 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 { Signal {
name: "initArgument" name: "initArgument"
Parameter { name: "argument"; type: "QVariant" } Parameter { name: "argument"; type: "QVariant" }
@ -4446,6 +4195,11 @@ Module {
Method { name: "clearAllInfo"; type: "QVariant" } Method { name: "clearAllInfo"; type: "QVariant" }
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" } Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
Method { name: "fixWindowSize"; type: "QVariant" } Method { name: "fixWindowSize"; type: "QVariant" }
Method {
name: "registerForWindowResult"
type: "QVariant"
Parameter { name: "path"; type: "QVariant" }
}
Method { Method {
name: "setResult" name: "setResult"
type: "QVariant" type: "QVariant"
@ -4465,8 +4219,6 @@ Module {
type: "QVariant" type: "QVariant"
Parameter { name: "val"; type: "QVariant" } Parameter { name: "val"; type: "QVariant" }
} }
Method { name: "deleteLater"; type: "QVariant" }
Method { name: "containerItem"; type: "QVariant" }
} }
Component { Component {
prototype: "QQuickWindowQmlImpl" prototype: "QQuickWindowQmlImpl"
@ -4489,8 +4241,6 @@ Module {
Property { name: "fixSize"; type: "bool" } Property { name: "fixSize"; type: "bool" }
Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true } Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "fitsAppBarWindows"; type: "bool" } Property { name: "fitsAppBarWindows"; type: "bool" }
Property { name: "tintOpacity"; type: "QVariant" }
Property { name: "blurRadius"; type: "int" }
Property { name: "appBar"; type: "QQuickItem"; isPointer: true } Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
Property { name: "backgroundColor"; type: "QColor" } Property { name: "backgroundColor"; type: "QColor" }
Property { name: "stayTop"; type: "bool" } Property { name: "stayTop"; type: "bool" }
@ -4504,7 +4254,6 @@ Module {
Property { name: "autoCenter"; type: "bool" } Property { name: "autoCenter"; type: "bool" }
Property { name: "autoDestroy"; type: "bool" } Property { name: "autoDestroy"; type: "bool" }
Property { name: "useSystemAppBar"; type: "bool" } Property { name: "useSystemAppBar"; type: "bool" }
Property { name: "__margins"; type: "int" }
Property { name: "resizeBorderColor"; type: "QColor" } Property { name: "resizeBorderColor"; type: "QColor" }
Property { name: "resizeBorderWidth"; type: "int" } Property { name: "resizeBorderWidth"; type: "int" }
Property { name: "closeListener"; type: "QVariant" } Property { name: "closeListener"; type: "QVariant" }
@ -4512,9 +4261,6 @@ Module {
Property { name: "_route"; type: "string" } Property { name: "_route"; type: "string" }
Property { name: "_hideShadow"; type: "bool" } Property { name: "_hideShadow"; type: "bool" }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } 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 { Signal {
name: "initArgument" name: "initArgument"
Parameter { name: "argument"; type: "QVariant" } Parameter { name: "argument"; type: "QVariant" }
@ -4552,6 +4298,11 @@ Module {
Method { name: "clearAllInfo"; type: "QVariant" } Method { name: "clearAllInfo"; type: "QVariant" }
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" } Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
Method { name: "fixWindowSize"; type: "QVariant" } Method { name: "fixWindowSize"; type: "QVariant" }
Method {
name: "registerForWindowResult"
type: "QVariant"
Parameter { name: "path"; type: "QVariant" }
}
Method { Method {
name: "setResult" name: "setResult"
type: "QVariant" type: "QVariant"
@ -4571,8 +4322,6 @@ Module {
type: "QVariant" type: "QVariant"
Parameter { name: "val"; type: "QVariant" } Parameter { name: "val"; type: "QVariant" }
} }
Method { name: "deleteLater"; type: "QVariant" }
Method { name: "containerItem"; type: "QVariant" }
} }
Component { Component {
prototype: "QQuickItem" prototype: "QQuickItem"

View File

@ -73,7 +73,7 @@ Rectangle{
text:{ text:{
if(count<100) if(count<100)
return count return count
return "100+" return count+"+"
} }
} }
} }

View File

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

View File

@ -14,9 +14,7 @@ Canvas {
function animateToNewData() function animateToNewData()
{ {
chartAnimationProgress = 0.1; chartAnimationProgress = 0.1;
if (d.jsChart) { d.jsChart.update();
d.jsChart.update();
}
chartAnimator.restart(); chartAnimator.restart();
} }
QtObject{ 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 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 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 real size: 18
property color textColor: { property alias textColor: btn_text.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 bool textRight: true property bool textRight: true
property real textSpacing: 6 property real textSpacing: 6
property bool animationEnabled: FluTheme.animationEnabled property bool animationEnabled: FluTheme.animationEnabled
@ -141,7 +129,6 @@ Button {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
visible: text !== "" visible: text !== ""
font: control.font font: control.font
color: control.textColor
} }
} }
} }

View File

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

@ -107,7 +107,7 @@ T.ComboBox {
y: control.height y: control.height
width: control.width width: control.width
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
topMargin: 32 topMargin: 6
bottomMargin: 6 bottomMargin: 6
modal: true modal: true
contentItem: ListView { contentItem: ListView {

View File

@ -41,7 +41,7 @@ FluPopup {
FluText{ FluText{
id:text_message id:text_message
font: FluTextStyle.Body font: FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text:message text:message
width: parent.width width: parent.width
topPadding: 4 topPadding: 4
@ -67,7 +67,7 @@ FluPopup {
topPadding: 20 topPadding: 20
leftPadding: 20 leftPadding: 20
rightPadding: 20 rightPadding: 20
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
} }
FluLoader{ FluLoader{
sourceComponent: com_message sourceComponent: com_message

View File

@ -3,19 +3,7 @@ import QtQuick.Controls
import FluentUI import FluentUI
TextEdit { TextEdit {
property color textColor: { property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
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)
}
}
id:control id:control
color: textColor color: textColor
readOnly: true readOnly: true

View File

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

View File

@ -5,19 +5,7 @@ import FluentUI
Text { Text {
property int iconSource property int iconSource
property int iconSize: 20 property int iconSize: 20
property color iconColor: { property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
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)
}
}
id:control id:control
font.family: font_loader.name font.family: font_loader.name
font.pixelSize: iconSize font.pixelSize: iconSize

View File

@ -38,19 +38,7 @@ Button {
return Qt.rgba(0,0,0,1) return Qt.rgba(0,0,0,1)
} }
} }
property color textColor: { property color textColor: FluTheme.fontPrimaryColor
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)
}
}
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: control.text Accessible.name: control.text
Accessible.description: contentDescription Accessible.description: contentDescription

View File

@ -190,13 +190,13 @@ FluObject {
spacing: 5 spacing: 5
FluText{ FluText{
text:_super.text text:_super.text
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }
FluText{ FluText{
text: _super.moremsg text: _super.moremsg
visible: _super.moremsg visible: _super.moremsg
wrapMode : Text.WordWrap wrapMode : Text.WrapAnywhere
textColor: FluColors.Grey120 textColor: FluColors.Grey120
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }

View File

@ -21,7 +21,7 @@ TextArea{
return normalColor return normalColor
} }
font:FluTextStyle.Body font:FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 8 padding: 8
leftPadding: padding+4 leftPadding: padding+4
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering

View File

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

View File

@ -6,9 +6,8 @@ import FluentUI
Page { Page {
default property alias content: d.children default property alias content: d.children
property alias currentIndex: nav_list.currentIndex 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 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 textSpacing: 10
property int headerSpacing: 20 property int headerSpacing: 20
property int headerHeight: 40 property int headerHeight: 40
@ -32,15 +31,21 @@ Page {
interactive: false interactive: false
orientation: ListView.Horizontal orientation: ListView.Horizontal
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0 highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
highlight: Item{ highlight: Item{
clip: true clip: true
Rectangle{ Rectangle{
height: 3 height: 3
radius: 1.5 radius: 1.5
color: FluTheme.primaryColor color: FluTheme.primaryColor
width: nav_list.currentItem.width width: nav_list.currentItem ? nav_list.currentItem.width : 0
y:d.tabY y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
} }
} }
delegate: Button{ delegate: Button{
@ -62,13 +67,9 @@ Page {
anchors.centerIn: parent anchors.centerIn: parent
font: control.font font: control.font
color: { color: {
if(nav_list.currentIndex === index) { if(item_button.hovered)
return textHighlightColor; return textHoverColor
} return textNormalColor
if (item_button.hovered) {
return textHoverColor;
}
return textNormalColor;
} }
} }
} }

View File

@ -15,6 +15,13 @@ ProgressBar{
id:d id:d
property real _radius: strokeWidth/2 property real _radius: strokeWidth/2
} }
onIndeterminateChanged:{
if(!indeterminate){
animator_x.duration = 0
rect_progress.x = 0
animator_x.duration = control.duration
}
}
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
implicitHeight: control.strokeWidth implicitHeight: control.strokeWidth
@ -35,20 +42,13 @@ ProgressBar{
height: parent.height height: parent.height
radius: d._radius radius: d._radius
color: control.color color: control.color
SequentialAnimation on x { PropertyAnimation on x {
id: animator_x id:animator_x
running: control.indeterminate && control.visible running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite loops: Animation.Infinite
onRunningChanged: { duration: control.duration
if(!running){
rect_progress.x = 0
}
}
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
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 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 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 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: { property alias textColor: btn_text.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 real size: 18 property real size: 18
property bool textRight: true property bool textRight: true
property real textSpacing: 6 property real textSpacing: 6
@ -102,7 +90,6 @@ Button {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
font: control.font font: control.font
visible: text !== "" visible: text !== ""
color: control.textColor
} }
} }
} }

View File

@ -5,11 +5,8 @@ import QtQuick.Controls
import FluentUI import FluentUI
FluPage { FluPage {
property bool autoResetScroll: false
default property alias content: container.data default property alias content: container.data
Flickable{ Flickable{
id: flickable
clip: true clip: true
anchors.fill: parent anchors.fill: parent
ScrollBar.vertical: FluScrollBar {} ScrollBar.vertical: FluScrollBar {}
@ -20,14 +17,4 @@ FluPage {
width: parent.width width: parent.width
} }
} }
function resetScroll() {
flickable.contentY = 0;
}
StackView.onActivated: {
if (autoResetScroll) {
resetScroll(); // Call this function to reset the scroll position to the top
}
}
} }

View File

@ -5,7 +5,7 @@ import FluentUI
Text { Text {
property color textColor: FluTheme.fontPrimaryColor property color textColor: FluTheme.fontPrimaryColor
id:text 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 renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
font: FluTextStyle.Body font: FluTextStyle.Body
} }

View File

@ -335,7 +335,7 @@ FluButton {
if (hours === "12") { if (hours === "12") {
hours24 = (period === control.amText) ? 0 : 12; hours24 = (period === control.amText) ? 0 : 12;
} else { } else {
hours24 = (period === control.pmText) ? hours24 + 12 : hours24; hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
} }
} }
date.setHours(hours24); date.setHours(hours24);

View File

@ -98,7 +98,7 @@ Item{
Component{ Component{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: { text: {
if(modelData.lable){ if(modelData.lable){
@ -113,7 +113,7 @@ Item{
Component{ Component{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
textFormat: Text.RichText textFormat: Text.RichText

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