Skip to content

Commit 4ca0978

Browse files
authored
Merge pull request zhuzichu520#602 from Polaris-Night/main
feat: FluRectangle支持修改边框样式、FluTour增加指示器和动画效果
2 parents e27f159 + ce4fb06 commit 4ca0978

File tree

10 files changed

+537
-162
lines changed

10 files changed

+537
-162
lines changed

example/example_en_US.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@
7070
<translation type="unfinished"></translation>
7171
</message>
7272
<message>
73-
<location filename="qml/window/CrashWindow.qml" line="50"/>
73+
<location filename="qml/window/CrashWindow.qml" line="53"/>
7474
<source>We apologize for the inconvenience caused by an unexpected error</source>
7575
<translation type="unfinished"></translation>
7676
</message>
7777
<message>
78-
<location filename="qml/window/CrashWindow.qml" line="62"/>
78+
<location filename="qml/window/CrashWindow.qml" line="65"/>
7979
<source>Report Logs</source>
8080
<translation type="unfinished"></translation>
8181
</message>
8282
<message>
83-
<location filename="qml/window/CrashWindow.qml" line="72"/>
83+
<location filename="qml/window/CrashWindow.qml" line="75"/>
8484
<source>Restart Program</source>
8585
<translation type="unfinished"></translation>
8686
</message>
@@ -2737,49 +2737,60 @@ Some contents...</source>
27372737
<name>T_Tour</name>
27382738
<message>
27392739
<location filename="qml/page/T_Tour.qml" line="15"/>
2740+
<location filename="qml/page/T_Tour.qml" line="23"/>
27402741
<source>Upload File</source>
27412742
<translation type="unfinished"></translation>
27422743
</message>
27432744
<message>
27442745
<location filename="qml/page/T_Tour.qml" line="15"/>
2746+
<location filename="qml/page/T_Tour.qml" line="23"/>
27452747
<source>Put your files here.</source>
27462748
<translation type="unfinished"></translation>
27472749
</message>
27482750
<message>
27492751
<location filename="qml/page/T_Tour.qml" line="16"/>
2750-
<location filename="qml/page/T_Tour.qml" line="52"/>
2751-
<location filename="qml/page/T_Tour.qml" line="54"/>
2752+
<location filename="qml/page/T_Tour.qml" line="24"/>
2753+
<location filename="qml/page/T_Tour.qml" line="74"/>
2754+
<location filename="qml/page/T_Tour.qml" line="76"/>
27522755
<source>Save</source>
27532756
<translation type="unfinished"></translation>
27542757
</message>
27552758
<message>
27562759
<location filename="qml/page/T_Tour.qml" line="16"/>
2760+
<location filename="qml/page/T_Tour.qml" line="24"/>
27572761
<source>Save your changes.</source>
27582762
<translation type="unfinished"></translation>
27592763
</message>
27602764
<message>
27612765
<location filename="qml/page/T_Tour.qml" line="17"/>
2766+
<location filename="qml/page/T_Tour.qml" line="25"/>
27622767
<source>Other Actions</source>
27632768
<translation type="unfinished"></translation>
27642769
</message>
27652770
<message>
27662771
<location filename="qml/page/T_Tour.qml" line="17"/>
2772+
<location filename="qml/page/T_Tour.qml" line="25"/>
27672773
<source>Click to see other actions.</source>
27682774
<translation type="unfinished"></translation>
27692775
</message>
27702776
<message>
2771-
<location filename="qml/page/T_Tour.qml" line="31"/>
2777+
<location filename="qml/page/T_Tour.qml" line="46"/>
27722778
<source>Begin Tour</source>
27732779
<translation type="unfinished"></translation>
27742780
</message>
27752781
<message>
2776-
<location filename="qml/page/T_Tour.qml" line="45"/>
2777-
<location filename="qml/page/T_Tour.qml" line="47"/>
2782+
<location filename="qml/page/T_Tour.qml" line="52"/>
2783+
<source>Begin Tour with custom indicator</source>
2784+
<translation type="unfinished"></translation>
2785+
</message>
2786+
<message>
2787+
<location filename="qml/page/T_Tour.qml" line="67"/>
2788+
<location filename="qml/page/T_Tour.qml" line="69"/>
27782789
<source>Upload</source>
27792790
<translation type="unfinished"></translation>
27802791
</message>
27812792
<message>
2782-
<location filename="qml/page/T_Tour.qml" line="61"/>
2793+
<location filename="qml/page/T_Tour.qml" line="83"/>
27832794
<source>More</source>
27842795
<translation type="unfinished"></translation>
27852796
</message>

