Compare commits
85 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b4a1eaa860 | ||
|
ef1f70683a | ||
|
8377fb5227 | ||
|
9ac58a8ca7 | ||
|
ee87a718ed | ||
|
80dd3ebd35 | ||
|
1990203f3b | ||
|
df7cd94eec | ||
|
2cc17e9db3 | ||
|
aa8fcb304f | ||
|
882cc8989f | ||
|
444cc1aeee | ||
|
db0588edcd | ||
|
99f6b16aa1 | ||
|
65b7737454 | ||
|
7a6efa41fb | ||
|
113810879d | ||
|
09e0430293 | ||
|
29686d07ba | ||
|
7204e18afe | ||
|
985e90bffc | ||
|
e82000e6f8 | ||
|
444d9b2d28 | ||
|
1a8e3d5ab2 | ||
|
fb720b29ec | ||
|
552772391c | ||
|
3a34e98d80 | ||
|
1beb900455 | ||
|
bb537f4328 | ||
|
2f38232dcf | ||
|
cd6a46c22e | ||
|
a8ca78f3f1 | ||
|
282b6ebce0 | ||
|
d13c5a9c2c | ||
|
2a639022ec | ||
|
d75ecfeca7 | ||
|
8ab0cde2e9 | ||
|
0171c3609a | ||
|
489526988d | ||
|
9d32e8e13b | ||
|
c9e0732f99 | ||
|
4920407ed7 | ||
|
3647197d3b | ||
|
a72ff03eeb | ||
|
3eaaa228d8 | ||
|
e0892fdb66 | ||
|
8f5fbb4053 | ||
|
b5295ffe4c | ||
|
d82e0ed529 | ||
|
5c63b7b73a | ||
|
77a5c347fc | ||
|
add1a86376 | ||
|
e771293269 | ||
|
4420c6c608 | ||
|
a3b4c6cb28 | ||
|
29fe40002c | ||
|
1797276e52 | ||
|
d07de0d33c | ||
|
fb8c0b79b3 | ||
|
80eadd5d19 | ||
|
8ef4bbe322 | ||
|
901ca8077e | ||
|
8de79d3336 | ||
|
dbde052d4a | ||
|
9716c3c98c | ||
|
8f8a1a6124 | ||
|
12300ef081 | ||
|
5ea71e2c1a | ||
|
a26f643ba3 | ||
|
4b49fb1340 | ||
|
3e28c42e1c | ||
|
50b89e7eb2 | ||
|
893000e40f | ||
|
f2eca9a2b9 | ||
|
76f40a6265 | ||
|
86f347edad | ||
|
b6c7afc744 | ||
|
f099d3c737 | ||
|
cfbaf44a05 | ||
|
0f5e16464c | ||
|
13bfae4681 | ||
|
2ee9bfed73 | ||
|
4a457e15fa | ||
|
b723cfec4e | ||
|
1b92928487 |
2
.github/workflows/macos.yml
vendored
@ -60,7 +60,7 @@ jobs:
|
||||
# 拷贝依赖
|
||||
sudo macdeployqt bin/Release/${targetName}.app -qmldir=. -dmg
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
|
||||
path: bin/release/${{ env.targetName }}.app
|
||||
|
7
.github/workflows/ubuntu.yml
vendored
@ -69,6 +69,11 @@ jobs:
|
||||
- name: Check if svg file exists
|
||||
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
|
||||
|
||||
- name: Copy translation files
|
||||
run: |
|
||||
mkdir -p bin/release/usr/bin/
|
||||
cp -r bin/Release/i18n/ bin/release/usr/bin/i18n/
|
||||
|
||||
- name: package
|
||||
run: |
|
||||
# make sure Qt plugin finds QML sources so it can deploy the imported files
|
||||
@ -77,7 +82,7 @@ jobs:
|
||||
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/Release/${targetName} --appdir bin/release/
|
||||
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
|
||||
path: ${{ env.targetName }}.AppImage
|
||||
|
2
.github/workflows/windows-mingw.yml
vendored
@ -82,7 +82,7 @@ jobs:
|
||||
$name = ${env:archiveName}
|
||||
echo "::set-output name=packageName::$name"
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.package.outputs.packageName }}
|
||||
path: dist
|
||||
|
2
.github/workflows/windows-qt5.yml
vendored
@ -69,7 +69,7 @@ jobs:
|
||||
$name = ${env:archiveName}
|
||||
echo "::set-output name=packageName::$name"
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.package.outputs.packageName }}
|
||||
path: dist
|
||||
|
2
.github/workflows/windows.yml
vendored
@ -76,7 +76,7 @@ jobs:
|
||||
$name = ${env:archiveName}
|
||||
echo "::set-output name=packageName::$name"
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.package.outputs.packageName }}
|
||||
path: dist
|
||||
|
20
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"MicroPython.executeButton": [
|
||||
{
|
||||
"text": "▶",
|
||||
"tooltip": "运行",
|
||||
"alignment": "left",
|
||||
"command": "extension.executeFile",
|
||||
"priority": 3.5
|
||||
}
|
||||
],
|
||||
"MicroPython.syncButton": [
|
||||
{
|
||||
"text": "$(sync)",
|
||||
"tooltip": "同步",
|
||||
"alignment": "left",
|
||||
"command": "extension.execute",
|
||||
"priority": 4
|
||||
}
|
||||
]
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
# ATTENTION!
|
||||
# PLEASE USE THE BRAND NEW [FluentUI Pro](https://github.com/zhuzichu520/FluentUI2) INSTEAD!
|
||||
<div align=center>
|
||||
<img width=64 src="doc/preview/fluent_design.svg">
|
||||
|
||||
|
@ -24,8 +24,8 @@ else ()
|
||||
endif ()
|
||||
|
||||
#导入Qt相关依赖包
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network)
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network Widgets)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network Widgets)
|
||||
|
||||
#添加国际化脚本
|
||||
find_program(QT_LUPDATE NAMES lupdate lupdate-qt6)
|
||||
@ -141,6 +141,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Quick
|
||||
Qt${QT_VERSION_MAJOR}::Svg
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
fluentuiplugin
|
||||
)
|
||||
|
||||
|
@ -639,7 +639,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="95"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="339"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="337"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -659,57 +659,57 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="304"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="302"/>
|
||||
<source>Finish</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="305"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="303"/>
|
||||
<source>Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="306"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="304"/>
|
||||
<source>Previous</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="310"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="308"/>
|
||||
<source>Dark Mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="310"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="308"/>
|
||||
<source>Here you can switch to night mode.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="312"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="310"/>
|
||||
<source>Hide Easter eggs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="312"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="310"/>
|
||||
<source>Try a few more clicks!!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="336"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="334"/>
|
||||
<source>Upgrade Tips</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="337"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="335"/>
|
||||
<source>FluentUI is currently up to date </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="337"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="335"/>
|
||||
<source> -- The current app version</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="337"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="335"/>
|
||||
<source>
|
||||
Now go and download the new version?
|
||||
|
||||
@ -718,17 +718,17 @@ Updated content:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="340"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="338"/>
|
||||
<source>OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="367"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="365"/>
|
||||
<source>The current version is already the latest</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/window/MainWindow.qml" line="374"/>
|
||||
<location filename="qml/window/MainWindow.qml" line="372"/>
|
||||
<source>The network is abnormal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -831,9 +831,25 @@ Updated content:
|
||||
<name>T_Acrylic</name>
|
||||
<message>
|
||||
<location filename="qml/page/T_Acrylic.qml" line="10"/>
|
||||
<location filename="qml/page/T_Acrylic.qml" line="72"/>
|
||||
<source>Acrylic</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Acrylic.qml" line="15"/>
|
||||
<source>tintColor:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Acrylic.qml" line="25"/>
|
||||
<source>tintOpacity:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Acrylic.qml" line="36"/>
|
||||
<source>blurRadius:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_Badge</name>
|
||||
@ -863,11 +879,22 @@ Updated content:
|
||||
<source>BreadcurmbBar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_BreadcrumbBar.qml" line="15"/>
|
||||
<source>Item_%1</source>
|
||||
<oldsource>Item_'%1'</oldsource>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_BreadcrumbBar.qml" line="50"/>
|
||||
<source>Reset sample</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_BreadcrumbBar.qml" line="54"/>
|
||||
<source>Item_</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_BubbleChart</name>
|
||||
@ -902,7 +929,7 @@ Updated content:
|
||||
<location filename="qml/page/T_Buttons.qml" line="199"/>
|
||||
<location filename="qml/page/T_Buttons.qml" line="320"/>
|
||||
<location filename="qml/page/T_Buttons.qml" line="368"/>
|
||||
<location filename="qml/page/T_Buttons.qml" line="421"/>
|
||||
<location filename="qml/page/T_Buttons.qml" line="419"/>
|
||||
<source>Disabled</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -942,10 +969,16 @@ Updated content:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Buttons.qml" line="222"/>
|
||||
<location filename="qml/page/T_Buttons.qml" line="238"/>
|
||||
<source>Loading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Buttons.qml" line="238"/>
|
||||
<source>Normal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Buttons.qml" line="270"/>
|
||||
<source>Click IconButton</source>
|
||||
@ -1022,12 +1055,12 @@ Updated content:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Buttons.qml" line="408"/>
|
||||
<location filename="qml/page/T_Buttons.qml" line="407"/>
|
||||
<source>Radio Button_2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Buttons.qml" line="412"/>
|
||||
<location filename="qml/page/T_Buttons.qml" line="410"/>
|
||||
<source>Radio Button_3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1062,6 +1095,11 @@ Updated content:
|
||||
<source>Please enter a verification code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Captcha.qml" line="48"/>
|
||||
<source>verify</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Captcha.qml" line="52"/>
|
||||
<source>The verification code is correct</source>
|
||||
@ -1085,6 +1123,11 @@ Updated content:
|
||||
<source>Carousel map, support infinite carousel, infinite swipe, and components implemented with ListView</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Carousel.qml" line="203"/>
|
||||
<source>Auto play</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_CheckBox</name>
|
||||
@ -1158,6 +1201,62 @@ Updated content:
|
||||
<source>ComboBox</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="20"/>
|
||||
<source>editable=false</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="26"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="50"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="74"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="100"/>
|
||||
<source>Banana</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="27"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="51"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="75"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="101"/>
|
||||
<source>Apple</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="28"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="52"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="76"/>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="102"/>
|
||||
<source>Coconut</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="43"/>
|
||||
<source>disabled=true</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="67"/>
|
||||
<source>editable=true</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_ComboBox.qml" line="88"/>
|
||||
<source>FluComboBox{
|
||||
editable: true
|
||||
model: ListModel {
|
||||
id: model
|
||||
ListElement { text: "%1" }
|
||||
ListElement { text: "%2" }
|
||||
ListElement { text: "%3" }
|
||||
}
|
||||
onAccepted: {
|
||||
if (find(editText) === -1)
|
||||
model.append({text: editText})
|
||||
}
|
||||
}</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_CustomPlot</name>
|
||||
@ -1314,6 +1413,26 @@ Since that moment, I have been tormented day and night by the fear that I might
|
||||
My only desire is to be permitted to drive out the traitors and restore the Han. If I should let you down, punish my offense and report it to the spirit of the late Emperor. If those three advisors should fail in their duties, then they should be punished for their negligence.Your Majesty, consider your course of action carefully. Seek out good advice, and never forget the late Emperor. I depart now on a long expedition, and I will be forever grateful if you heed my advice. Blinded by my own tears, I know not what I write.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Expander.qml" line="152"/>
|
||||
<source>Check for Updates</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Expander.qml" line="207"/>
|
||||
<source>This is a ToggleButton in the header</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Expander.qml" line="215"/>
|
||||
<source>This is a StandardButton in the content</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Expander.qml" line="217"/>
|
||||
<source>Click StandardButton</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_FlipView</name>
|
||||
@ -1421,7 +1540,12 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Icons.qml" line="51"/>
|
||||
<location filename="qml/page/T_Icons.qml" line="28"/>
|
||||
<source>Disabled</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Icons.qml" line="61"/>
|
||||
<source>You Copied </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1467,11 +1591,21 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
||||
<source>This is an InfoBar in the Warning Style</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="39"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="41"/>
|
||||
<source>This is an InfoBar in the Error Style</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="45"/>
|
||||
<source>Success</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="47"/>
|
||||
<source>This is an InfoBar in the Success Style</source>
|
||||
@ -1494,30 +1628,53 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="64"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="74"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="84"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="75"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="85"/>
|
||||
<source>close '%1'</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="64"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="74"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="84"/>
|
||||
<source>show '%1</source>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="75"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="85"/>
|
||||
<source>show '%1'</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="70"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="80"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="90"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="81"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="91"/>
|
||||
<source>This is an '%1'</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="94"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="64"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="70"/>
|
||||
<source>info1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="75"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="81"/>
|
||||
<source>info2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="85"/>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="91"/>
|
||||
<source>info3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="95"/>
|
||||
<source>clear all info</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_InfoBar.qml" line="103"/>
|
||||
<source>Loading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_LineChart</name>
|
||||
@ -1792,6 +1949,31 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
||||
<source>QRCode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_QRCode.qml" line="27"/>
|
||||
<source>text:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_QRCode.qml" line="41"/>
|
||||
<source>color:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_QRCode.qml" line="54"/>
|
||||
<source>bgColor:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_QRCode.qml" line="66"/>
|
||||
<source>margins:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_QRCode.qml" line="80"/>
|
||||
<source>size:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_RadarChart</name>
|
||||
@ -2033,6 +2215,37 @@ Some contents...</source>
|
||||
<source>SplitLayout</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_SplitLayout.qml" line="18"/>
|
||||
<source>orientation:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_SplitLayout.qml" line="23"/>
|
||||
<location filename="qml/page/T_SplitLayout.qml" line="25"/>
|
||||
<source>Horizontal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_SplitLayout.qml" line="32"/>
|
||||
<source>Vertical</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_SplitLayout.qml" line="57"/>
|
||||
<source>Page 1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_SplitLayout.qml" line="69"/>
|
||||
<source>Page 2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_SplitLayout.qml" line="78"/>
|
||||
<source>Page 3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_StaggeredLayout</name>
|
||||
@ -2049,6 +2262,27 @@ Some contents...</source>
|
||||
<source>StatusLayout</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_StatusLayout.qml" line="22"/>
|
||||
<location filename="qml/page/T_StatusLayout.qml" line="24"/>
|
||||
<source>Loading</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_StatusLayout.qml" line="31"/>
|
||||
<source>Empty</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_StatusLayout.qml" line="38"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_StatusLayout.qml" line="45"/>
|
||||
<source>Success</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_TabView</name>
|
||||
@ -2062,6 +2296,48 @@ Some contents...</source>
|
||||
<source>Document </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="39"/>
|
||||
<source>Tab Width Behavior:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="44"/>
|
||||
<location filename="qml/page/T_TabView.qml" line="46"/>
|
||||
<source>Equal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="53"/>
|
||||
<source>SizeToContent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="60"/>
|
||||
<source>Compact</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="68"/>
|
||||
<source>Tab Close Button Visibility:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="72"/>
|
||||
<location filename="qml/page/T_TabView.qml" line="82"/>
|
||||
<source>Always</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="75"/>
|
||||
<source>Never</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TabView.qml" line="89"/>
|
||||
<source>OnHover</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_TableView</name>
|
||||
@ -2092,7 +2368,7 @@ Some contents...</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="176"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="508"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="503"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2112,67 +2388,67 @@ Some contents...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="364"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="359"/>
|
||||
<source>Age</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="439"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="434"/>
|
||||
<source>Clear All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="446"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="441"/>
|
||||
<source>Delete Selection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="469"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="464"/>
|
||||
<source>Add a row of Data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="475"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="470"/>
|
||||
<source>Insert a Row</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="482"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="477"/>
|
||||
<source>Focus not acquired: Please click any item in the form as the target for insertion!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="513"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="508"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="527"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="522"/>
|
||||
<source>Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="535"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="530"/>
|
||||
<source>Nickname</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="542"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="537"/>
|
||||
<source>Long String</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="550"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="545"/>
|
||||
<source>Options</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="568"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="563"/>
|
||||
<source><Previous</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="569"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="564"/>
|
||||
<source>Next></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2185,10 +2461,15 @@ Some contents...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Text.qml" line="18"/>
|
||||
<location filename="qml/page/T_Text.qml" line="19"/>
|
||||
<source>This is a text that can be copied</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Text.qml" line="29"/>
|
||||
<source>Disabled</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_TextBox</name>
|
||||
@ -2262,8 +2543,35 @@ Some contents...</source>
|
||||
<message>
|
||||
<location filename="qml/page/T_Theme.qml" line="123"/>
|
||||
<source>Open Blur Window</source>
|
||||
<oldsource>Rounded Window</oldsource>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Theme.qml" line="157"/>
|
||||
<location filename="qml/page/T_Theme.qml" line="162"/>
|
||||
<source>dwm-blur</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Theme.qml" line="158"/>
|
||||
<source>window tintOpacity</source>
|
||||
<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>
|
||||
<name>T_TimePicker</name>
|
||||
@ -2336,6 +2644,27 @@ Some contents...</source>
|
||||
<source>clear</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Timeline.qml" line="130"/>
|
||||
<source>mode:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Timeline.qml" line="137"/>
|
||||
<source>Left</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Timeline.qml" line="144"/>
|
||||
<source>Right</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Timeline.qml" line="135"/>
|
||||
<location filename="qml/page/T_Timeline.qml" line="151"/>
|
||||
<source>Alternate</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_ToggleSwitch</name>
|
||||
@ -2463,22 +2792,57 @@ Some contents...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="183"/>
|
||||
<location filename="qml/page/T_TreeView.qml" line="92"/>
|
||||
<source>cellHeight:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="105"/>
|
||||
<source>depthPadding:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="121"/>
|
||||
<source>showLine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="126"/>
|
||||
<source>checkable</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="134"/>
|
||||
<source>all expand</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="140"/>
|
||||
<source>all collapse</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="147"/>
|
||||
<source>print selection model</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="182"/>
|
||||
<source>Title</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="187"/>
|
||||
<location filename="qml/page/T_TreeView.qml" line="186"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="191"/>
|
||||
<location filename="qml/page/T_TreeView.qml" line="190"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="195"/>
|
||||
<location filename="qml/page/T_TreeView.qml" line="194"/>
|
||||
<source>Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2490,6 +2854,41 @@ Some contents...</source>
|
||||
<source>Typography</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Typography.qml" line="27"/>
|
||||
<source>Display</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Typography.qml" line="33"/>
|
||||
<source>Title Large</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Typography.qml" line="39"/>
|
||||
<source>Title</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Typography.qml" line="45"/>
|
||||
<source>Subtitle</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Typography.qml" line="51"/>
|
||||
<source>Body Strong</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Typography.qml" line="57"/>
|
||||
<source>Body</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Typography.qml" line="63"/>
|
||||
<source>Caption</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_Watermark</name>
|
||||
@ -2498,5 +2897,45 @@ Some contents...</source>
|
||||
<source>Watermark</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="25"/>
|
||||
<source>text:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="38"/>
|
||||
<source>textSize:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="51"/>
|
||||
<source>gapX:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="62"/>
|
||||
<source>gapY:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="73"/>
|
||||
<source>offsetX:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="84"/>
|
||||
<source>offsetY:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="95"/>
|
||||
<source>rotate:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_Watermark.qml" line="108"/>
|
||||
<source>textColor:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
@ -12,7 +12,7 @@ FluScrollablePage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text:"tintColor:"
|
||||
text: qsTr("tintColor:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluColorPicker{
|
||||
@ -22,7 +22,7 @@ FluScrollablePage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text:"tintOpacity:"
|
||||
text: qsTr("tintOpacity:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -33,7 +33,7 @@ FluScrollablePage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text:"blurRadius:"
|
||||
text: qsTr("blurRadius:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -69,7 +69,7 @@ FluScrollablePage{
|
||||
y:(image.height-height)/2
|
||||
FluText {
|
||||
anchors.centerIn: parent
|
||||
text: "Acrylic"
|
||||
text: qsTr("Acrylic")
|
||||
color: "#FFFFFF"
|
||||
font: FluTextStyle.Subtitle
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ FluScrollablePage{
|
||||
Component.onCompleted: {
|
||||
var items = []
|
||||
for(var i=0;i<10;i++){
|
||||
items.push({title:"Item_"+(i+1)})
|
||||
items.push({title: qsTr("Item_%1").arg(i+1)})
|
||||
}
|
||||
breadcrumb_1.items = items
|
||||
breadcrumb_2.items = items
|
||||
@ -51,7 +51,7 @@ FluScrollablePage{
|
||||
onClicked:{
|
||||
var items = []
|
||||
for(var i=0;i<10;i++){
|
||||
items.push({title:"Item_"+(i+1)})
|
||||
items.push({title: qsTr("Item_")+(i+1)})
|
||||
}
|
||||
breadcrumb_2.items = items
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ FluScrollablePage{
|
||||
FluLoadingButton{
|
||||
id: btn_loading
|
||||
loading: loading_button_switch.checked
|
||||
text: qsTr("Loading Button")
|
||||
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Loading Button")
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
@ -235,7 +235,7 @@ FluScrollablePage{
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
text: qsTr("Loading")
|
||||
text: loading_button_switch.checked ? qsTr("Loading") : qsTr("Normal")
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
@ -399,16 +399,14 @@ FluScrollablePage{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
disabled: radio_button_switch.checked
|
||||
FluRadioButton{
|
||||
disabled:radio_button_switch.checked
|
||||
text: qsTr("Radio Button_1")
|
||||
}
|
||||
FluRadioButton{
|
||||
disabled:radio_button_switch.checked
|
||||
text: qsTr("Radio Button_2")
|
||||
}
|
||||
FluRadioButton{
|
||||
disabled:radio_button_switch.checked
|
||||
text: qsTr("Radio Button_3")
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ FluScrollablePage{
|
||||
Layout.preferredWidth: 240
|
||||
}
|
||||
FluButton{
|
||||
text:"verify"
|
||||
text: qsTr("verify")
|
||||
onClicked: {
|
||||
var success = captcha.verify(text_box.text)
|
||||
if(success){
|
||||
|
@ -121,7 +121,6 @@ FluScrollablePage{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -6
|
||||
@ -140,6 +139,90 @@ FluScrollablePage{
|
||||
Component.onCompleted: {
|
||||
carousel.model = [{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}]
|
||||
}
|
||||
}'
|
||||
}
|
||||
|
||||
FluFrame{
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 300 + topPadding + bottomPadding
|
||||
padding: 10
|
||||
Layout.topMargin: 10
|
||||
RowLayout{
|
||||
anchors.fill: parent
|
||||
Item{
|
||||
Layout.preferredWidth: 400
|
||||
Layout.fillHeight: true
|
||||
FluShadow{
|
||||
radius: 8
|
||||
}
|
||||
FluCarousel{
|
||||
anchors.fill: parent
|
||||
orientation: Qt.Vertical
|
||||
autoPlay: auto_play_switch.checked
|
||||
loopTime:1500
|
||||
indicatorGravity: Qt.AlignVCenter | Qt.AlignRight
|
||||
indicatorMarginTop:15
|
||||
delegate: Component{
|
||||
Item{
|
||||
anchors.fill: parent
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: model.url
|
||||
asynchronous: true
|
||||
fillMode:Image.PreserveAspectCrop
|
||||
}
|
||||
Rectangle{
|
||||
height: 40
|
||||
width: parent.width
|
||||
anchors.bottom: parent.bottom
|
||||
color: "#33000000"
|
||||
FluText{
|
||||
anchors.fill: parent
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
text:model.title
|
||||
color: FluColors.Grey10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Layout.topMargin: 20
|
||||
Layout.leftMargin: 5
|
||||
Component.onCompleted: {
|
||||
var arr = []
|
||||
arr.push({url:"qrc:/example/res/image/banner_1.jpg",title:"共同应对全球性问题"})
|
||||
arr.push({url:"qrc:/example/res/image/banner_2.jpg",title:"三小只全程没互动"})
|
||||
arr.push({url:"qrc:/example/res/image/banner_3.jpg",title:"有效投资扩大 激发增长动能"})
|
||||
model = arr
|
||||
}
|
||||
}
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: auto_play_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: qsTr("Auto play")
|
||||
}
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -6
|
||||
code:'FluCarousel{
|
||||
id:carousel
|
||||
width: 400
|
||||
height: 300
|
||||
orientation: Qt.Vertical
|
||||
delegate: Component{
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: model.url
|
||||
asynchronous: true
|
||||
fillMode:Image.PreserveAspectCrop
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
carousel.model = [{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}]
|
||||
}
|
||||
}'
|
||||
}
|
||||
}
|
||||
|
@ -17,15 +17,15 @@ FluScrollablePage{
|
||||
spacing: 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluText{
|
||||
text: "editable=false"
|
||||
text: qsTr("editable=false")
|
||||
x:10
|
||||
}
|
||||
FluComboBox {
|
||||
model: ListModel {
|
||||
id: model_1
|
||||
ListElement { text: "Banana" }
|
||||
ListElement { text: "Apple" }
|
||||
ListElement { text: "Coconut" }
|
||||
ListElement { text: qsTr("Banana") }
|
||||
ListElement { text: qsTr("Apple") }
|
||||
ListElement { text: qsTr("Coconut") }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -40,16 +40,16 @@ FluScrollablePage{
|
||||
spacing: 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluText{
|
||||
text: "disabled=true"
|
||||
text: qsTr("disabled=true")
|
||||
x:10
|
||||
}
|
||||
FluComboBox {
|
||||
disabled: true
|
||||
model: ListModel {
|
||||
id: model_2
|
||||
ListElement { text: "Banana" }
|
||||
ListElement { text: "Apple" }
|
||||
ListElement { text: "Coconut" }
|
||||
ListElement { text: qsTr("Banana") }
|
||||
ListElement { text: qsTr("Apple") }
|
||||
ListElement { text: qsTr("Coconut") }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,16 +64,16 @@ FluScrollablePage{
|
||||
spacing: 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluText{
|
||||
text: "editable=true"
|
||||
text: qsTr("editable=true")
|
||||
x:5
|
||||
}
|
||||
FluComboBox {
|
||||
editable: true
|
||||
model: ListModel {
|
||||
id: model_3
|
||||
ListElement { text: "Banana" }
|
||||
ListElement { text: "Apple" }
|
||||
ListElement { text: "Coconut" }
|
||||
ListElement { text: qsTr("Banana") }
|
||||
ListElement { text: qsTr("Apple") }
|
||||
ListElement { text: qsTr("Coconut") }
|
||||
}
|
||||
onAccepted: {
|
||||
if (find(editText) === -1)
|
||||
@ -85,19 +85,21 @@ FluScrollablePage{
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -6
|
||||
code:'FluComboBox{
|
||||
code:qsTr('FluComboBox{
|
||||
editable: true
|
||||
model: ListModel {
|
||||
id: model
|
||||
ListElement { text: "Banana" }
|
||||
ListElement { text: "Apple" }
|
||||
ListElement { text: "Coconut" }
|
||||
ListElement { text: "%1" }
|
||||
ListElement { text: "%2" }
|
||||
ListElement { text: "%3" }
|
||||
}
|
||||
onAccepted: {
|
||||
if (find(editText) === -1)
|
||||
model.append({text: editText})
|
||||
}
|
||||
}'
|
||||
}').arg(qsTr("Banana"))
|
||||
.arg(qsTr("Apple"))
|
||||
.arg(qsTr("Coconut"))
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -105,5 +105,147 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
||||
}'
|
||||
}
|
||||
|
||||
FluFrame {
|
||||
Layout.fillWidth: true
|
||||
padding: 10
|
||||
Layout.topMargin: 20
|
||||
Column {
|
||||
spacing: 15
|
||||
FluExpander {
|
||||
headerHeight: 60
|
||||
contentHeight: content_layout.implicitHeight
|
||||
headerDelegate: Component {
|
||||
Item {
|
||||
RowLayout {
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 15
|
||||
}
|
||||
spacing: 15
|
||||
FluImage {
|
||||
width: 20
|
||||
height: 20
|
||||
sourceSize.width: 20
|
||||
sourceSize.height: 20
|
||||
source: "qrc:/example/res/image/favicon.ico"
|
||||
}
|
||||
ColumnLayout {
|
||||
spacing: 0
|
||||
FluText {
|
||||
text: "FluentUI"
|
||||
}
|
||||
FluText {
|
||||
text: "%1".arg(AppInfo.version)
|
||||
textColor: FluTheme.fontSecondaryColor
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
}
|
||||
FluLoadingButton {
|
||||
id: btn_checkupdate
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
rightMargin: 15
|
||||
}
|
||||
text: qsTr("Check for Updates")
|
||||
onClicked: {
|
||||
loading = true;
|
||||
FluEventBus.post("checkUpdate");
|
||||
}
|
||||
}
|
||||
FluEvent {
|
||||
name: "checkUpdateFinish"
|
||||
onTriggered: {
|
||||
btn_checkupdate.loading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
content: ColumnLayout {
|
||||
id: content_layout
|
||||
spacing: 0
|
||||
RowLayout {
|
||||
Layout.topMargin: 15
|
||||
Layout.leftMargin: 15
|
||||
spacing: 0
|
||||
FluText {
|
||||
text: "GitHub: "
|
||||
}
|
||||
FluTextButton {
|
||||
text: "https://github.com/zhuzichu520/FluentUI"
|
||||
onClicked: {
|
||||
Qt.openUrlExternally(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.bottomMargin: 15
|
||||
Layout.leftMargin: 15
|
||||
spacing: 0
|
||||
FluText {
|
||||
text: "bilibili: "
|
||||
}
|
||||
FluTextButton {
|
||||
text: "https://www.bilibili.com/video/BV1mg4y1M71w"
|
||||
onClicked: {
|
||||
Qt.openUrlExternally(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FluExpander {
|
||||
contentHeight: 100
|
||||
headerHeight: 45
|
||||
headerDelegate: Component {
|
||||
Item {
|
||||
FluToggleButton {
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("This is a ToggleButton in the header")
|
||||
}
|
||||
}
|
||||
}
|
||||
content: Item {
|
||||
anchors.fill: parent
|
||||
FluButton {
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("This is a StandardButton in the content")
|
||||
onClicked: {
|
||||
showInfo(qsTr("Click StandardButton"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CodeExpander {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -6
|
||||
code: 'FluExpander {
|
||||
contentHeight: 100
|
||||
headerHeight: 45
|
||||
headerDelegate: Component {
|
||||
Item {
|
||||
FluToggleButton {
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("This is a ToggleButton in the header")
|
||||
}
|
||||
}
|
||||
}
|
||||
content: Item {
|
||||
anchors.fill: parent
|
||||
FluButton {
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("This is a StandardButton in the content")
|
||||
onClicked: {
|
||||
showInfo(qsTr("Click StandardButton"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}'
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,15 @@ FluContentPage {
|
||||
grid_view.model = FluApp.iconData(text_box.text)
|
||||
}
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: toggle_switch
|
||||
anchors{
|
||||
left: text_box.right
|
||||
verticalCenter: text_box.verticalCenter
|
||||
leftMargin: 10
|
||||
}
|
||||
text: qsTr("Disabled")
|
||||
}
|
||||
GridView{
|
||||
id: grid_view
|
||||
cellWidth: 110
|
||||
@ -45,6 +54,7 @@ FluContentPage {
|
||||
horizontalPadding: 0
|
||||
bottomPadding: 30
|
||||
anchors.fill: parent
|
||||
disabled: toggle_switch.checked
|
||||
onClicked: {
|
||||
var text ="FluentIcons."+modelData.name;
|
||||
FluTools.clipText(text)
|
||||
@ -57,6 +67,7 @@ FluContentPage {
|
||||
text: modelData.name
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 60
|
||||
enabled: !toggle_switch.checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,13 +36,13 @@ FluScrollablePage{
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text:"Error"
|
||||
text: qsTr("Error")
|
||||
onClicked: {
|
||||
showError(qsTr("This is an InfoBar in the Error Style"))
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text:"Success"
|
||||
text: qsTr("Success")
|
||||
onClicked: {
|
||||
showSuccess(qsTr("This is an InfoBar in the Success Style"))
|
||||
}
|
||||
@ -61,33 +61,34 @@ FluScrollablePage{
|
||||
Row{
|
||||
spacing: 5
|
||||
FluButton{
|
||||
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info1")
|
||||
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info1"))
|
||||
onClicked: {
|
||||
if(info1) {
|
||||
info1.close()
|
||||
return
|
||||
}
|
||||
info1 = showInfo(qsTr("This is an '%1'").arg("info1"), 0)
|
||||
info1 = showInfo(qsTr("This is an '%1'").arg(qsTr("info1")), 0)
|
||||
info1.close()
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info2")
|
||||
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info2"))
|
||||
onClicked: {
|
||||
if(info2) {
|
||||
info2.close()
|
||||
return
|
||||
}
|
||||
info2 = showInfo(qsTr("This is an '%1'").arg("info2"), 0)
|
||||
info2 = showInfo(qsTr("This is an '%1'").arg(qsTr("info2")), 0)
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info3")
|
||||
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1'")).arg(qsTr("info3"))
|
||||
onClicked: {
|
||||
if(info3) {
|
||||
info3.close()
|
||||
return
|
||||
}
|
||||
info3 = showInfo(qsTr("This is an '%1'").arg("info3"), 0)
|
||||
info3 = showInfo(qsTr("This is an '%1'").arg(qsTr("info3")), 0)
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
@ -99,7 +100,7 @@ FluScrollablePage{
|
||||
}
|
||||
|
||||
FluButton{
|
||||
text:"Loading"
|
||||
text: qsTr("Loading")
|
||||
onClicked: {
|
||||
showLoading()
|
||||
}
|
||||
|
@ -49,26 +49,26 @@ FluScrollablePage{
|
||||
Layout.topMargin: -6
|
||||
code:'FluPivot{
|
||||
anchors.fill: parent
|
||||
FluPivotItem:{
|
||||
text: qsTr("All")
|
||||
FluPivotItem {
|
||||
title: qsTr("All")
|
||||
contentItem: FluText{
|
||||
text: qsTr("All emails go here.")
|
||||
}
|
||||
}
|
||||
FluPivotItem:{
|
||||
text: qsTr("Unread")
|
||||
FluPivotItem {
|
||||
title: qsTr("Unread")
|
||||
contentItem: FluText{
|
||||
text: qsTr("Unread emails go here.")
|
||||
}
|
||||
}
|
||||
FluPivotItem:{
|
||||
text: qsTr("Flagged")
|
||||
FluPivotItem {
|
||||
title: qsTr("Flagged")
|
||||
contentItem: FluText{
|
||||
text: qsTr("Flagged emails go here.")
|
||||
}
|
||||
}
|
||||
FluPivotItem:{
|
||||
text: qsTr("Urgent")
|
||||
FluPivotItem {
|
||||
title: qsTr("Urgent")
|
||||
contentItem: FluText{
|
||||
text: qsTr("Urgent emails go here.")
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ FluScrollablePage{
|
||||
spacing: 10
|
||||
Layout.topMargin: 20
|
||||
FluText{
|
||||
text:"text:"
|
||||
text: qsTr("text:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluTextBox{
|
||||
@ -38,7 +38,7 @@ FluScrollablePage{
|
||||
spacing: 10
|
||||
Layout.topMargin: 10
|
||||
FluText{
|
||||
text:"color:"
|
||||
text: qsTr("color:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluColorPicker{
|
||||
@ -51,7 +51,7 @@ FluScrollablePage{
|
||||
spacing: 10
|
||||
Layout.topMargin: 10
|
||||
FluText{
|
||||
text:"bgColor:"
|
||||
text: qsTr("bgColor:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluColorPicker{
|
||||
@ -63,7 +63,7 @@ FluScrollablePage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text:"margins:"
|
||||
text: qsTr("margins:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -77,7 +77,7 @@ FluScrollablePage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text:"size:"
|
||||
text: qsTr("size:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
|
@ -15,21 +15,21 @@ FluContentPage{
|
||||
top: parent.top
|
||||
}
|
||||
FluText{
|
||||
text:"orientation:"
|
||||
text: qsTr("orientation:")
|
||||
}
|
||||
FluDropDownButton{
|
||||
id:btn_orientation
|
||||
Layout.preferredWidth: 120
|
||||
text:"Horizontal"
|
||||
text: qsTr("Horizontal")
|
||||
FluMenuItem{
|
||||
text:"Horizontal"
|
||||
text: qsTr("Horizontal")
|
||||
onClicked: {
|
||||
btn_orientation.text = text
|
||||
split_layout.orientation = Qt.Horizontal
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Vertical"
|
||||
text: qsTr("Vertical")
|
||||
onClicked: {
|
||||
btn_orientation.text = text
|
||||
split_layout.orientation = Qt.Vertical
|
||||
@ -54,7 +54,7 @@ FluContentPage{
|
||||
SplitView.maximumWidth: 400
|
||||
SplitView.maximumHeight: 400
|
||||
FluText {
|
||||
text: "Page 1"
|
||||
text: qsTr("Page 1")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@ -66,7 +66,7 @@ FluContentPage{
|
||||
SplitView.fillWidth: true
|
||||
SplitView.fillHeight: true
|
||||
FluText {
|
||||
text: "Page 2"
|
||||
text: qsTr("Page 2")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@ FluContentPage{
|
||||
implicitWidth: 200
|
||||
implicitHeight: 200
|
||||
FluText {
|
||||
text: "Page 3"
|
||||
text: qsTr("Page 3")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
@ -19,30 +19,30 @@ FluScrollablePage{
|
||||
FluDropDownButton{
|
||||
id:btn_status_mode
|
||||
Layout.preferredWidth: 140
|
||||
text:"Loading"
|
||||
text: qsTr("Loading")
|
||||
FluMenuItem{
|
||||
text:"Loading"
|
||||
text: qsTr("Loading")
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusLayoutType.Loading
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Empty"
|
||||
text: qsTr("Empty")
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusLayoutType.Empty
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Error"
|
||||
text: qsTr("Error")
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusLayoutType.Error
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Success"
|
||||
text: qsTr("Success")
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusLayoutType.Success
|
||||
|
@ -35,52 +35,58 @@ FluScrollablePage{
|
||||
padding: 10
|
||||
RowLayout{
|
||||
spacing: 14
|
||||
FluCopyableText{
|
||||
text: qsTr("Tab Width Behavior:")
|
||||
}
|
||||
FluDropDownButton{
|
||||
id:btn_tab_width_behavior
|
||||
Layout.preferredWidth: 140
|
||||
text:"Equal"
|
||||
text: qsTr("Equal")
|
||||
FluMenuItem{
|
||||
text:"Equal"
|
||||
text: qsTr("Equal")
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabViewType.Equal
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"SizeToContent"
|
||||
text: qsTr("SizeToContent")
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabViewType.SizeToContent
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Compact"
|
||||
text: qsTr("Compact")
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabViewType.Compact
|
||||
}
|
||||
}
|
||||
}
|
||||
FluCopyableText{
|
||||
text: qsTr("Tab Close Button Visibility:")
|
||||
}
|
||||
FluDropDownButton{
|
||||
id:btn_close_button_visibility
|
||||
text:"Always"
|
||||
text: qsTr("Always")
|
||||
Layout.preferredWidth: 120
|
||||
FluMenuItem{
|
||||
text:"Never"
|
||||
text: qsTr("Never")
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabViewType.Never
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Always"
|
||||
text: qsTr("Always")
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabViewType.Always
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"OnHover"
|
||||
text: qsTr("OnHover")
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabViewType.OnHover
|
||||
|
@ -315,12 +315,7 @@ FluContentPage{
|
||||
radius: [20,20,20,20]
|
||||
Image{
|
||||
anchors.fill: parent
|
||||
source: {
|
||||
if(options && options.avatar){
|
||||
return options.avatar
|
||||
}
|
||||
return ""
|
||||
}
|
||||
source: options && options.avatar ? options.avatar : ""
|
||||
sourceSize: Qt.size(80,80)
|
||||
}
|
||||
}
|
||||
|
@ -15,10 +15,19 @@ FluScrollablePage{
|
||||
padding: 10
|
||||
|
||||
FluCopyableText{
|
||||
enabled: !toggle_switch.checked
|
||||
text: qsTr("This is a text that can be copied")
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
FluToggleSwitch{
|
||||
id: toggle_switch
|
||||
anchors{
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
text: qsTr("Disabled")
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
|
@ -13,7 +13,7 @@ FluScrollablePage{
|
||||
|
||||
FluFrame{
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 408
|
||||
Layout.fillHeight: true
|
||||
padding: 10
|
||||
|
||||
ColumnLayout{
|
||||
@ -124,12 +124,69 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: toggle_blur
|
||||
Layout.topMargin: 5
|
||||
checked: FluTheme.blurBehindWindowEnabled
|
||||
onClicked: {
|
||||
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{
|
||||
|
@ -127,28 +127,28 @@ FluScrollablePage{
|
||||
RowLayout{
|
||||
Layout.topMargin: 10
|
||||
FluText{
|
||||
text:"mode:"
|
||||
text: qsTr("mode:")
|
||||
}
|
||||
FluDropDownButton{
|
||||
id: btn_mode
|
||||
Layout.preferredWidth: 100
|
||||
text: "Alternate"
|
||||
text: qsTr("Alternate")
|
||||
FluMenuItem{
|
||||
text: "Left"
|
||||
text: qsTr("Left")
|
||||
onClicked: {
|
||||
btn_mode.text = text
|
||||
time_line.mode = FluTimelineType.Left
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text: "Right"
|
||||
text: qsTr("Right")
|
||||
onClicked: {
|
||||
btn_mode.text = text
|
||||
time_line.mode = FluTimelineType.Right
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text: "Alternate"
|
||||
text: qsTr("Alternate")
|
||||
onClicked: {
|
||||
btn_mode.text = text
|
||||
time_line.mode = FluTimelineType.Alternate
|
||||
|
@ -9,7 +9,6 @@ FluContentPage {
|
||||
|
||||
title: qsTr("TreeView")
|
||||
|
||||
|
||||
function treeData(){
|
||||
const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
|
||||
function getRandomName(){
|
||||
@ -90,7 +89,7 @@ FluContentPage {
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "cellHeight:"
|
||||
text: qsTr("cellHeight:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -103,7 +102,7 @@ FluContentPage {
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "depthPadding:"
|
||||
text: qsTr("depthPadding:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -119,12 +118,12 @@ FluContentPage {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluToggleSwitch{
|
||||
id: switch_showline
|
||||
text:"showLine"
|
||||
text: qsTr("showLine")
|
||||
checked: false
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: switch_checkable
|
||||
text:"checkable"
|
||||
text: qsTr("checkable")
|
||||
checked: false
|
||||
}
|
||||
}
|
||||
@ -132,20 +131,20 @@ FluContentPage {
|
||||
spacing: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluButton{
|
||||
text: "all expand"
|
||||
text: qsTr("all expand")
|
||||
onClicked: {
|
||||
tree_view.allExpand()
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text: "all collapse"
|
||||
text: qsTr("all collapse")
|
||||
onClicked: {
|
||||
tree_view.allCollapse()
|
||||
}
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text: "print selection model"
|
||||
text: qsTr("print selection model")
|
||||
onClicked: {
|
||||
var printData = []
|
||||
var data = tree_view.selectionModel();
|
||||
|
@ -24,43 +24,43 @@ FluContentPage {
|
||||
transformOrigin: Item.TopLeft
|
||||
FluText{
|
||||
id:text_Display
|
||||
text:"Display"
|
||||
text: qsTr("Display")
|
||||
padding: 0
|
||||
font: FluTextStyle.Display
|
||||
}
|
||||
FluText{
|
||||
id:text_TitleLarge
|
||||
text:"Title Large"
|
||||
text: qsTr("Title Large")
|
||||
padding: 0
|
||||
font: FluTextStyle.TitleLarge
|
||||
}
|
||||
FluText{
|
||||
id:text_Title
|
||||
text:"Title"
|
||||
text: qsTr("Title")
|
||||
padding: 0
|
||||
font: FluTextStyle.Title
|
||||
}
|
||||
FluText{
|
||||
id:text_Subtitle
|
||||
text:"Subtitle"
|
||||
text: qsTr("Subtitle")
|
||||
padding: 0
|
||||
font: FluTextStyle.Subtitle
|
||||
}
|
||||
FluText{
|
||||
id:text_BodyStrong
|
||||
text:"Body Strong"
|
||||
text: qsTr("Body Strong")
|
||||
padding: 0
|
||||
font: FluTextStyle.BodyStrong
|
||||
}
|
||||
FluText{
|
||||
id:text_Body
|
||||
text:"Body"
|
||||
text: qsTr("Body")
|
||||
padding: 0
|
||||
font: FluTextStyle.Body
|
||||
}
|
||||
FluText{
|
||||
id:text_Caption
|
||||
text:"Caption"
|
||||
text: qsTr("Caption")
|
||||
padding: 0
|
||||
font: FluTextStyle.Caption
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ FluContentPage{
|
||||
spacing: 10
|
||||
Layout.topMargin: 14
|
||||
FluText{
|
||||
text: "text:"
|
||||
text: qsTr("text:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluTextBox{
|
||||
@ -35,7 +35,7 @@ FluContentPage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "textSize:"
|
||||
text: qsTr("textSize:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -48,7 +48,7 @@ FluContentPage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "gapX:"
|
||||
text: qsTr("gapX:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -59,7 +59,7 @@ FluContentPage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "gapY:"
|
||||
text: qsTr("gapY:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -70,7 +70,7 @@ FluContentPage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "offsetX:"
|
||||
text: qsTr("offsetX:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -81,7 +81,7 @@ FluContentPage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "offsetY:"
|
||||
text: qsTr("offsetY:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -92,7 +92,7 @@ FluContentPage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "rotate:"
|
||||
text: qsTr("rotate:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
@ -105,7 +105,7 @@ FluContentPage{
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "textColor:"
|
||||
text: qsTr("textColor:")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluColorPicker{
|
||||
|
@ -236,6 +236,7 @@ FluWindow {
|
||||
id: reveal
|
||||
target: window.containerItem()
|
||||
anchors.fill: parent
|
||||
darkToLight: FluTheme.dark
|
||||
onAnimationFinished:{
|
||||
//动画结束后释放资源
|
||||
loader_reveal.sourceComponent = undefined
|
||||
@ -256,17 +257,14 @@ FluWindow {
|
||||
}
|
||||
|
||||
function handleDarkChanged(button){
|
||||
if(!FluTheme.animationEnabled || window.fitsAppBarWindows === false){
|
||||
if(FluTools.isMacos() || !FluTheme.animationEnabled){
|
||||
changeDark()
|
||||
}else{
|
||||
if(loader_reveal.sourceComponent){
|
||||
return
|
||||
}
|
||||
loader_reveal.sourceComponent = com_reveal
|
||||
var target = window.containerItem()
|
||||
var pos = button.mapToItem(target,0,0)
|
||||
var mouseX = pos.x
|
||||
var mouseY = pos.y
|
||||
var mouseX = pos.x + button.width / 2
|
||||
var mouseY = pos.y + button.height / 2
|
||||
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
|
||||
reveal.start(reveal.width*Screen.devicePixelRatio,reveal.height*Screen.devicePixelRatio,Qt.point(mouseX,mouseY),radius)
|
||||
|
@ -72,11 +72,6 @@ install(TARGETS ${PROJECT_NAME}
|
||||
BUNDLE DESTINATION .
|
||||
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 (APPLE)
|
||||
find_program(QT_DEPLOY_QT NAMES macdeployqt)
|
||||
|
@ -25,13 +25,32 @@ void CircularReveal::paint(QPainter *painter) {
|
||||
path.moveTo(_center.x(), _center.y());
|
||||
path.addEllipse(QPointF(_center.x(), _center.y()), _radius, _radius);
|
||||
painter->setCompositionMode(QPainter::CompositionMode_Clear);
|
||||
painter->fillPath(path, Qt::black);
|
||||
if(_darkToLight){
|
||||
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();
|
||||
}
|
||||
|
||||
[[maybe_unused]] void CircularReveal::start(int w, int h, const QPoint ¢er, int radius) {
|
||||
_anim->setStartValue(0);
|
||||
_anim->setEndValue(radius);
|
||||
if (_anim->state() == QAbstractAnimation::Running) {
|
||||
_anim->stop();
|
||||
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;
|
||||
_grabResult = _target->grabToImage(QSize(w, h));
|
||||
connect(_grabResult.data(), &QQuickItemGrabResult::ready, this,
|
||||
|
@ -10,6 +10,7 @@ class CircularReveal : public QQuickPaintedItem {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY_AUTO_P(QQuickItem *, target)
|
||||
Q_PROPERTY_AUTO(int, radius)
|
||||
Q_PROPERTY_AUTO(bool, darkToLight)
|
||||
public:
|
||||
explicit CircularReveal(QQuickItem *parent = nullptr);
|
||||
void paint(QPainter *painter) override;
|
||||
|
@ -90,7 +90,7 @@ int main(int argc, char *argv[]) {
|
||||
engine.rootContext()->setContextProperty("TranslateHelper", TranslateHelper::getInstance());
|
||||
engine.rootContext()->setContextProperty("Network", Network::getInstance());
|
||||
#ifdef FLUENTUI_BUILD_STATIC_LIB
|
||||
FluentUI::getInstance()->registerTypes(&engine);
|
||||
FluentUI::registerTypes(&engine);
|
||||
#endif
|
||||
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
|
||||
QObject::connect(
|
||||
|
@ -145,7 +145,7 @@ endif ()
|
||||
if (QT_VERSION VERSION_GREATER_EQUAL "6.2")
|
||||
#如果是Qt6.2版本以上,则使用qt_add_library,qt_add_qml_module函数添加资源文件
|
||||
if (FLUENTUI_BUILD_STATIC_LIB)
|
||||
set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/FluentUI)
|
||||
set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/FluentUI)
|
||||
endif ()
|
||||
qt_add_library(${PROJECT_NAME} ${LIB_TYPE})
|
||||
qt_add_qml_module(${PROJECT_NAME}
|
||||
@ -227,7 +227,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release"))
|
||||
find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)
|
||||
add_custom_target(Script-Generate-QmlTypes
|
||||
COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
|
||||
COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable -noinstantiate FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
|
||||
COMMENT "Generate qmltypes........."
|
||||
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -4,32 +4,156 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QDateTime>
|
||||
#include <optional>
|
||||
#include "FluTools.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
#pragma comment (lib, "user32.lib")
|
||||
#pragma comment (lib, "dwmapi.lib")
|
||||
static DwmSetWindowAttributeFunc pDwmSetWindowAttribute = nullptr;
|
||||
static DwmExtendFrameIntoClientAreaFunc pDwmExtendFrameIntoClientArea = nullptr;
|
||||
static DwmIsCompositionEnabledFunc pDwmIsCompositionEnabled = nullptr;
|
||||
static DwmEnableBlurBehindWindowFunc pDwmEnableBlurBehindWindow = nullptr;
|
||||
static SetWindowCompositionAttributeFunc pSetWindowCompositionAttribute = nullptr;
|
||||
static GetDpiForWindowFunc pGetDpiForWindow = nullptr;
|
||||
static GetSystemMetricsForDpiFunc pGetSystemMetricsForDpi = nullptr;
|
||||
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <dwmapi.h>
|
||||
static RTL_OSVERSIONINFOW GetRealOSVersionImpl() {
|
||||
HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
|
||||
using RtlGetVersionPtr = NTSTATUS(WINAPI *)(PRTL_OSVERSIONINFOW);
|
||||
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 const auto result = "windows_generic_MSG";
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline bool isCompositionEnabled() {
|
||||
typedef HRESULT (WINAPI *DwmIsCompositionEnabledPtr)(BOOL *pfEnabled);
|
||||
HMODULE module = ::LoadLibraryW(L"dwmapi.dll");
|
||||
static inline bool initializeFunctionPointers() {
|
||||
HMODULE module = LoadLibraryW(L"dwmapi.dll");
|
||||
if (module) {
|
||||
BOOL composition_enabled = false;
|
||||
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);
|
||||
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() {
|
||||
if (initializeFunctionPointers()) {
|
||||
BOOL composition_enabled = false;
|
||||
pDwmIsCompositionEnabled(&composition_enabled);
|
||||
return composition_enabled;
|
||||
}
|
||||
return false;
|
||||
@ -37,15 +161,195 @@ static inline bool isCompositionEnabled() {
|
||||
|
||||
static inline void setShadow(HWND hwnd) {
|
||||
const MARGINS shadow = {1, 0, 0, 0};
|
||||
typedef HRESULT (WINAPI *DwmExtendFrameIntoClientAreaPtr)(HWND hWnd, const MARGINS *pMarInset);
|
||||
HMODULE module = LoadLibraryW(L"dwmapi.dll");
|
||||
if (module) {
|
||||
DwmExtendFrameIntoClientAreaPtr dwm_extendframe_into_client_area_;
|
||||
dwm_extendframe_into_client_area_ = reinterpret_cast<DwmExtendFrameIntoClientAreaPtr>(GetProcAddress(module, "DwmExtendFrameIntoClientArea"));
|
||||
if (dwm_extendframe_into_client_area_) {
|
||||
dwm_extendframe_into_client_area_(hwnd, &shadow);
|
||||
if (initializeFunctionPointers()) {
|
||||
pDwmExtendFrameIntoClientArea(hwnd, &shadow);
|
||||
}
|
||||
if (isWin7Only()) {
|
||||
SetClassLong(hwnd, GCL_STYLE, GetClassLong(hwnd, GCL_STYLE) | CS_DROPSHADOW);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@ -70,6 +374,8 @@ FluFrameless::FluFrameless(QQuickItem *parent) : QQuickItem{parent} {
|
||||
_closeButton = nullptr;
|
||||
_topmost = false;
|
||||
_disabled = false;
|
||||
_effect = "normal";
|
||||
_effective = false;
|
||||
_isWindows11OrGreater = FluTools::getInstance()->isWindows11OrGreater();
|
||||
}
|
||||
|
||||
@ -80,16 +386,62 @@ FluFrameless::~FluFrameless() = default;
|
||||
}
|
||||
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
int w = window()->width();
|
||||
int h = window()->height();
|
||||
_current = window()->winId();
|
||||
window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
|
||||
if (!_fixSize) {
|
||||
window()->setFlag(Qt::WindowMaximizeButtonHint);
|
||||
}
|
||||
#ifdef Q_OS_MACOS
|
||||
window()->setFlag(Qt::FramelessWindowHint, true);
|
||||
window()->setProperty("__borderWidth", 1);
|
||||
#endif
|
||||
#ifdef Q_OS_LINUX
|
||||
window()->setFlag(Qt::CustomizeWindowHint, true);
|
||||
window()->setFlag(Qt::FramelessWindowHint, true);
|
||||
window()->setProperty("__borderWidth", 1);
|
||||
#endif
|
||||
window()->installEventFilter(this);
|
||||
QGuiApplication::instance()->installNativeEventFilter(this);
|
||||
if (_maximizeButton) {
|
||||
@ -102,24 +454,36 @@ void FluFrameless::componentComplete() {
|
||||
setHitTestVisible(_closeButton);
|
||||
}
|
||||
#ifdef Q_OS_WIN
|
||||
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3))
|
||||
qWarning()<<"Qt's own frameless bug, currently only exist in 6.5.3, please use other versions";
|
||||
#endif
|
||||
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
||||
# if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3))
|
||||
qWarning()
|
||||
<< "Qt's own frameless bug, currently only exist in 6.5.3, please use other versions";
|
||||
# endif
|
||||
if (!hwnd) {
|
||||
hwnd = reinterpret_cast<HWND>(window()->winId());
|
||||
}
|
||||
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) {
|
||||
::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) {
|
||||
connect(QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] {
|
||||
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
|
||||
});
|
||||
connect(
|
||||
QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] {
|
||||
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0,
|
||||
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CAPTION);
|
||||
}
|
||||
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
||||
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0,
|
||||
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
||||
connect(window(), &QQuickWindow::screenChanged, this, [hwnd] {
|
||||
::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOOWNERZORDER);
|
||||
::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED |
|
||||
SWP_NOOWNERZORDER);
|
||||
::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
|
||||
});
|
||||
if (!window()->property("_hideShadow").toBool()) {
|
||||
@ -136,13 +500,12 @@ void FluFrameless::componentComplete() {
|
||||
window()->setMaximumHeight(window()->maximumHeight() + appBarHeight);
|
||||
}
|
||||
window()->resize(QSize(w, h));
|
||||
connect(this, &FluFrameless::topmostChanged, this, [this] {
|
||||
_setWindowTopmost(topmost());
|
||||
});
|
||||
connect(this, &FluFrameless::topmostChanged, this, [this] { _setWindowTopmost(topmost()); });
|
||||
_setWindowTopmost(topmost());
|
||||
}
|
||||
|
||||
[[maybe_unused]] bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message, QT_NATIVE_EVENT_RESULT_TYPE *result) {
|
||||
[[maybe_unused]] bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
|
||||
QT_NATIVE_EVENT_RESULT_TYPE *result) {
|
||||
#ifdef Q_OS_WIN
|
||||
if ((eventType != qtNativeEventType()) || !message) {
|
||||
return false;
|
||||
@ -163,19 +526,71 @@ void FluFrameless::componentComplete() {
|
||||
auto *wp = reinterpret_cast<WINDOWPOS *>(lParam);
|
||||
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) {
|
||||
wp->flags |= SWP_NOCOPYBITS;
|
||||
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(::DefWindowProcW(hwnd, uMsg, wParam, lParam));
|
||||
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(
|
||||
::DefWindowProcW(hwnd, uMsg, wParam, lParam));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else if (uMsg == WM_NCCALCSIZE && wParam == TRUE) {
|
||||
bool isMaximum = ::IsZoomed(hwnd);
|
||||
if (isMaximum) {
|
||||
window()->setProperty("__margins",7);
|
||||
}else{
|
||||
window()->setProperty("__margins",0);
|
||||
const auto clientRect =
|
||||
((wParam == FALSE) ? reinterpret_cast<LPRECT>(lParam)
|
||||
: &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]);
|
||||
bool isMax = ::isMaximized(hwnd);
|
||||
bool isFull = ::isFullScreen(hwnd);
|
||||
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;
|
||||
}
|
||||
_setMaximizeHovered(false);
|
||||
*result = WVR_REDRAW;
|
||||
if (isMax || isFull) {
|
||||
APPBARDATA abd;
|
||||
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;
|
||||
} else if (uMsg == WM_NCHITTEST) {
|
||||
if (_isWindows11OrGreater) {
|
||||
@ -231,21 +646,29 @@ void FluFrameless::componentComplete() {
|
||||
*result = HTCLIENT;
|
||||
return true;
|
||||
} else if (uMsg == WM_NCPAINT) {
|
||||
if (isCompositionEnabled() && !this->_isFullScreen()) {
|
||||
return false;
|
||||
}
|
||||
*result = FALSE;
|
||||
return false;
|
||||
return true;
|
||||
} else if (uMsg == WM_NCACTIVATE) {
|
||||
*result = TRUE;
|
||||
if (isCompositionEnabled()) {
|
||||
return false;
|
||||
}
|
||||
*result = true;
|
||||
return true;
|
||||
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
|
||||
if (_hitMaximizeButton()) {
|
||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(),
|
||||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||
QGuiApplication::sendEvent(_maximizeButton, &event);
|
||||
_setMaximizePressed(true);
|
||||
return true;
|
||||
}
|
||||
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP)) {
|
||||
if (_hitMaximizeButton()) {
|
||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(),
|
||||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||
QGuiApplication::sendEvent(_maximizeButton, &event);
|
||||
_setMaximizePressed(false);
|
||||
return true;
|
||||
@ -300,7 +723,8 @@ void FluFrameless::_showSystemMenu(QPoint point) {
|
||||
return;
|
||||
}
|
||||
const QPoint origin = screen->geometry().topLeft();
|
||||
auto nativePos = QPointF(QPointF(point - origin) * window()->devicePixelRatio()).toPoint() + origin;
|
||||
auto nativePos =
|
||||
QPointF(QPointF(point - origin) * window()->devicePixelRatio()).toPoint() + origin;
|
||||
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
||||
auto hMenu = ::GetSystemMenu(hwnd, FALSE);
|
||||
if (_isMaximized() || _isFullScreen()) {
|
||||
@ -317,8 +741,10 @@ void FluFrameless::_showSystemMenu(QPoint point) {
|
||||
::EnableMenuItem(hMenu, SC_SIZE, MFS_DISABLED);
|
||||
::EnableMenuItem(hMenu, SC_MAXIMIZE, MFS_DISABLED);
|
||||
}
|
||||
const int result = ::TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)), nativePos.x(),
|
||||
nativePos.y(), 0, hwnd, nullptr);
|
||||
const int result = ::TrackPopupMenu(
|
||||
hMenu,
|
||||
(TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)),
|
||||
nativePos.x(), nativePos.y(), 0, hwnd, nullptr);
|
||||
if (result) {
|
||||
::PostMessageW(hwnd, WM_SYSCOMMAND, result, 0);
|
||||
}
|
||||
@ -359,27 +785,27 @@ void FluFrameless::_setMaximizeHovered(bool val) {
|
||||
|
||||
void FluFrameless::_updateCursor(int edges) {
|
||||
switch (edges) {
|
||||
case 0:
|
||||
window()->setCursor(Qt::ArrowCursor);
|
||||
break;
|
||||
case Qt::LeftEdge:
|
||||
case Qt::RightEdge:
|
||||
window()->setCursor(Qt::SizeHorCursor);
|
||||
break;
|
||||
case Qt::TopEdge:
|
||||
case Qt::BottomEdge:
|
||||
window()->setCursor(Qt::SizeVerCursor);
|
||||
break;
|
||||
case Qt::LeftEdge | Qt::TopEdge:
|
||||
case Qt::RightEdge | Qt::BottomEdge:
|
||||
window()->setCursor(Qt::SizeFDiagCursor);
|
||||
break;
|
||||
case Qt::RightEdge | Qt::TopEdge:
|
||||
case Qt::LeftEdge | Qt::BottomEdge:
|
||||
window()->setCursor(Qt::SizeBDiagCursor);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 0:
|
||||
window()->setCursor(Qt::ArrowCursor);
|
||||
break;
|
||||
case Qt::LeftEdge:
|
||||
case Qt::RightEdge:
|
||||
window()->setCursor(Qt::SizeHorCursor);
|
||||
break;
|
||||
case Qt::TopEdge:
|
||||
case Qt::BottomEdge:
|
||||
window()->setCursor(Qt::SizeVerCursor);
|
||||
break;
|
||||
case Qt::LeftEdge | Qt::TopEdge:
|
||||
case Qt::RightEdge | Qt::BottomEdge:
|
||||
window()->setCursor(Qt::SizeFDiagCursor);
|
||||
break;
|
||||
case Qt::RightEdge | Qt::TopEdge:
|
||||
case Qt::LeftEdge | Qt::BottomEdge:
|
||||
window()->setCursor(Qt::SizeBDiagCursor);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -424,79 +850,80 @@ void FluFrameless::_setWindowTopmost(bool topmost) {
|
||||
::SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
#else
|
||||
window()->setFlag(Qt::WindowStaysOnTopHint,topmost);
|
||||
window()->setFlag(Qt::WindowStaysOnTopHint, topmost);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool FluFrameless::eventFilter(QObject *obj, QEvent *ev) {
|
||||
#ifndef Q_OS_WIN
|
||||
switch (ev->type()) {
|
||||
case QEvent::MouseButtonPress:
|
||||
if(_edges!=0){
|
||||
QMouseEvent *event = static_cast<QMouseEvent*>(ev);
|
||||
if(event->button() == Qt::LeftButton){
|
||||
_updateCursor(_edges);
|
||||
window()->startSystemResize(Qt::Edges(_edges));
|
||||
}
|
||||
}else{
|
||||
if(_hitAppBar()){
|
||||
qint64 clickTimer = QDateTime::currentMSecsSinceEpoch();
|
||||
qint64 offset = clickTimer - this->_clickTimer;
|
||||
this->_clickTimer = clickTimer;
|
||||
if(offset<300){
|
||||
if(_isMaximized()){
|
||||
showNormal();
|
||||
}else{
|
||||
showMaximized();
|
||||
case QEvent::MouseButtonPress:
|
||||
if (_edges != 0) {
|
||||
QMouseEvent *event = static_cast<QMouseEvent *>(ev);
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
_updateCursor(_edges);
|
||||
window()->startSystemResize(Qt::Edges(_edges));
|
||||
}
|
||||
} else {
|
||||
if (_hitAppBar()) {
|
||||
qint64 clickTimer = QDateTime::currentMSecsSinceEpoch();
|
||||
qint64 offset = clickTimer - this->_clickTimer;
|
||||
this->_clickTimer = clickTimer;
|
||||
if (offset < 300) {
|
||||
if (_isMaximized()) {
|
||||
showNormal();
|
||||
} else {
|
||||
showMaximized();
|
||||
}
|
||||
} else {
|
||||
window()->startSystemMove();
|
||||
}
|
||||
}else{
|
||||
window()->startSystemMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QEvent::MouseButtonRelease:
|
||||
_edges = 0;
|
||||
break;
|
||||
case QEvent::MouseMove: {
|
||||
if(_isMaximized() || _isFullScreen()){
|
||||
break;
|
||||
}
|
||||
if(_fixSize){
|
||||
case QEvent::MouseButtonRelease:
|
||||
_edges = 0;
|
||||
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);
|
||||
case QEvent::MouseMove: {
|
||||
if (_isMaximized() || _isFullScreen()) {
|
||||
break;
|
||||
}
|
||||
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;
|
||||
}
|
||||
_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;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return QObject::eventFilter(obj, ev);
|
||||
|
@ -6,6 +6,102 @@
|
||||
#include <QQmlProperty>
|
||||
#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))
|
||||
using QT_NATIVE_EVENT_RESULT_TYPE = qintptr;
|
||||
using QT_ENTER_EVENT_TYPE = QEnterEvent;
|
||||
@ -23,6 +119,11 @@ class FluFrameless : public QQuickItem, QAbstractNativeEventFilter {
|
||||
Q_PROPERTY_AUTO(bool, topmost)
|
||||
Q_PROPERTY_AUTO(bool, disabled)
|
||||
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)
|
||||
public:
|
||||
explicit FluFrameless(QQuickItem *parent = nullptr);
|
||||
@ -68,6 +169,7 @@ private:
|
||||
|
||||
void _setMaximizeHovered(bool val);
|
||||
|
||||
|
||||
private:
|
||||
quint64 _current = 0;
|
||||
int _edges = 0;
|
||||
@ -75,4 +177,5 @@ private:
|
||||
quint64 _clickTimer = 0;
|
||||
bool _isWindows11OrGreater = false;
|
||||
QList<QPointer<QQuickItem>> _hitTestList;
|
||||
QString _currentEffect;
|
||||
};
|
||||
|
@ -282,7 +282,22 @@ QString FluTools::getWallpaperFilePath() {
|
||||
auto path = result.mid(startIndex + 7, result.length() - startIndex - 8);
|
||||
return path;
|
||||
}
|
||||
} else if (type == "ubuntu") {
|
||||
QProcess process;
|
||||
QStringList args;
|
||||
args << "get";
|
||||
args << "org.gnome.desktop.background";
|
||||
args << "picture-uri";
|
||||
process.start("gsettings", args);
|
||||
process.waitForFinished();
|
||||
QByteArray result = process.readAllStandardOutput().trimmed();
|
||||
result = result.mid(1, result.length() - 2);
|
||||
if (result.startsWith("file:///")) {
|
||||
auto path = result.mid(7);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
#elif defined(Q_OS_MACOS)
|
||||
QProcess process;
|
||||
QStringList args;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "FluTreeModel.h"
|
||||
#include "FluTreeModel.h"
|
||||
|
||||
#include <QMetaEnum>
|
||||
|
||||
@ -107,7 +107,7 @@ void FluTreeModel::checkRow(int row, bool checked) {
|
||||
void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) {
|
||||
_dataSource.clear();
|
||||
if (_root) {
|
||||
delete _root;
|
||||
_root->deleteLater();
|
||||
_root = nullptr;
|
||||
}
|
||||
_root = new FluTreeNode(this);
|
||||
@ -115,7 +115,7 @@ void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) {
|
||||
while (data.count() > 0) {
|
||||
auto item = data.at(data.count() - 1);
|
||||
data.pop_back();
|
||||
auto *node = new FluTreeNode(this);
|
||||
auto *node = new FluTreeNode(_root);
|
||||
node->_depth = item.value("__depth").toInt();
|
||||
node->_parent = item.value("__parent").value<FluTreeNode *>();
|
||||
node->_data = item;
|
||||
@ -126,6 +126,7 @@ void FluTreeModel::setDataSource(QList<QMap<QString, QVariant>> data) {
|
||||
node->_parent = _root;
|
||||
_root->_children.append(node);
|
||||
}
|
||||
node->_checked = item.value("checked").toBool();
|
||||
_dataSource.append(node);
|
||||
if (item.contains("children")) {
|
||||
QList<QVariant> children = item.value("children").toList();
|
||||
|
@ -23,12 +23,14 @@
|
||||
#include "qmlcustomplot/ticker.h"
|
||||
#include "qmlcustomplot/grid.h"
|
||||
|
||||
const char* FluentUI::_uri = "FluentUI";
|
||||
|
||||
void FluentUI::registerTypes(QQmlEngine *engine) {
|
||||
initializeEngine(engine, _uri);
|
||||
registerTypes(_uri);
|
||||
}
|
||||
|
||||
void FluentUI::registerTypes(const char *uri) const {
|
||||
void FluentUI::registerTypes(const char *uri) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0))
|
||||
Q_INIT_RESOURCE(fluentui);
|
||||
int major = _major;
|
||||
@ -162,31 +164,41 @@ void FluentUI::registerTypes(const char *uri) const {
|
||||
qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only");
|
||||
qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only");
|
||||
|
||||
qmlRegisterSingletonType(uri, major, minor, "FluApp", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
|
||||
Q_UNUSED(engine)
|
||||
return scriptEngine->newQObject(FluApp::getInstance());
|
||||
});
|
||||
qmlRegisterSingletonType(uri, major, minor, "FluColors", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
|
||||
Q_UNUSED(engine)
|
||||
return scriptEngine->newQObject(FluColors::getInstance());
|
||||
});
|
||||
qmlRegisterSingletonType(uri, major, minor, "FluTheme", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
|
||||
Q_UNUSED(engine)
|
||||
return scriptEngine->newQObject(FluTheme::getInstance());
|
||||
});
|
||||
qmlRegisterSingletonType(uri, major, minor, "FluTools", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
|
||||
Q_UNUSED(engine)
|
||||
return scriptEngine->newQObject(FluTools::getInstance());
|
||||
});
|
||||
qmlRegisterSingletonType(uri, major, minor, "FluTextStyle", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
|
||||
Q_UNUSED(engine)
|
||||
return scriptEngine->newQObject(FluTextStyle::getInstance());
|
||||
});
|
||||
// qmlRegisterSingletonInstance(uri, major, minor, "FluApp", FluApp::getInstance());
|
||||
// qmlRegisterSingletonInstance(uri, major, minor, "FluColors", FluColors::getInstance());
|
||||
// qmlRegisterSingletonInstance(uri, major, minor, "FluTheme", FluTheme::getInstance());
|
||||
// qmlRegisterSingletonInstance(uri, major, minor, "FluTools", FluTools::getInstance());
|
||||
// qmlRegisterSingletonInstance(uri, major, minor, "FluTextStyle", FluTextStyle::getInstance());
|
||||
qmlRegisterSingletonType<FluApp>(uri, major, minor, "FluApp",
|
||||
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
|
||||
Q_UNUSED(scriptEngine)
|
||||
QObject *instance = FluApp::getInstance();
|
||||
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
|
||||
return instance;
|
||||
});
|
||||
qmlRegisterSingletonType<FluColors>(uri, major, minor, "FluColors",
|
||||
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
|
||||
Q_UNUSED(scriptEngine)
|
||||
QObject *instance = FluColors::getInstance();
|
||||
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
|
||||
return instance;
|
||||
});
|
||||
qmlRegisterSingletonType<FluTheme>(uri, major, minor, "FluTheme",
|
||||
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
|
||||
Q_UNUSED(scriptEngine)
|
||||
QObject *instance = FluTheme::getInstance();
|
||||
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
|
||||
return instance;
|
||||
});
|
||||
qmlRegisterSingletonType<FluTools>(uri, major, minor, "FluTools",
|
||||
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
|
||||
Q_UNUSED(scriptEngine)
|
||||
QObject *instance = FluTools::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);
|
||||
#endif
|
||||
}
|
||||
|
@ -2,25 +2,22 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlEngine>
|
||||
#include "singleton.h"
|
||||
|
||||
/**
|
||||
* @brief The FluentUI class
|
||||
*/
|
||||
class FluentUI : public QObject {
|
||||
Q_OBJECT
|
||||
class FluentUI{
|
||||
|
||||
public:
|
||||
SINGLETON(FluentUI)
|
||||
|
||||
Q_DECL_EXPORT void registerTypes(QQmlEngine *engine);
|
||||
static Q_DECL_EXPORT void registerTypes(QQmlEngine *engine);
|
||||
|
||||
void registerTypes(const char *uri) const;
|
||||
static void registerTypes(const char *uri);
|
||||
|
||||
void initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri);
|
||||
static void initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri);
|
||||
|
||||
private:
|
||||
const int _major = 1;
|
||||
const int _minor = 0;
|
||||
const char *_uri = "FluentUI";
|
||||
static const int _major = 1;
|
||||
static const int _minor = 0;
|
||||
static const char *_uri;
|
||||
};
|
||||
|
@ -73,7 +73,7 @@ Rectangle{
|
||||
text:{
|
||||
if(count<100)
|
||||
return count
|
||||
return count+"+"
|
||||
return "100+"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
property bool autoPlay: true
|
||||
property int orientation: Qt.Horizontal
|
||||
property int loopTime: 2000
|
||||
property var model
|
||||
property Component delegate
|
||||
@ -14,7 +15,7 @@ Item {
|
||||
property int indicatorMarginTop: 0
|
||||
property int indicatorMarginBottom: 20
|
||||
property int indicatorSpacing: 10
|
||||
property alias indicatorAnchors: layout_indicator.anchors
|
||||
property alias indicatorAnchors: indicator_loader.anchors
|
||||
property Component indicatorDelegate : com_indicator
|
||||
id:control
|
||||
width: 400
|
||||
@ -24,13 +25,24 @@ Item {
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
property bool flagXChanged: true
|
||||
property bool isManualMoving: false
|
||||
property bool isAnimEnable: control.autoPlay && list_view.count>3
|
||||
onIsAnimEnableChanged: {
|
||||
if(isAnimEnable){
|
||||
timer_run.restart()
|
||||
}else{
|
||||
timer_run.stop()
|
||||
}
|
||||
}
|
||||
function setData(data){
|
||||
if(!data){
|
||||
if(!data || !Array.isArray(data)){
|
||||
return
|
||||
}
|
||||
content_model.clear()
|
||||
list_view.resetPos()
|
||||
if(data.length === 0){
|
||||
return
|
||||
}
|
||||
content_model.append(data[data.length-1])
|
||||
content_model.append(data)
|
||||
content_model.append(data[0])
|
||||
@ -49,7 +61,7 @@ Item {
|
||||
clip: true
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
model:content_model
|
||||
maximumFlickVelocity: 4 * (list_view.orientation === Qt.Horizontal ? width : height)
|
||||
maximumFlickVelocity: 4 * (control.orientation === Qt.Vertical ? height : width)
|
||||
preferredHighlightBegin: 0
|
||||
preferredHighlightEnd: 0
|
||||
highlightMoveDuration: 0
|
||||
@ -63,7 +75,7 @@ Item {
|
||||
d.setData(control.model)
|
||||
}
|
||||
}
|
||||
orientation : ListView.Horizontal
|
||||
orientation : control.orientation
|
||||
delegate: Item{
|
||||
id:item_control
|
||||
width: ListView.view.width
|
||||
@ -88,31 +100,63 @@ Item {
|
||||
}
|
||||
}
|
||||
onMovementEnded:{
|
||||
currentIndex = list_view.contentX/list_view.width
|
||||
if(currentIndex === 0){
|
||||
currentIndex = list_view.count-2
|
||||
}else if(currentIndex === list_view.count-1){
|
||||
currentIndex = 1
|
||||
d.isManualMoving = false
|
||||
list_view.highlightMoveDuration = 0
|
||||
if(control.orientation === Qt.Vertical){
|
||||
currentIndex = (list_view.contentY - list_view.originY) / list_view.height
|
||||
if(currentIndex === 0){
|
||||
currentIndex = list_view.count - 2
|
||||
}else if(currentIndex === list_view.count - 1) {
|
||||
currentIndex = 1
|
||||
}
|
||||
} else {
|
||||
currentIndex = (list_view.contentX - list_view.originX) / list_view.width
|
||||
if(currentIndex === 0){
|
||||
currentIndex = list_view.count - 2
|
||||
}else if(currentIndex === list_view.count - 1){
|
||||
currentIndex = 1
|
||||
}
|
||||
}
|
||||
if(d.isAnimEnable){
|
||||
timer_run.restart()
|
||||
}
|
||||
d.flagXChanged = false
|
||||
timer_run.restart()
|
||||
}
|
||||
onMovementStarted: {
|
||||
d.flagXChanged = true
|
||||
d.isManualMoving = true
|
||||
timer_run.stop()
|
||||
}
|
||||
onContentXChanged: {
|
||||
if(d.flagXChanged){
|
||||
var maxX = Math.min(list_view.width*(currentIndex+1),list_view.count*list_view.width)
|
||||
var minY = Math.max(0,(list_view.width*(currentIndex-1)))
|
||||
if(contentX>=maxX){
|
||||
contentX = maxX
|
||||
if(d.isManualMoving && control.orientation === Qt.Horizontal){
|
||||
const range = getPosRange(list_view.width, currentIndex)
|
||||
if(contentX >= range.max){
|
||||
contentX = range.max
|
||||
}
|
||||
if(contentX<=minY){
|
||||
contentX = minY
|
||||
if(contentX <= range.min){
|
||||
contentX = range.min
|
||||
}
|
||||
}
|
||||
}
|
||||
onContentYChanged: {
|
||||
if(d.isManualMoving && control.orientation === Qt.Vertical){
|
||||
const range = getPosRange(list_view.height, currentIndex)
|
||||
if(contentY >= range.max){
|
||||
contentY = range.max
|
||||
}
|
||||
if(contentY <= range.min){
|
||||
contentY = range.min
|
||||
}
|
||||
}
|
||||
}
|
||||
function resetPos() {
|
||||
contentX = 0
|
||||
contentY = 0
|
||||
}
|
||||
function getPosRange(size, index) {
|
||||
return {
|
||||
"min": Math.max(0, size * (index - 1)),
|
||||
"max": Math.min(size * (index + 1), list_view.count * size)
|
||||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_indicator
|
||||
@ -137,9 +181,9 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
Row{
|
||||
id:layout_indicator
|
||||
spacing: control.indicatorSpacing
|
||||
|
||||
Loader{
|
||||
id: indicator_loader
|
||||
anchors{
|
||||
horizontalCenter:(indicatorGravity & Qt.AlignHCenter) ? parent.horizontalCenter : undefined
|
||||
verticalCenter: (indicatorGravity & Qt.AlignVCenter) ? parent.verticalCenter : undefined
|
||||
@ -152,28 +196,66 @@ Item {
|
||||
rightMargin: control.indicatorMarginBottom
|
||||
topMargin: control.indicatorMarginBottom
|
||||
}
|
||||
visible: showIndicator
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
if(index === list_view.count-1)
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
property int realIndex: index
|
||||
property bool checked: list_view.currentIndex === index
|
||||
sourceComponent: {
|
||||
if(index===0 || index===list_view.count-1)
|
||||
return undefined
|
||||
return control.indicatorDelegate
|
||||
active: showIndicator
|
||||
sourceComponent: control.orientation === Qt.Vertical ? column_indicator : row_indicator
|
||||
}
|
||||
|
||||
Component{
|
||||
id: row_indicator
|
||||
Row{
|
||||
id:layout_indicator
|
||||
spacing: control.indicatorSpacing
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
if(index === list_view.count-1)
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
property int realIndex: index
|
||||
property bool checked: list_view.currentIndex === index
|
||||
sourceComponent: {
|
||||
if(index===0 || index===list_view.count-1)
|
||||
return undefined
|
||||
return control.indicatorDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id: column_indicator
|
||||
Column{
|
||||
id:layout_indicator
|
||||
spacing: control.indicatorSpacing
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
if(index === list_view.count-1)
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
property int realIndex: index
|
||||
property bool checked: list_view.currentIndex === index
|
||||
sourceComponent: {
|
||||
if(index===0 || index===list_view.count-1)
|
||||
return undefined
|
||||
return control.indicatorDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer{
|
||||
id:timer_anim
|
||||
interval: 250
|
||||
@ -195,10 +277,10 @@ Item {
|
||||
}
|
||||
}
|
||||
function changedIndex(index){
|
||||
d.flagXChanged = true
|
||||
d.isManualMoving = true
|
||||
timer_run.stop()
|
||||
list_view.currentIndex = index
|
||||
d.flagXChanged = false
|
||||
d.isManualMoving = false
|
||||
if(d.isAnimEnable){
|
||||
timer_run.restart()
|
||||
}
|
||||
|
@ -15,7 +15,9 @@ Canvas {
|
||||
function animateToNewData()
|
||||
{
|
||||
chartAnimationProgress = 0.1;
|
||||
d.jsChart.update();
|
||||
if (d.jsChart) {
|
||||
d.jsChart.update();
|
||||
}
|
||||
chartAnimator.restart();
|
||||
}
|
||||
QtObject{
|
||||
|
@ -19,7 +19,19 @@ Button {
|
||||
property color checkedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
||||
property real size: 18
|
||||
property alias textColor: btn_text.textColor
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property bool textRight: true
|
||||
property real textSpacing: 6
|
||||
property bool animationEnabled: FluTheme.animationEnabled
|
||||
@ -127,6 +139,7 @@ Button {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
visible: text !== ""
|
||||
font: control.font
|
||||
color: control.textColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,17 @@ Button{
|
||||
implicitWidth: 326
|
||||
implicitHeight: 560
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
onClosed: {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
}
|
||||
onOpened: {
|
||||
layout_color_hue.updateColorText(current);
|
||||
text_box_color.textEdited();
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_actions
|
||||
width: parent.width
|
||||
@ -148,7 +159,9 @@ Button{
|
||||
if(color.a===1){
|
||||
colorString = "FF"+colorString
|
||||
}
|
||||
text_box_color.text = colorString.toUpperCase()
|
||||
if (!text_box_color.activeFocus) {
|
||||
text_box_color.text = colorString.toUpperCase();
|
||||
}
|
||||
}
|
||||
property color blackColor: {
|
||||
var c = whiteColor
|
||||
@ -279,6 +292,11 @@ Button{
|
||||
preventStealing: true
|
||||
function handleMouse(mouse) {
|
||||
if (mouse.buttons & Qt.LeftButton) {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
pickerCursor.x = Math.max(0,Math.min(mouse.x - colorHandleRadius,width-2*colorHandleRadius));
|
||||
pickerCursor.y = Math.max(0,Math.min(mouse.y - colorHandleRadius,height-2*colorHandleRadius));
|
||||
}
|
||||
@ -369,6 +387,11 @@ Button{
|
||||
preventStealing: true
|
||||
function handleMouse(mouse) {
|
||||
if (mouse.buttons & Qt.LeftButton) {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
blackCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
|
||||
blackCursor.y = 0
|
||||
}
|
||||
@ -438,6 +461,11 @@ Button{
|
||||
preventStealing: true
|
||||
function handleMouse(mouse) {
|
||||
if (mouse.buttons & Qt.LeftButton) {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
opacityCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
|
||||
opacityCursor.y = 0
|
||||
}
|
||||
@ -472,7 +500,7 @@ Button{
|
||||
id:text_box_color
|
||||
width: 136
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: /^[0-9A-F]{8}$/
|
||||
regularExpression: /^[0-9A-Fa-f]{8}$/
|
||||
}
|
||||
anchors{
|
||||
right: parent.right
|
||||
@ -495,6 +523,11 @@ Button{
|
||||
parseInt(colorString.substring(6, 8), 16) / 255,
|
||||
parseInt(colorString.substring(0, 2), 16) / 255)
|
||||
layout_color_hue.colorValue = c
|
||||
layout_color_hue.updateColorText(c);
|
||||
text_box_r.textEdited();
|
||||
text_box_g.textEdited();
|
||||
text_box_b.textEdited();
|
||||
text_box_a.textEdited();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ T.ComboBox {
|
||||
y: control.height
|
||||
width: control.width
|
||||
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
|
||||
topMargin: 6
|
||||
topMargin: 32
|
||||
bottomMargin: 6
|
||||
modal: true
|
||||
contentItem: ListView {
|
||||
|
@ -41,7 +41,7 @@ FluPopup {
|
||||
FluText{
|
||||
id:text_message
|
||||
font: FluTextStyle.Body
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
text:message
|
||||
width: parent.width
|
||||
topPadding: 4
|
||||
@ -67,7 +67,7 @@ FluPopup {
|
||||
topPadding: 20
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
FluLoader{
|
||||
sourceComponent: com_message
|
||||
|
@ -3,7 +3,19 @@ import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
TextEdit {
|
||||
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
id:control
|
||||
color: textColor
|
||||
readOnly: true
|
||||
|
@ -5,6 +5,8 @@ import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
property string headerText: ""
|
||||
property int headerHeight : 45
|
||||
property Component headerDelegate: com_header
|
||||
property bool expand: false
|
||||
property int contentHeight : 300
|
||||
default property alias content: container.data
|
||||
@ -21,10 +23,23 @@ Item {
|
||||
}
|
||||
}
|
||||
clip: true
|
||||
Component {
|
||||
id: com_header
|
||||
Item {
|
||||
FluText {
|
||||
text: control.headerText
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 15
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_header
|
||||
width: parent.width
|
||||
height: 45
|
||||
height: control.headerHeight
|
||||
radius: 4
|
||||
border.color: FluTheme.dividerColor
|
||||
color: {
|
||||
@ -41,15 +56,17 @@ Item {
|
||||
d.toggle()
|
||||
}
|
||||
}
|
||||
FluText{
|
||||
text: headerText
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
FluLoader {
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
leftMargin: 15
|
||||
right: btn_toggle.left
|
||||
}
|
||||
sourceComponent: control.headerDelegate
|
||||
}
|
||||
FluIconButton{
|
||||
id: btn_toggle
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
|
@ -5,7 +5,19 @@ import FluentUI 1.0
|
||||
Text {
|
||||
property int iconSource
|
||||
property int iconSize: 20
|
||||
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
||||
property color iconColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
id:control
|
||||
font.family: font_loader.name
|
||||
font.pixelSize: iconSize
|
||||
|
@ -37,7 +37,19 @@ Button {
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property color textColor: FluTheme.fontPrimaryColor
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: control.text
|
||||
Accessible.description: contentDescription
|
||||
|
@ -190,13 +190,13 @@ FluObject {
|
||||
spacing: 5
|
||||
FluText{
|
||||
text:_super.text
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
width: Math.min(implicitWidth,mcontrol.maxWidth)
|
||||
}
|
||||
FluText{
|
||||
text: _super.moremsg
|
||||
visible: _super.moremsg
|
||||
wrapMode : Text.WrapAnywhere
|
||||
wrapMode : Text.WordWrap
|
||||
textColor: FluColors.Grey120
|
||||
width: Math.min(implicitWidth,mcontrol.maxWidth)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ TextArea{
|
||||
return normalColor
|
||||
}
|
||||
font:FluTextStyle.Body
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
padding: 8
|
||||
leftPadding: padding+4
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
|
@ -1313,7 +1313,7 @@ Item {
|
||||
d.stackItems = d.stackItems.concat(nav_list.model[nav_list.currentIndex])
|
||||
}
|
||||
function noStackPush(){
|
||||
if(loader_content.source.toString() === url){
|
||||
if(loader_content.source.toString() === url && Object.keys(argument).length === 0){
|
||||
return
|
||||
}
|
||||
loader_content.setSource(url,argument)
|
||||
|
@ -5,8 +5,9 @@ import FluentUI 1.0
|
||||
Page {
|
||||
default property alias content: d.children
|
||||
property alias currentIndex: nav_list.currentIndex
|
||||
property color textHighlightColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
|
||||
property color textNormalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120
|
||||
property color textHoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
|
||||
property color textHoverColor: FluTheme.dark ? FluColors.Grey80 : FluColors.Grey150
|
||||
property int textSpacing: 10
|
||||
property int headerSpacing: 20
|
||||
property int headerHeight: 40
|
||||
@ -30,21 +31,15 @@ Page {
|
||||
interactive: false
|
||||
orientation: ListView.Horizontal
|
||||
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
|
||||
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
|
||||
highlight: Item{
|
||||
clip: true
|
||||
Rectangle{
|
||||
height: 3
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor
|
||||
width: nav_list.currentItem ? nav_list.currentItem.width : 0
|
||||
width: nav_list.currentItem.width
|
||||
y:d.tabY
|
||||
Behavior on width {
|
||||
enabled: FluTheme.animationEnabled
|
||||
NumberAnimation{
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
delegate: Button{
|
||||
@ -66,9 +61,13 @@ Page {
|
||||
anchors.centerIn: parent
|
||||
font: control.font
|
||||
color: {
|
||||
if(item_button.hovered)
|
||||
return textHoverColor
|
||||
return textNormalColor
|
||||
if(nav_list.currentIndex === index) {
|
||||
return textHighlightColor;
|
||||
}
|
||||
if (item_button.hovered) {
|
||||
return textHoverColor;
|
||||
}
|
||||
return textNormalColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,13 +14,6 @@ ProgressBar{
|
||||
id:d
|
||||
property real _radius: strokeWidth/2
|
||||
}
|
||||
onIndeterminateChanged:{
|
||||
if(!indeterminate){
|
||||
animator_x.duration = 0
|
||||
rect_progress.x = 0
|
||||
animator_x.duration = control.duration
|
||||
}
|
||||
}
|
||||
background: Rectangle {
|
||||
implicitWidth: 150
|
||||
implicitHeight: control.strokeWidth
|
||||
@ -41,13 +34,20 @@ ProgressBar{
|
||||
height: parent.height
|
||||
radius: d._radius
|
||||
color: control.color
|
||||
PropertyAnimation on x {
|
||||
id:animator_x
|
||||
SequentialAnimation on x {
|
||||
id: animator_x
|
||||
running: control.indeterminate && control.visible
|
||||
from: -rect_progress.width
|
||||
to:control.width+rect_progress.width
|
||||
loops: Animation.Infinite
|
||||
duration: control.duration
|
||||
onRunningChanged: {
|
||||
if(!running){
|
||||
rect_progress.x = 0
|
||||
}
|
||||
}
|
||||
PropertyAnimation {
|
||||
from: -rect_progress.width
|
||||
to: control.width + rect_progress.width
|
||||
duration: control.duration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,19 @@ Button {
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1)
|
||||
property color hoverColor: checked ? FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
|
||||
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(159/255,159/255,159/255,1) : Qt.rgba(159/255,159/255,159/255,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
|
||||
property alias textColor: btn_text.textColor
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property real size: 18
|
||||
property bool textRight: true
|
||||
property real textSpacing: 6
|
||||
@ -94,6 +106,7 @@ Button {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
visible: text !== ""
|
||||
font: control.font
|
||||
color: control.textColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,11 @@ import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
FluPage {
|
||||
property bool autoResetScroll: false
|
||||
default property alias content: container.data
|
||||
|
||||
Flickable{
|
||||
id: flickable
|
||||
clip: true
|
||||
anchors.fill: parent
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
@ -17,4 +20,14 @@ FluPage {
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
function resetScroll() {
|
||||
flickable.contentY = 0;
|
||||
}
|
||||
|
||||
StackView.onActivated: {
|
||||
if (autoResetScroll) {
|
||||
resetScroll(); // Call this function to reset the scroll position to the top
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
||||
Text {
|
||||
property color textColor: FluTheme.fontPrimaryColor
|
||||
id:text
|
||||
color: textColor
|
||||
color: enabled ? textColor : (FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1))
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
font: FluTextStyle.Body
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ FluButton {
|
||||
if (hours === "12") {
|
||||
hours24 = (period === control.amText) ? 0 : 12;
|
||||
} else {
|
||||
hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
|
||||
hours24 = (period === control.pmText) ? hours24 + 12 : hours24;
|
||||
}
|
||||
}
|
||||
date.setHours(hours24);
|
||||
|
@ -98,7 +98,7 @@ Item{
|
||||
Component{
|
||||
id:com_lable
|
||||
FluText{
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
||||
text: {
|
||||
if(modelData.lable){
|
||||
@ -113,7 +113,7 @@ Item{
|
||||
Component{
|
||||
id:com_text
|
||||
FluText{
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
||||
text: modelData.text
|
||||
textFormat: Text.RichText
|
||||
|
@ -18,7 +18,19 @@ Button {
|
||||
property color dotDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(150/255,150/255,150/255,1)
|
||||
property real textSpacing: 6
|
||||
property bool textRight: true
|
||||
property alias textColor: btn_text.textColor
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property var clickListener : function(){
|
||||
checked = !checked
|
||||
}
|
||||
@ -115,6 +127,7 @@ Button {
|
||||
text: control.text
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
visible: text !== ""
|
||||
color: control.textColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ Popup{
|
||||
FluText{
|
||||
id: text_desc
|
||||
font: FluTextStyle.Body
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: 4
|
||||
elide: Text.ElideRight
|
||||
text: {
|
||||
|
@ -474,6 +474,7 @@ Rectangle {
|
||||
}
|
||||
return {}
|
||||
}
|
||||
active: rowModel !== undefined && rowModel !== null
|
||||
sourceComponent: {
|
||||
if(column === 0)
|
||||
return com_column
|
||||
|
@ -13,6 +13,11 @@ Window {
|
||||
property bool fixSize: false
|
||||
property Component loadingItem: com_loading
|
||||
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 {
|
||||
title: window.title
|
||||
height: 30
|
||||
@ -24,6 +29,15 @@ Window {
|
||||
icon: window.windowIcon
|
||||
}
|
||||
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){
|
||||
return FluTheme.windowActiveBackgroundColor
|
||||
}
|
||||
@ -100,6 +114,8 @@ Window {
|
||||
fixSize: window.fixSize
|
||||
topmost: window.stayTop
|
||||
disabled: FluApp.useSystemAppBar
|
||||
isDarkMode: FluTheme.dark
|
||||
useSystemEffect: !FluTheme.blurBehindWindowEnabled
|
||||
Component.onCompleted: {
|
||||
frameless.setHitTestVisible(appBar.layoutMacosButtons)
|
||||
frameless.setHitTestVisible(appBar.layoutStandardbuttons)
|
||||
@ -107,6 +123,11 @@ Window {
|
||||
Component.onDestruction: {
|
||||
frameless.onDestruction()
|
||||
}
|
||||
onEffectiveChanged: {
|
||||
if(effective){
|
||||
FluTheme.blurBehindWindowEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_background
|
||||
@ -162,8 +183,8 @@ Window {
|
||||
FluAcrylic{
|
||||
anchors.fill: parent
|
||||
target: img_back
|
||||
tintOpacity: FluTheme.dark ? 0.80 : 0.75
|
||||
blurRadius: 64
|
||||
tintOpacity: window.tintOpacity
|
||||
blurRadius: window.blurRadius
|
||||
visible: window.active && FluTheme.blurBehindWindowEnabled
|
||||
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)
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 473 B |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 389 B |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 559 B |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 437 B |
Before Width: | Height: | Size: 266 KiB After Width: | Height: | Size: 142 KiB |
@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
|
||||
// It is used for QML tooling purposes only.
|
||||
//
|
||||
// This file was auto-generated by:
|
||||
// 'qmlplugindump -nonrelocatable FluentUI 1.0 D:/QtProjects/build-FluentUI-Desktop_Qt_5_15_2_MSVC2019_64bit-Release/src'
|
||||
// 'qmlplugindump -nonrelocatable -noinstantiate FluentUI 1.0 E:/develop/QtCode/opensource/FluentUI/build/Desktop_Qt_5_15_2_MinGW_64_bit-Release/src'
|
||||
|
||||
Module {
|
||||
dependencies: ["QtQuick 2.0"]
|
||||
@ -150,6 +150,11 @@ Module {
|
||||
Property { name: "topmost"; type: "bool" }
|
||||
Property { name: "disabled"; 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: "showMaximized" }
|
||||
Method { name: "showMinimized" }
|
||||
@ -669,12 +674,12 @@ Module {
|
||||
}
|
||||
}
|
||||
Component {
|
||||
name: "Fluent_Icons"
|
||||
name: "FluentIcons"
|
||||
exports: ["FluentUI/FluentIcons 1.0"]
|
||||
isCreatable: false
|
||||
exportMetaObjectRevisions: [0]
|
||||
Enum {
|
||||
name: "Fluent_IconType"
|
||||
name: "Type"
|
||||
values: {
|
||||
"GlobalNavButton": 59136,
|
||||
"Wifi": 59137,
|
||||
@ -2449,6 +2454,240 @@ Module {
|
||||
Method { name: "clear" }
|
||||
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 {
|
||||
prototype: "QQuickItem"
|
||||
name: "FluentUI/FluAcrylic 1.0"
|
||||
@ -2507,37 +2746,37 @@ Module {
|
||||
Property { name: "darkClickListener"; type: "QVariant" }
|
||||
Property {
|
||||
name: "buttonStayTop"
|
||||
type: "FluIconButton_QMLTYPE_18"
|
||||
type: "FluIconButton_QMLTYPE_19"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
Property {
|
||||
name: "buttonMinimize"
|
||||
type: "FluIconButton_QMLTYPE_18"
|
||||
type: "FluIconButton_QMLTYPE_19"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
Property {
|
||||
name: "buttonMaximize"
|
||||
type: "FluIconButton_QMLTYPE_18"
|
||||
type: "FluIconButton_QMLTYPE_19"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
Property {
|
||||
name: "buttonClose"
|
||||
type: "FluIconButton_QMLTYPE_18"
|
||||
type: "FluIconButton_QMLTYPE_19"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
Property {
|
||||
name: "buttonDark"
|
||||
type: "FluIconButton_QMLTYPE_18"
|
||||
type: "FluIconButton_QMLTYPE_19"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
Property {
|
||||
name: "layoutMacosButtons"
|
||||
type: "FluLoader_QMLTYPE_16"
|
||||
type: "FluLoader_QMLTYPE_14"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
@ -2659,6 +2898,7 @@ Module {
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "autoPlay"; type: "bool" }
|
||||
Property { name: "orientation"; type: "int" }
|
||||
Property { name: "loopTime"; type: "int" }
|
||||
Property { name: "model"; type: "QVariant" }
|
||||
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
|
||||
@ -2716,12 +2956,12 @@ Module {
|
||||
Property { name: "checkedDisableColor"; type: "QColor" }
|
||||
Property { name: "disableColor"; type: "QColor" }
|
||||
Property { name: "size"; type: "double" }
|
||||
Property { name: "textColor"; type: "QColor" }
|
||||
Property { name: "textRight"; type: "bool" }
|
||||
Property { name: "textSpacing"; type: "double" }
|
||||
Property { name: "animationEnabled"; type: "bool" }
|
||||
Property { name: "clickListener"; type: "QVariant" }
|
||||
Property { name: "indeterminate"; type: "bool" }
|
||||
Property { name: "textColor"; type: "QColor" }
|
||||
}
|
||||
Component {
|
||||
prototype: "FluRectangle"
|
||||
@ -2950,6 +3190,8 @@ Module {
|
||||
isComposite: true
|
||||
defaultProperty: "content"
|
||||
Property { name: "headerText"; type: "string" }
|
||||
Property { name: "headerHeight"; type: "int" }
|
||||
Property { name: "headerDelegate"; type: "QQmlComponent"; isPointer: true }
|
||||
Property { name: "expand"; type: "bool" }
|
||||
Property { name: "contentHeight"; type: "int" }
|
||||
Property { name: "content"; type: "QObject"; isList: true; isReadonly: true }
|
||||
@ -3230,15 +3472,15 @@ Module {
|
||||
defaultProperty: "data"
|
||||
Property { name: "logo"; type: "QUrl" }
|
||||
Property { name: "title"; type: "string" }
|
||||
Property { name: "items"; type: "FluObject_QMLTYPE_164"; isPointer: true }
|
||||
Property { name: "footerItems"; type: "FluObject_QMLTYPE_164"; isPointer: true }
|
||||
Property { name: "items"; type: "FluObject_QMLTYPE_182"; isPointer: true }
|
||||
Property { name: "footerItems"; type: "FluObject_QMLTYPE_182"; isPointer: true }
|
||||
Property { name: "displayMode"; type: "int" }
|
||||
Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true }
|
||||
Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true }
|
||||
Property { name: "topPadding"; type: "int" }
|
||||
Property { name: "pageMode"; type: "int" }
|
||||
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
|
||||
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
|
||||
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_47"; isPointer: true }
|
||||
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_47"; isPointer: true }
|
||||
Property { name: "navCompactWidth"; type: "int" }
|
||||
Property { name: "navTopMargin"; type: "int" }
|
||||
Property { name: "cellHeight"; type: "int" }
|
||||
@ -3246,13 +3488,13 @@ Module {
|
||||
Property { name: "hideNavAppBar"; type: "bool" }
|
||||
Property {
|
||||
name: "buttonMenu"
|
||||
type: "FluIconButton_QMLTYPE_18"
|
||||
type: "FluIconButton_QMLTYPE_19"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
Property {
|
||||
name: "buttonBack"
|
||||
type: "FluIconButton_QMLTYPE_18"
|
||||
type: "FluIconButton_QMLTYPE_19"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
@ -3437,6 +3679,7 @@ Module {
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "content"
|
||||
Property { name: "textHighlightColor"; type: "QColor" }
|
||||
Property { name: "textNormalColor"; type: "QColor" }
|
||||
Property { name: "textHoverColor"; type: "QColor" }
|
||||
Property { name: "textSpacing"; type: "int" }
|
||||
@ -3533,11 +3776,11 @@ Module {
|
||||
Property { name: "normalColor"; type: "QColor" }
|
||||
Property { name: "hoverColor"; type: "QColor" }
|
||||
Property { name: "disableColor"; type: "QColor" }
|
||||
Property { name: "textColor"; type: "QColor" }
|
||||
Property { name: "size"; type: "double" }
|
||||
Property { name: "textRight"; type: "bool" }
|
||||
Property { name: "textSpacing"; type: "double" }
|
||||
Property { name: "clickListener"; type: "QVariant" }
|
||||
Property { name: "textColor"; type: "QColor" }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickItem"
|
||||
@ -3620,7 +3863,7 @@ Module {
|
||||
Method {
|
||||
name: "removeWindow"
|
||||
type: "QVariant"
|
||||
Parameter { name: "window"; type: "QVariant" }
|
||||
Parameter { name: "win"; type: "QVariant" }
|
||||
}
|
||||
Method {
|
||||
name: "exit"
|
||||
@ -3660,7 +3903,9 @@ Module {
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "content"
|
||||
Property { name: "autoResetScroll"; type: "bool" }
|
||||
Property { name: "content"; type: "QObject"; isList: true; isReadonly: true }
|
||||
Method { name: "resetScroll"; type: "QVariant" }
|
||||
Property { name: "launchMode"; type: "int" }
|
||||
Property { name: "animationEnabled"; type: "bool" }
|
||||
Property { name: "url"; type: "string" }
|
||||
@ -4055,8 +4300,8 @@ Module {
|
||||
Property { name: "dotDisableColor"; type: "QColor" }
|
||||
Property { name: "textSpacing"; type: "double" }
|
||||
Property { name: "textRight"; type: "bool" }
|
||||
Property { name: "clickListener"; type: "QVariant" }
|
||||
Property { name: "textColor"; type: "QColor" }
|
||||
Property { name: "clickListener"; type: "QVariant" }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickToolTip"
|
||||
@ -4138,6 +4383,8 @@ Module {
|
||||
Property { name: "fixSize"; type: "bool" }
|
||||
Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true }
|
||||
Property { name: "fitsAppBarWindows"; type: "bool" }
|
||||
Property { name: "tintOpacity"; type: "QVariant" }
|
||||
Property { name: "blurRadius"; type: "int" }
|
||||
Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
|
||||
Property { name: "backgroundColor"; type: "QColor" }
|
||||
Property { name: "stayTop"; type: "bool" }
|
||||
@ -4151,6 +4398,7 @@ Module {
|
||||
Property { name: "autoCenter"; type: "bool" }
|
||||
Property { name: "autoDestroy"; type: "bool" }
|
||||
Property { name: "useSystemAppBar"; type: "bool" }
|
||||
Property { name: "__margins"; type: "int" }
|
||||
Property { name: "resizeBorderColor"; type: "QColor" }
|
||||
Property { name: "resizeBorderWidth"; type: "int" }
|
||||
Property { name: "closeListener"; type: "QVariant" }
|
||||
@ -4158,6 +4406,9 @@ Module {
|
||||
Property { name: "_route"; type: "string" }
|
||||
Property { name: "_hideShadow"; type: "bool" }
|
||||
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
|
||||
Property { name: "effect"; type: "string" }
|
||||
Property { name: "effective"; type: "bool"; isReadonly: true }
|
||||
Property { name: "availableEffects"; type: "QStringList"; isReadonly: true }
|
||||
Signal {
|
||||
name: "initArgument"
|
||||
Parameter { name: "argument"; type: "QVariant" }
|
||||
@ -4195,11 +4446,6 @@ Module {
|
||||
Method { name: "clearAllInfo"; type: "QVariant" }
|
||||
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
|
||||
Method { name: "fixWindowSize"; type: "QVariant" }
|
||||
Method {
|
||||
name: "registerForWindowResult"
|
||||
type: "QVariant"
|
||||
Parameter { name: "path"; type: "QVariant" }
|
||||
}
|
||||
Method {
|
||||
name: "setResult"
|
||||
type: "QVariant"
|
||||
@ -4219,6 +4465,8 @@ Module {
|
||||
type: "QVariant"
|
||||
Parameter { name: "val"; type: "QVariant" }
|
||||
}
|
||||
Method { name: "deleteLater"; type: "QVariant" }
|
||||
Method { name: "containerItem"; type: "QVariant" }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickWindowQmlImpl"
|
||||
@ -4241,6 +4489,8 @@ Module {
|
||||
Property { name: "fixSize"; type: "bool" }
|
||||
Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true }
|
||||
Property { name: "fitsAppBarWindows"; type: "bool" }
|
||||
Property { name: "tintOpacity"; type: "QVariant" }
|
||||
Property { name: "blurRadius"; type: "int" }
|
||||
Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
|
||||
Property { name: "backgroundColor"; type: "QColor" }
|
||||
Property { name: "stayTop"; type: "bool" }
|
||||
@ -4254,6 +4504,7 @@ Module {
|
||||
Property { name: "autoCenter"; type: "bool" }
|
||||
Property { name: "autoDestroy"; type: "bool" }
|
||||
Property { name: "useSystemAppBar"; type: "bool" }
|
||||
Property { name: "__margins"; type: "int" }
|
||||
Property { name: "resizeBorderColor"; type: "QColor" }
|
||||
Property { name: "resizeBorderWidth"; type: "int" }
|
||||
Property { name: "closeListener"; type: "QVariant" }
|
||||
@ -4261,6 +4512,9 @@ Module {
|
||||
Property { name: "_route"; type: "string" }
|
||||
Property { name: "_hideShadow"; type: "bool" }
|
||||
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
|
||||
Property { name: "effect"; type: "string" }
|
||||
Property { name: "effective"; type: "bool"; isReadonly: true }
|
||||
Property { name: "availableEffects"; type: "QStringList"; isReadonly: true }
|
||||
Signal {
|
||||
name: "initArgument"
|
||||
Parameter { name: "argument"; type: "QVariant" }
|
||||
@ -4298,11 +4552,6 @@ Module {
|
||||
Method { name: "clearAllInfo"; type: "QVariant" }
|
||||
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
|
||||
Method { name: "fixWindowSize"; type: "QVariant" }
|
||||
Method {
|
||||
name: "registerForWindowResult"
|
||||
type: "QVariant"
|
||||
Parameter { name: "path"; type: "QVariant" }
|
||||
}
|
||||
Method {
|
||||
name: "setResult"
|
||||
type: "QVariant"
|
||||
@ -4322,6 +4571,8 @@ Module {
|
||||
type: "QVariant"
|
||||
Parameter { name: "val"; type: "QVariant" }
|
||||
}
|
||||
Method { name: "deleteLater"; type: "QVariant" }
|
||||
Method { name: "containerItem"; type: "QVariant" }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickItem"
|
||||
|
@ -73,7 +73,7 @@ Rectangle{
|
||||
text:{
|
||||
if(count<100)
|
||||
return count
|
||||
return count+"+"
|
||||
return "100+"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import FluentUI
|
||||
|
||||
Item {
|
||||
property bool autoPlay: true
|
||||
property int orientation: Qt.Horizontal
|
||||
property int loopTime: 2000
|
||||
property var model
|
||||
property Component delegate
|
||||
@ -14,7 +15,7 @@ Item {
|
||||
property int indicatorMarginTop: 0
|
||||
property int indicatorMarginBottom: 20
|
||||
property int indicatorSpacing: 10
|
||||
property alias indicatorAnchors: layout_indicator.anchors
|
||||
property alias indicatorAnchors: indicator_loader.anchors
|
||||
property Component indicatorDelegate : com_indicator
|
||||
id:control
|
||||
width: 400
|
||||
@ -24,13 +25,24 @@ Item {
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
property bool flagXChanged: true
|
||||
property bool isManualMoving: false
|
||||
property bool isAnimEnable: control.autoPlay && list_view.count>3
|
||||
onIsAnimEnableChanged: {
|
||||
if(isAnimEnable){
|
||||
timer_run.restart()
|
||||
}else{
|
||||
timer_run.stop()
|
||||
}
|
||||
}
|
||||
function setData(data){
|
||||
if(!data){
|
||||
if(!data || !Array.isArray(data)){
|
||||
return
|
||||
}
|
||||
content_model.clear()
|
||||
list_view.resetPos()
|
||||
if(data.length === 0){
|
||||
return
|
||||
}
|
||||
content_model.append(data[data.length-1])
|
||||
content_model.append(data)
|
||||
content_model.append(data[0])
|
||||
@ -49,7 +61,7 @@ Item {
|
||||
clip: true
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
model:content_model
|
||||
maximumFlickVelocity: 4 * (list_view.orientation === Qt.Horizontal ? width : height)
|
||||
maximumFlickVelocity: 4 * (control.orientation === Qt.Vertical ? height : width)
|
||||
preferredHighlightBegin: 0
|
||||
preferredHighlightEnd: 0
|
||||
highlightMoveDuration: 0
|
||||
@ -63,7 +75,7 @@ Item {
|
||||
d.setData(control.model)
|
||||
}
|
||||
}
|
||||
orientation : ListView.Horizontal
|
||||
orientation : control.orientation
|
||||
delegate: Item{
|
||||
id:item_control
|
||||
width: ListView.view.width
|
||||
@ -88,31 +100,63 @@ Item {
|
||||
}
|
||||
}
|
||||
onMovementEnded:{
|
||||
currentIndex = list_view.contentX/list_view.width
|
||||
if(currentIndex === 0){
|
||||
currentIndex = list_view.count-2
|
||||
}else if(currentIndex === list_view.count-1){
|
||||
currentIndex = 1
|
||||
d.isManualMoving = false
|
||||
list_view.highlightMoveDuration = 0
|
||||
if(control.orientation === Qt.Vertical){
|
||||
currentIndex = (list_view.contentY - list_view.originY) / list_view.height
|
||||
if(currentIndex === 0){
|
||||
currentIndex = list_view.count - 2
|
||||
}else if(currentIndex === list_view.count - 1) {
|
||||
currentIndex = 1
|
||||
}
|
||||
} else {
|
||||
currentIndex = (list_view.contentX - list_view.originX) / list_view.width
|
||||
if(currentIndex === 0){
|
||||
currentIndex = list_view.count - 2
|
||||
}else if(currentIndex === list_view.count - 1){
|
||||
currentIndex = 1
|
||||
}
|
||||
}
|
||||
if(d.isAnimEnable){
|
||||
timer_run.restart()
|
||||
}
|
||||
d.flagXChanged = false
|
||||
timer_run.restart()
|
||||
}
|
||||
onMovementStarted: {
|
||||
d.flagXChanged = true
|
||||
d.isManualMoving = true
|
||||
timer_run.stop()
|
||||
}
|
||||
onContentXChanged: {
|
||||
if(d.flagXChanged){
|
||||
var maxX = Math.min(list_view.width*(currentIndex+1),list_view.count*list_view.width)
|
||||
var minY = Math.max(0,(list_view.width*(currentIndex-1)))
|
||||
if(contentX>=maxX){
|
||||
contentX = maxX
|
||||
if(d.isManualMoving && control.orientation === Qt.Horizontal){
|
||||
const range = getPosRange(list_view.width, currentIndex)
|
||||
if(contentX >= range.max){
|
||||
contentX = range.max
|
||||
}
|
||||
if(contentX<=minY){
|
||||
contentX = minY
|
||||
if(contentX <= range.min){
|
||||
contentX = range.min
|
||||
}
|
||||
}
|
||||
}
|
||||
onContentYChanged: {
|
||||
if(d.isManualMoving && control.orientation === Qt.Vertical){
|
||||
const range = getPosRange(list_view.height, currentIndex)
|
||||
if(contentY >= range.max){
|
||||
contentY = range.max
|
||||
}
|
||||
if(contentY <= range.min){
|
||||
contentY = range.min
|
||||
}
|
||||
}
|
||||
}
|
||||
function resetPos() {
|
||||
contentX = 0
|
||||
contentY = 0
|
||||
}
|
||||
function getPosRange(size, index) {
|
||||
return {
|
||||
"min": Math.max(0, size * (index - 1)),
|
||||
"max": Math.min(size * (index + 1), list_view.count * size)
|
||||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_indicator
|
||||
@ -137,9 +181,9 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
Row{
|
||||
id:layout_indicator
|
||||
spacing: control.indicatorSpacing
|
||||
|
||||
Loader{
|
||||
id: indicator_loader
|
||||
anchors{
|
||||
horizontalCenter:(indicatorGravity & Qt.AlignHCenter) ? parent.horizontalCenter : undefined
|
||||
verticalCenter: (indicatorGravity & Qt.AlignVCenter) ? parent.verticalCenter : undefined
|
||||
@ -152,28 +196,66 @@ Item {
|
||||
rightMargin: control.indicatorMarginBottom
|
||||
topMargin: control.indicatorMarginBottom
|
||||
}
|
||||
visible: showIndicator
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
if(index === list_view.count-1)
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
property int realIndex: index
|
||||
property bool checked: list_view.currentIndex === index
|
||||
sourceComponent: {
|
||||
if(index===0 || index===list_view.count-1)
|
||||
return undefined
|
||||
return control.indicatorDelegate
|
||||
active: showIndicator
|
||||
sourceComponent: control.orientation === Qt.Vertical ? column_indicator : row_indicator
|
||||
}
|
||||
|
||||
Component{
|
||||
id: row_indicator
|
||||
Row{
|
||||
id:layout_indicator
|
||||
spacing: control.indicatorSpacing
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
if(index === list_view.count-1)
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
property int realIndex: index
|
||||
property bool checked: list_view.currentIndex === index
|
||||
sourceComponent: {
|
||||
if(index===0 || index===list_view.count-1)
|
||||
return undefined
|
||||
return control.indicatorDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id: column_indicator
|
||||
Column{
|
||||
id:layout_indicator
|
||||
spacing: control.indicatorSpacing
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
if(index === list_view.count-1)
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
property int realIndex: index
|
||||
property bool checked: list_view.currentIndex === index
|
||||
sourceComponent: {
|
||||
if(index===0 || index===list_view.count-1)
|
||||
return undefined
|
||||
return control.indicatorDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer{
|
||||
id:timer_anim
|
||||
interval: 250
|
||||
@ -195,10 +277,10 @@ Item {
|
||||
}
|
||||
}
|
||||
function changedIndex(index){
|
||||
d.flagXChanged = true
|
||||
d.isManualMoving = true
|
||||
timer_run.stop()
|
||||
list_view.currentIndex = index
|
||||
d.flagXChanged = false
|
||||
d.isManualMoving = false
|
||||
if(d.isAnimEnable){
|
||||
timer_run.restart()
|
||||
}
|
||||
|
@ -14,7 +14,9 @@ Canvas {
|
||||
function animateToNewData()
|
||||
{
|
||||
chartAnimationProgress = 0.1;
|
||||
d.jsChart.update();
|
||||
if (d.jsChart) {
|
||||
d.jsChart.update();
|
||||
}
|
||||
chartAnimator.restart();
|
||||
}
|
||||
QtObject{
|
||||
|
@ -20,7 +20,19 @@ Button {
|
||||
property color checkedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
||||
property real size: 18
|
||||
property alias textColor: btn_text.textColor
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property bool textRight: true
|
||||
property real textSpacing: 6
|
||||
property bool animationEnabled: FluTheme.animationEnabled
|
||||
@ -129,6 +141,7 @@ Button {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
visible: text !== ""
|
||||
font: control.font
|
||||
color: control.textColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,17 @@ Button{
|
||||
implicitWidth: 326
|
||||
implicitHeight: 560
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
onClosed: {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
}
|
||||
onOpened: {
|
||||
layout_color_hue.updateColorText(current);
|
||||
text_box_color.textEdited();
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_actions
|
||||
width: parent.width
|
||||
@ -149,7 +160,9 @@ Button{
|
||||
if(color.a===1){
|
||||
colorString = "FF"+colorString
|
||||
}
|
||||
text_box_color.text = colorString.toUpperCase()
|
||||
if (!text_box_color.activeFocus) {
|
||||
text_box_color.text = colorString.toUpperCase();
|
||||
}
|
||||
}
|
||||
property color blackColor: {
|
||||
var c = whiteColor
|
||||
@ -280,6 +293,11 @@ Button{
|
||||
preventStealing: true
|
||||
function handleMouse(mouse) {
|
||||
if (mouse.buttons & Qt.LeftButton) {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
pickerCursor.x = Math.max(0,Math.min(mouse.x - colorHandleRadius,width-2*colorHandleRadius));
|
||||
pickerCursor.y = Math.max(0,Math.min(mouse.y - colorHandleRadius,height-2*colorHandleRadius));
|
||||
}
|
||||
@ -370,6 +388,11 @@ Button{
|
||||
preventStealing: true
|
||||
function handleMouse(mouse) {
|
||||
if (mouse.buttons & Qt.LeftButton) {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
blackCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
|
||||
blackCursor.y = 0
|
||||
}
|
||||
@ -439,6 +462,11 @@ Button{
|
||||
preventStealing: true
|
||||
function handleMouse(mouse) {
|
||||
if (mouse.buttons & Qt.LeftButton) {
|
||||
text_box_r.focus = false;
|
||||
text_box_g.focus = false;
|
||||
text_box_b.focus = false;
|
||||
text_box_a.focus = false;
|
||||
text_box_color.focus = false;
|
||||
opacityCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
|
||||
opacityCursor.y = 0
|
||||
}
|
||||
@ -473,7 +501,7 @@ Button{
|
||||
id:text_box_color
|
||||
width: 136
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: /^[0-9A-F]{8}$/
|
||||
regularExpression: /^[0-9A-Fa-f]{8}$/
|
||||
}
|
||||
anchors{
|
||||
right: parent.right
|
||||
@ -496,6 +524,11 @@ Button{
|
||||
parseInt(colorString.substring(6, 8), 16) / 255,
|
||||
parseInt(colorString.substring(0, 2), 16) / 255)
|
||||
layout_color_hue.colorValue = c
|
||||
layout_color_hue.updateColorText(c);
|
||||
text_box_r.textEdited();
|
||||
text_box_g.textEdited();
|
||||
text_box_b.textEdited();
|
||||
text_box_a.textEdited();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ T.ComboBox {
|
||||
y: control.height
|
||||
width: control.width
|
||||
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
|
||||
topMargin: 6
|
||||
topMargin: 32
|
||||
bottomMargin: 6
|
||||
modal: true
|
||||
contentItem: ListView {
|
||||
|
@ -41,7 +41,7 @@ FluPopup {
|
||||
FluText{
|
||||
id:text_message
|
||||
font: FluTextStyle.Body
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
text:message
|
||||
width: parent.width
|
||||
topPadding: 4
|
||||
@ -67,7 +67,7 @@ FluPopup {
|
||||
topPadding: 20
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
FluLoader{
|
||||
sourceComponent: com_message
|
||||
|
@ -3,7 +3,19 @@ import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
TextEdit {
|
||||
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
id:control
|
||||
color: textColor
|
||||
readOnly: true
|
||||
|
@ -5,6 +5,8 @@ import FluentUI
|
||||
|
||||
Item {
|
||||
property string headerText: ""
|
||||
property int headerHeight : 45
|
||||
property Component headerDelegate: com_header
|
||||
property bool expand: false
|
||||
property int contentHeight : 300
|
||||
default property alias content: container.data
|
||||
@ -21,10 +23,23 @@ Item {
|
||||
}
|
||||
}
|
||||
clip: true
|
||||
Component {
|
||||
id: com_header
|
||||
Item {
|
||||
FluText {
|
||||
text: control.headerText
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 15
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_header
|
||||
width: parent.width
|
||||
height: 45
|
||||
height: control.headerHeight
|
||||
radius: 4
|
||||
border.color: FluTheme.dividerColor
|
||||
color: {
|
||||
@ -41,15 +56,17 @@ Item {
|
||||
d.toggle()
|
||||
}
|
||||
}
|
||||
FluText{
|
||||
text: headerText
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
FluLoader {
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
leftMargin: 15
|
||||
right: btn_toggle.left
|
||||
}
|
||||
sourceComponent: control.headerDelegate
|
||||
}
|
||||
FluIconButton{
|
||||
id: btn_toggle
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
|
@ -5,7 +5,19 @@ import FluentUI
|
||||
Text {
|
||||
property int iconSource
|
||||
property int iconSize: 20
|
||||
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
||||
property color iconColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
id:control
|
||||
font.family: font_loader.name
|
||||
font.pixelSize: iconSize
|
||||
|
@ -38,7 +38,19 @@ Button {
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property color textColor: FluTheme.fontPrimaryColor
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: control.text
|
||||
Accessible.description: contentDescription
|
||||
|
@ -190,13 +190,13 @@ FluObject {
|
||||
spacing: 5
|
||||
FluText{
|
||||
text:_super.text
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
width: Math.min(implicitWidth,mcontrol.maxWidth)
|
||||
}
|
||||
FluText{
|
||||
text: _super.moremsg
|
||||
visible: _super.moremsg
|
||||
wrapMode : Text.WrapAnywhere
|
||||
wrapMode : Text.WordWrap
|
||||
textColor: FluColors.Grey120
|
||||
width: Math.min(implicitWidth,mcontrol.maxWidth)
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ TextArea{
|
||||
return normalColor
|
||||
}
|
||||
font:FluTextStyle.Body
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
padding: 8
|
||||
leftPadding: padding+4
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
|
@ -1314,7 +1314,7 @@ Item {
|
||||
d.stackItems = d.stackItems.concat(nav_list.model[nav_list.currentIndex])
|
||||
}
|
||||
function noStackPush(){
|
||||
if(loader_content.source.toString() === url){
|
||||
if(loader_content.source.toString() === url && Object.keys(argument).length === 0){
|
||||
return
|
||||
}
|
||||
loader_content.setSource(url,argument)
|
||||
|
@ -6,8 +6,9 @@ import FluentUI
|
||||
Page {
|
||||
default property alias content: d.children
|
||||
property alias currentIndex: nav_list.currentIndex
|
||||
property color textHighlightColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
|
||||
property color textNormalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120
|
||||
property color textHoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
|
||||
property color textHoverColor: FluTheme.dark ? FluColors.Grey80 : FluColors.Grey150
|
||||
property int textSpacing: 10
|
||||
property int headerSpacing: 20
|
||||
property int headerHeight: 40
|
||||
@ -31,21 +32,15 @@ Page {
|
||||
interactive: false
|
||||
orientation: ListView.Horizontal
|
||||
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
|
||||
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
|
||||
highlight: Item{
|
||||
clip: true
|
||||
Rectangle{
|
||||
height: 3
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor
|
||||
width: nav_list.currentItem ? nav_list.currentItem.width : 0
|
||||
width: nav_list.currentItem.width
|
||||
y:d.tabY
|
||||
Behavior on width {
|
||||
enabled: FluTheme.animationEnabled
|
||||
NumberAnimation{
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
delegate: Button{
|
||||
@ -67,9 +62,13 @@ Page {
|
||||
anchors.centerIn: parent
|
||||
font: control.font
|
||||
color: {
|
||||
if(item_button.hovered)
|
||||
return textHoverColor
|
||||
return textNormalColor
|
||||
if(nav_list.currentIndex === index) {
|
||||
return textHighlightColor;
|
||||
}
|
||||
if (item_button.hovered) {
|
||||
return textHoverColor;
|
||||
}
|
||||
return textNormalColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,6 @@ ProgressBar{
|
||||
id:d
|
||||
property real _radius: strokeWidth/2
|
||||
}
|
||||
onIndeterminateChanged:{
|
||||
if(!indeterminate){
|
||||
animator_x.duration = 0
|
||||
rect_progress.x = 0
|
||||
animator_x.duration = control.duration
|
||||
}
|
||||
}
|
||||
background: Rectangle {
|
||||
implicitWidth: 150
|
||||
implicitHeight: control.strokeWidth
|
||||
@ -42,13 +35,20 @@ ProgressBar{
|
||||
height: parent.height
|
||||
radius: d._radius
|
||||
color: control.color
|
||||
PropertyAnimation on x {
|
||||
id:animator_x
|
||||
SequentialAnimation on x {
|
||||
id: animator_x
|
||||
running: control.indeterminate && control.visible
|
||||
from: -rect_progress.width
|
||||
to:control.width+rect_progress.width
|
||||
loops: Animation.Infinite
|
||||
duration: control.duration
|
||||
onRunningChanged: {
|
||||
if(!running){
|
||||
rect_progress.x = 0
|
||||
}
|
||||
}
|
||||
PropertyAnimation {
|
||||
from: -rect_progress.width
|
||||
to: control.width + rect_progress.width
|
||||
duration: control.duration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,19 @@ Button {
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1)
|
||||
property color hoverColor: checked ? FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
|
||||
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(159/255,159/255,159/255,1) : Qt.rgba(159/255,159/255,159/255,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
|
||||
property alias textColor: btn_text.textColor
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(!enabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property real size: 18
|
||||
property bool textRight: true
|
||||
property real textSpacing: 6
|
||||
@ -90,6 +102,7 @@ Button {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
font: control.font
|
||||
visible: text !== ""
|
||||
color: control.textColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,11 @@ import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
FluPage {
|
||||
property bool autoResetScroll: false
|
||||
default property alias content: container.data
|
||||
|
||||
Flickable{
|
||||
id: flickable
|
||||
clip: true
|
||||
anchors.fill: parent
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
@ -17,4 +20,14 @@ FluPage {
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
function resetScroll() {
|
||||
flickable.contentY = 0;
|
||||
}
|
||||
|
||||
StackView.onActivated: {
|
||||
if (autoResetScroll) {
|
||||
resetScroll(); // Call this function to reset the scroll position to the top
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import FluentUI
|
||||
Text {
|
||||
property color textColor: FluTheme.fontPrimaryColor
|
||||
id:text
|
||||
color: textColor
|
||||
color: enabled ? textColor : (FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1))
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
font: FluTextStyle.Body
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ FluButton {
|
||||
if (hours === "12") {
|
||||
hours24 = (period === control.amText) ? 0 : 12;
|
||||
} else {
|
||||
hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
|
||||
hours24 = (period === control.pmText) ? hours24 + 12 : hours24;
|
||||
}
|
||||
}
|
||||
date.setHours(hours24);
|
||||
|
@ -98,7 +98,7 @@ Item{
|
||||
Component{
|
||||
id:com_lable
|
||||
FluText{
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
||||
text: {
|
||||
if(modelData.lable){
|
||||
@ -113,7 +113,7 @@ Item{
|
||||
Component{
|
||||
id:com_text
|
||||
FluText{
|
||||
wrapMode: Text.WrapAnywhere
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
||||
text: modelData.text
|
||||
textFormat: Text.RichText
|
||||
|