example/example_zh_CN.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@
7070
<translation type="unfinished">友情提示</translation>
7171
</message>
7272
<message>
73-
<location filename="qml/window/CrashWindow.qml" line="50"/>
73+
<location filename="qml/window/CrashWindow.qml" line="53"/>
7474
<source>We apologize for the inconvenience caused by an unexpected error</source>
7575
<translation type="unfinished">对于意外错误给您带来的不便,我们深表歉意</translation>
7676
</message>
7777
<message>
78-
<location filename="qml/window/CrashWindow.qml" line="62"/>
78+
<location filename="qml/window/CrashWindow.qml" line="65"/>
7979
<source>Report Logs</source>
8080
<translation type="unfinished">上报日志</translation>
8181
</message>
8282
<message>
83-
<location filename="qml/window/CrashWindow.qml" line="72"/>
83+
<location filename="qml/window/CrashWindow.qml" line="75"/>
8484
<source>Restart Program</source>
8585
<translation type="unfinished">重启程序</translation>
8686
</message>
@@ -552,7 +552,7 @@
552552
<message>
553553
<location filename="qml/global/ItemsOriginal.qml" line="448"/>
554554
<source>Tour</source>
555-
<translation type="unfinished">游览</translation>
555+
<translation type="unfinished">漫游式引导</translation>
556556
</message>
557557
<message>
558558
<location filename="qml/global/ItemsOriginal.qml" line="454"/>
@@ -2938,56 +2938,67 @@ Some contents...</source>
29382938
</message>
29392939
<message>
29402940
<location filename="qml/page/T_Tour.qml" line="15"/>
2941+
<location filename="qml/page/T_Tour.qml" line="23"/>
29412942
<source>Upload File</source>
29422943
<translation type="unfinished">上传文件</translation>
29432944
</message>
29442945
<message>
29452946
<location filename="qml/page/T_Tour.qml" line="15"/>
2947+
<location filename="qml/page/T_Tour.qml" line="23"/>
29462948
<source>Put your files here.</source>
29472949
<translation type="unfinished">把你的文件放在这里</translation>
29482950
</message>
29492951
<message>
29502952
<location filename="qml/page/T_Tour.qml" line="16"/>
2951-
<location filename="qml/page/T_Tour.qml" line="52"/>
2952-
<location filename="qml/page/T_Tour.qml" line="54"/>
2953+
<location filename="qml/page/T_Tour.qml" line="24"/>
2954+
<location filename="qml/page/T_Tour.qml" line="74"/>
2955+
<location filename="qml/page/T_Tour.qml" line="76"/>
29532956
<source>Save</source>
29542957
<translation type="unfinished">保存</translation>
29552958
</message>
29562959
<message>
29572960
<location filename="qml/page/T_Tour.qml" line="16"/>
2961+
<location filename="qml/page/T_Tour.qml" line="24"/>
29582962
<source>Save your changes.</source>
29592963
<translation type="unfinished">保存更改</translation>
29602964
</message>
29612965
<message>
29622966
<location filename="qml/page/T_Tour.qml" line="17"/>
2967+
<location filename="qml/page/T_Tour.qml" line="25"/>
29632968
<source>Other Actions</source>
29642969
<translation type="unfinished">其他操作</translation>
29652970
</message>
29662971
<message>
29672972
<location filename="qml/page/T_Tour.qml" line="17"/>
2973+
<location filename="qml/page/T_Tour.qml" line="25"/>
29682974
<source>Click to see other actions.</source>
29692975
<translation type="unfinished">点击查看其他操作</translation>
29702976
</message>
29712977
<message>
2972-
<location filename="qml/page/T_Tour.qml" line="31"/>
2978+
<location filename="qml/page/T_Tour.qml" line="46"/>
29732979
<source>Begin Tour</source>
2974-
<translation type="unfinished">开始游览</translation>
2980+
<translation type="unfinished">开始导览</translation>
2981+
</message>
2982+
<message>
2983+
<location filename="qml/page/T_Tour.qml" line="52"/>
2984+
<source>Begin Tour with custom indicator</source>
2985+
<translation type="unfinished">以自定义指示器开始导览</translation>
29752986
</message>
29762987
<message>
2977-
<location filename="qml/page/T_Tour.qml" line="45"/>
2978-
<location filename="qml/page/T_Tour.qml" line="47"/>
2988+
<location filename="qml/page/T_Tour.qml" line="67"/>
2989+
<location filename="qml/page/T_Tour.qml" line="69"/>
29792990
<source>Upload</source>
29802991
<translation type="unfinished">上传</translation>
29812992
</message>
29822993
<message>
2983-
<location filename="qml/page/T_Tour.qml" line="61"/>
2994+
<location filename="qml/page/T_Tour.qml" line="83"/>
29842995
<source>More</source>
29852996
<translation type="unfinished">更多</translation>
29862997
</message>
29872998
<message>
29882999
<location filename="qml/page/T_Tour.qml" line="10"/>
29893000
<source>Tour</source>
2990-
<translation type="unfinished">游览</translation>
3001+
<translation type="unfinished">漫游式引导</translation>
29913002
</message>
29923003
</context>
29933004
<context>

example/qml/page/T_Rectangle.qml

Lines changed: 63 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,69 +11,71 @@ FluScrollablePage{
1111

1212
FluFrame{
1313
Layout.fillWidth: true
14-
Layout.preferredHeight: 80
1514
padding: 10
1615

17-
Column{
16+
Flow{
17+
width: parent.width
1818
spacing: 15
19-
anchors{
20-
left: parent.left
21-
verticalCenter: parent.verticalCenter
19+
FluRectangle{
20+
width: 50
21+
height: 50
22+
color:"#0078d4"
23+
radius:[0,0,0,0]
2224
}
23-
RowLayout{
24-
Layout.topMargin: 20
25-
FluRectangle{
26-
width: 50
27-
height: 50
28-
color:"#0078d4"
29-
radius:[0,0,0,0]
30-
}
31-
FluRectangle{
32-
width: 50
33-
height: 50
34-
color:"#744da9"
35-
radius:[15,15,15,15]
36-
}
37-
FluRectangle{
38-
width: 50
39-
height: 50
40-
color:"#ffeb3b"
41-
radius:[15,0,0,0]
42-
}
43-
FluRectangle{
44-
width: 50
45-
height: 50
46-
color:"#f7630c"
47-
radius:[0,15,0,0]
48-
}
49-
FluRectangle{
50-
width: 50
51-
height: 50
52-
color:"#e71123"
53-
radius:[0,0,15,0]
54-
}
55-
FluRectangle{
56-
width: 50
57-
height: 50
58-
color:"#b4009e"
59-
radius:[0,0,0,15]
60-
}
61-
FluRectangle{
62-
width: 50
63-
height: 50
64-
color:"#a8d5ba"
65-
radius:[15,15,15,15]
66-
borderWidth: 3
67-
borderColor: "#5b8a72"
68-
}
69-
FluRectangle{
70-
width: 50
71-
height: 50
72-
color:"#dbe2ef"
73-
radius:[15,0,0,0]
74-
borderWidth: 2
75-
borderColor: "#3f72af"
76-
}
25+
FluRectangle{
26+
width: 50
27+
height: 50
28+
color:"#744da9"
29+
radius:[15,15,15,15]
30+
}
31+
FluRectangle{
32+
width: 50
33+
height: 50
34+
color:"#ffeb3b"
35+
radius:[15,0,0,0]
36+
}
37+
FluRectangle{
38+
width: 50
39+
height: 50
40+
color:"#f7630c"
41+
radius:[0,15,0,0]
42+
}
43+
FluRectangle{
44+
width: 50
45+
height: 50
46+
color:"#e71123"
47+
radius:[0,0,15,0]
48+
}
49+
FluRectangle{
50+
width: 50
51+
height: 50
52+
color:"#b4009e"
53+
radius:[0,0,0,15]
54+
}
55+
FluRectangle{
56+
width: 50
57+
height: 50
58+
color:"#a8d5ba"
59+
radius:[15,15,15,15]
60+
borderWidth: 3
61+
borderColor: "#5b8a72"
62+
}
63+
FluRectangle{
64+
width: 50
65+
height: 50
66+
color:"#dbe2ef"
67+
radius:[15,0,0,0]
68+
borderWidth: 2
69+
borderColor: "#3f72af"
70+
}
71+
FluRectangle{
72+
width: 50
73+
height: 50
74+
color:"#dbe2ef"
75+
borderWidth: 2
76+
borderColor: "#3f72af"
77+
borderStyle: Qt.DashLine
78+
dashPattern: [4,2]
7779
}
7880
}
7981
}
@@ -84,6 +86,8 @@ FluScrollablePage{
8486
radius: [25,25,25,25]
8587
borderWidth: 2
8688
borderColor: "#000000"
89+
borderStyle: Qt.DashLine
90+
dashPattern: [4,2]
8791
width: 50
8892
height: 50
8993
}'

example/qml/page/T_Tour.qml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,42 @@ FluScrollablePage{
1717
{title:qsTr("Other Actions"),description: qsTr("Click to see other actions."),target:()=>btn_more}
1818
]
1919
}
20+
FluTour{
21+
id:tour_custom_indicator
22+
steps:[
23+
{title:qsTr("Upload File"),description: qsTr("Put your files here."),target:()=>btn_upload},
24+
{title:qsTr("Save"),description: qsTr("Save your changes."),target:()=>btn_save},
25+
{title:qsTr("Other Actions"),description: qsTr("Click to see other actions."),target:()=>btn_more}
26+
]
27+
indicator: Component{
28+
FluText {
29+
text: "%1 / %2".arg(current + 1).arg(total)
30+
}
31+
}
32+
}
2033

2134
FluFrame{
2235
Layout.fillWidth: true
2336
Layout.preferredHeight: 130
2437
padding: 10
2538

26-
FluFilledButton{
39+
Row{
2740
anchors{
2841
top: parent.top
2942
topMargin: 14
3043
}
31-
text: qsTr("Begin Tour")
32-
onClicked: {
33-
tour.open()
44+
spacing: 20
45+
FluFilledButton{
46+
text: qsTr("Begin Tour")
47+
onClicked: {
48+
tour.open()
49+
}
50+
}
51+
FluFilledButton{
52+
text: qsTr("Begin Tour with custom indicator")
53+
onClicked: {
54+
tour_custom_indicator.open()
55+
}
3456
}
3557
}
3658

example/qml/window/CrashWindow.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ FluWindow {
1919
Component.onCompleted: {
2020
window.stayTop = true
2121
}
22+
Component.onDestruction: {
23+
FluRouter.exit()
24+
}
2225

2326
onInitArgument:
2427
(argument)=>{

0 commit comments

Comments
 (0)