RinUI 0.0.11__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. RinUI/__init__.py +4 -4
  2. RinUI/assets/fonts/FluentSystemIcons-Index.js +5255 -5255
  3. RinUI/assets/img/default_app_icon.png +0 -0
  4. RinUI/components/Base.qml +78 -78
  5. RinUI/components/BasicInput/Button.qml +146 -147
  6. RinUI/components/BasicInput/CheckBox.qml +98 -98
  7. RinUI/components/BasicInput/ComboBox.qml +159 -159
  8. RinUI/components/BasicInput/DropDownButton.qml +20 -20
  9. RinUI/components/BasicInput/Hyperlink.qml +17 -17
  10. RinUI/components/BasicInput/PillButton.qml +10 -10
  11. RinUI/components/BasicInput/RadioButton.qml +94 -94
  12. RinUI/components/BasicInput/RoundButton.qml +26 -26
  13. RinUI/components/BasicInput/Slider.qml +212 -212
  14. RinUI/components/BasicInput/Switch.qml +101 -101
  15. RinUI/components/BasicInput/ToggleButton.qml +10 -10
  16. RinUI/components/BasicInput/ToolButton.qml +30 -30
  17. RinUI/components/ContextMenu.qml +183 -183
  18. RinUI/components/DateAndTime/DatePicker.qml +142 -140
  19. RinUI/components/DateAndTime/PickerView.qml +223 -223
  20. RinUI/components/DateAndTime/TimePicker.qml +114 -114
  21. RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -106
  22. RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -47
  23. RinUI/components/DialogsAndFlyouts/Flyout.qml +87 -144
  24. RinUI/components/DialogsAndFlyouts/Popup.qml +110 -106
  25. RinUI/components/FocusIndicator.qml +33 -33
  26. RinUI/components/IconWidget.qml +52 -52
  27. RinUI/components/Indicator.qml +89 -89
  28. RinUI/components/Layout/Expander.qml +159 -159
  29. RinUI/components/Layout/SettingExpander.qml +66 -66
  30. RinUI/components/Layout/SettingItem.qml +70 -70
  31. RinUI/components/ListAndCollections/Clip.qml +21 -21
  32. RinUI/components/ListAndCollections/Frame.qml +43 -43
  33. RinUI/components/ListAndCollections/ListView.qml +104 -104
  34. RinUI/components/ListAndCollections/ListViewDelegate.qml +82 -82
  35. RinUI/components/ListAndCollections/SettingCard.qml +72 -72
  36. RinUI/components/ListAndCollections/TableView.qml +81 -81
  37. RinUI/components/ListAndCollections/TableViewDelegate.qml +88 -88
  38. RinUI/components/Media/Avatar.qml +83 -0
  39. RinUI/components/MenusAndToolbars/Menu.qml +150 -150
  40. RinUI/components/MenusAndToolbars/MenuBar.qml +42 -42
  41. RinUI/components/MenusAndToolbars/MenuItem.qml +131 -131
  42. RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -43
  43. RinUI/components/MenusAndToolbars/MenuSeparator.qml +13 -13
  44. RinUI/components/MenusAndToolbars/TextInputMenu.qml +37 -37
  45. RinUI/components/MenusAndToolbars/ToolSeparator.qml +16 -16
  46. RinUI/components/Navigation/ErrorPage.qml +48 -48
  47. RinUI/components/Navigation/NavigationBar.qml +179 -179
  48. RinUI/components/Navigation/NavigationItem.qml +193 -193
  49. RinUI/components/Navigation/NavigationSubItem.qml +103 -103
  50. RinUI/components/Navigation/NavigationView.qml +228 -227
  51. RinUI/components/Navigation/Segmented.qml +17 -0
  52. RinUI/components/Navigation/SegmentedItem.qml +108 -0
  53. RinUI/components/Navigation/SelectorBar.qml +12 -57
  54. RinUI/components/Navigation/SelectorBarItem.qml +89 -0
  55. RinUI/components/ScrollBar.qml +204 -204
  56. RinUI/components/ScrollView.qml +12 -12
  57. RinUI/components/Shadow.qml +47 -47
  58. RinUI/components/StatusAndInfo/InfoBadge.qml +77 -77
  59. RinUI/components/StatusAndInfo/InfoBar.qml +256 -251
  60. RinUI/components/StatusAndInfo/ProgressBar.qml +126 -126
  61. RinUI/components/StatusAndInfo/ProgressRing.qml +149 -0
  62. RinUI/components/StatusAndInfo/Toast.qml +236 -236
  63. RinUI/components/StatusAndInfo/ToolTip.qml +93 -93
  64. RinUI/components/Text/SpinBox.qml +150 -133
  65. RinUI/components/Text/Text.qml +44 -44
  66. RinUI/components/Text/TextArea.qml +117 -117
  67. RinUI/components/Text/TextField.qml +113 -113
  68. RinUI/components/Text/TextInput.qml +47 -47
  69. RinUI/components/qmldir +80 -77
  70. RinUI/core/__init__.py +4 -4
  71. RinUI/core/config.py +129 -129
  72. RinUI/core/launcher.py +129 -129
  73. RinUI/core/theme.py +339 -339
  74. RinUI/core/translator.py +25 -25
  75. RinUI/hooks/__init__.py +3 -3
  76. RinUI/hooks/hook-RinUI.py +3 -3
  77. RinUI/qmldir +108 -97
  78. RinUI/themes/Appearance.qml +36 -0
  79. RinUI/themes/Colors.qml +36 -0
  80. RinUI/themes/dark.qml +145 -136
  81. RinUI/themes/light.qml +145 -136
  82. RinUI/themes/qmldir +9 -6
  83. RinUI/themes/theme.qml +151 -149
  84. RinUI/themes/utils.qml +37 -37
  85. RinUI/utils/Animation.qml +12 -12
  86. RinUI/utils/FloatLayer.qml +132 -123
  87. RinUI/utils/FontIconLoader.qml +13 -13
  88. RinUI/utils/Position.qml +19 -19
  89. RinUI/utils/Severity.qml +13 -13
  90. RinUI/utils/Typography.qml +17 -17
  91. RinUI/utils/qmldir +4 -4
  92. RinUI/windows/CtrlBtn.qml +118 -118
  93. RinUI/windows/FluentPage.qml +92 -92
  94. RinUI/windows/FluentWindow.qml +31 -30
  95. RinUI/windows/FluentWindowBase.qml +158 -158
  96. RinUI/windows/TitleBar.qml +135 -135
  97. RinUI/windows/qmldir +7 -7
  98. RinUI/windows/window/ApplicationWindow.qml +8 -8
  99. RinUI/windows/window/Window.qml +118 -118
  100. {rinui-0.0.11.data → rinui-0.1.1.data}/data/LICENSE +21 -21
  101. {rinui-0.0.11.data → rinui-0.1.1.data}/data/README.md +100 -97
  102. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/METADATA +116 -112
  103. rinui-0.1.1.dist-info/RECORD +112 -0
  104. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/WHEEL +1 -1
  105. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info/licenses}/LICENSE +21 -21
  106. RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  107. RinUI/config/rin_ui.json +0 -8
  108. RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  109. RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  110. RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  111. RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  112. RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
  113. rinui-0.0.11.dist-info/RECORD +0 -112
  114. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/entry_points.txt +0 -0
  115. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/top_level.txt +0 -0
@@ -1,106 +1,110 @@
1
- import QtQuick 2.15
2
- import QtQuick.Controls.Basic 2.15
3
- import QtQuick.Layouts 2.15
4
- import Qt5Compat.GraphicalEffects
5
- import "../../themes"
6
- import "../../components"
7
-
8
- Popup {
9
- id: popup
10
- property int position: Position.Bottom
11
- property real posX: {
12
- switch (position) {
13
- case Position.Top:
14
- case Position.Bottom:
15
- return (parent.width - popup.width) / 2
16
- case Position.Left:
17
- return - popup.width - 5
18
- case Position.Right:
19
- return parent.width + 5
20
- default:
21
- return (parent.width - popup.width) / 2
22
- }
23
- }
24
-
25
- property real posY: {
26
- switch (position) {
27
- case Position.Top:
28
- return -popup.height - 5
29
- case Position.Bottom:
30
- return parent.height + 5
31
- case Position.Left:
32
- case Position.Center:
33
- case Position.Right:
34
- return (parent.height - popup.height) / 2
35
- default:
36
- return -popup.height + 5 // 默认顶部
37
- }
38
- }
39
-
40
- background: Rectangle {
41
- id: background
42
- anchors.fill: parent
43
- y: -6
44
-
45
- radius: Theme.currentTheme.appearance.windowRadius
46
- color: Theme.currentTheme.colors.backgroundAcrylicColor
47
- border.color: Theme.currentTheme.colors.flyoutBorderColor
48
-
49
- Behavior on color {
50
- ColorAnimation {
51
- duration: Utils.appearanceSpeed
52
- easing.type: Easing.OutQuart
53
- }
54
- }
55
-
56
- layer.enabled: true
57
- layer.effect: Shadow {
58
- style: "flyout"
59
- source: background
60
- }
61
- }
62
-
63
- // 动画 / Animation //
64
- enter: Transition {
65
- ParallelAnimation {
66
- NumberAnimation {
67
- target: popup
68
- property: "opacity"
69
- from: 0
70
- to: 1
71
- duration: Utils.appearanceSpeed
72
- easing.type: Easing.OutQuint
73
- }
74
- NumberAnimation {
75
- target: popup
76
- property: "y"
77
- from: posY + (position !== Position.Center
78
- ? (position === Position.Top ? 15 : position === Position.Bottom ? -15 : 0) : 0)
79
- to: posY
80
- duration: Utils.animationSpeedMiddle * 1.25
81
- easing.type: Easing.OutQuint
82
- }
83
- NumberAnimation {
84
- target: popup
85
- property: "x"
86
- from: posX + (position !== Position.Center
87
- ? (position === Position.Left ? 15 : position === Position.Right ? -15 : 0) : 0)
88
- to: posX
89
- duration: Utils.animationSpeedMiddle * 1.25
90
- easing.type: Easing.OutQuint
91
- }
92
- }
93
- }
94
- exit: Transition {
95
- ParallelAnimation {
96
- NumberAnimation {
97
- target: popup
98
- property: "opacity"
99
- from: 1
100
- to: 0
101
- duration: Utils.animationSpeed
102
- easing.type: Easing.OutQuint
103
- }
104
- }
105
- }
106
- }
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls.Basic 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import Qt5Compat.GraphicalEffects
5
+ import "../../themes"
6
+ import "../../components"
7
+
8
+ Popup {
9
+ id: popup
10
+ property int position: Position.Bottom
11
+ property real posX: {
12
+ switch (position) {
13
+ case Position.Top:
14
+ case Position.Bottom:
15
+ return (parent.width - popup.width) / 2
16
+ case Position.Left:
17
+ return - popup.width - 5
18
+ case Position.Right:
19
+ return parent.width + 5
20
+ default:
21
+ return (parent.width - popup.width) / 2
22
+ }
23
+ }
24
+
25
+ property real posY: {
26
+ switch (position) {
27
+ case Position.Top:
28
+ return -popup.height - 5
29
+ case Position.Bottom:
30
+ return parent.height + 5
31
+ case Position.Left:
32
+ case Position.Center:
33
+ case Position.Right:
34
+ return (parent.height - popup.height) / 2
35
+ default:
36
+ return -popup.height + 5 // 默认顶部
37
+ }
38
+ }
39
+
40
+ Overlay.modal: Rectangle {
41
+ color: Theme.currentTheme.colors.backgroundSmokeColor
42
+ }
43
+
44
+ background: Rectangle {
45
+ id: background
46
+ anchors.fill: parent
47
+ y: -6
48
+
49
+ radius: Theme.currentTheme.appearance.windowRadius
50
+ color: Theme.currentTheme.colors.backgroundAcrylicColor
51
+ border.color: Theme.currentTheme.colors.flyoutBorderColor
52
+
53
+ Behavior on color {
54
+ ColorAnimation {
55
+ duration: Utils.appearanceSpeed
56
+ easing.type: Easing.OutQuart
57
+ }
58
+ }
59
+
60
+ layer.enabled: true
61
+ layer.effect: Shadow {
62
+ style: "flyout"
63
+ source: background
64
+ }
65
+ }
66
+
67
+ // 动画 / Animation //
68
+ enter: Transition {
69
+ ParallelAnimation {
70
+ NumberAnimation {
71
+ target: popup
72
+ property: "opacity"
73
+ from: 0
74
+ to: 1
75
+ duration: Utils.appearanceSpeed
76
+ easing.type: Easing.OutQuint
77
+ }
78
+ NumberAnimation {
79
+ target: popup
80
+ property: "y"
81
+ from: posY + (position !== Position.Center
82
+ ? (position === Position.Top ? 15 : position === Position.Bottom ? -15 : 0) : 0)
83
+ to: posY
84
+ duration: Utils.animationSpeedMiddle * 1.25
85
+ easing.type: Easing.OutQuint
86
+ }
87
+ NumberAnimation {
88
+ target: popup
89
+ property: "x"
90
+ from: posX + (position !== Position.Center
91
+ ? (position === Position.Left ? 15 : position === Position.Right ? -15 : 0) : 0)
92
+ to: posX
93
+ duration: Utils.animationSpeedMiddle * 1.25
94
+ easing.type: Easing.OutQuint
95
+ }
96
+ }
97
+ }
98
+ exit: Transition {
99
+ ParallelAnimation {
100
+ NumberAnimation {
101
+ target: popup
102
+ property: "opacity"
103
+ from: 1
104
+ to: 0
105
+ duration: Utils.animationSpeed
106
+ easing.type: Easing.OutQuint
107
+ }
108
+ }
109
+ }
110
+ }
@@ -1,33 +1,33 @@
1
- import QtQuick 2.15
2
- import "../themes"
3
-
4
- Item {
5
- id: root
6
- anchors.fill: parent
7
- z: 9999
8
-
9
- required property Item control
10
- property real radius: Theme.currentTheme.appearance.buttonRadius
11
-
12
- visible: control.activeFocus &&
13
- (control.focusReason === Qt.TabFocusReason ||
14
- control.focusReason === Qt.BacktabFocusReason)
15
-
16
- Rectangle {
17
- anchors.fill: parent
18
- anchors.margins: -(2 + 1) + Theme.currentTheme.appearance.borderWidth
19
- color: "transparent"
20
- border.width: 2
21
- border.color: Theme.currentTheme.colors.focusBorderOuter
22
- radius: root.radius
23
-
24
- // inner
25
- Rectangle {
26
- anchors.fill: parent
27
- anchors.margins: parent.border.width
28
- radius: root.radius
29
- color: "transparent"
30
- border.color: Theme.currentTheme.colors.focusBorderInner
31
- }
32
- }
33
- }
1
+ import QtQuick 2.15
2
+ import "../themes"
3
+
4
+ Item {
5
+ id: root
6
+ anchors.fill: parent
7
+ z: 9999
8
+
9
+ required property Item control
10
+ property real radius: Theme.currentTheme.appearance.buttonRadius
11
+
12
+ visible: control.activeFocus &&
13
+ (control.focusReason === Qt.TabFocusReason ||
14
+ control.focusReason === Qt.BacktabFocusReason)
15
+
16
+ Rectangle {
17
+ anchors.fill: parent
18
+ anchors.margins: -(2 + 1) + Theme.currentTheme.appearance.borderWidth
19
+ color: "transparent"
20
+ border.width: 2
21
+ border.color: Theme.currentTheme.colors.focusBorderOuter
22
+ radius: root.radius
23
+
24
+ // inner
25
+ Rectangle {
26
+ anchors.fill: parent
27
+ anchors.margins: parent.border.width
28
+ radius: root.radius
29
+ color: "transparent"
30
+ border.color: Theme.currentTheme.colors.focusBorderInner
31
+ }
32
+ }
33
+ }
@@ -1,52 +1,52 @@
1
- import QtQuick 2.15
2
- import "../components"
3
- import "../themes"
4
- import "../utils"
5
- // import "../assets/fonts/FluentSystemIcons-Index.js" as Icons
6
-
7
-
8
- Item {
9
- id: root
10
- property string icon: "" // 字体图标(如 "\uf103")
11
- property string source: "" // 图片路径(如 "icons/image.png")
12
- property alias color: text.color
13
- // property string fontSource: Qt.resolvedUrl("../assets/fonts/" + Theme.currentTheme.typography.fontIcon)
14
- // property string fontSource: Qt.resolvedUrl("../assets/fonts/FluentSystemIcons-Resizable.ttf") // 字体图标路径
15
-
16
- property int size: 16
17
-
18
- // 计算是否是字体图标
19
- property bool isUnicode: icon.length === 1 // 判断是否为单字符(字体图标通常是单个字符)
20
- property bool isFontIcon: source === "" // 判断是否为字体图标
21
-
22
- // 匹配尺寸
23
- implicitWidth: size
24
- implicitHeight: size
25
-
26
- // 主题切换动画
27
- Behavior on color {
28
- ColorAnimation {
29
- duration: 250
30
- easing.type: Easing.OutQuart
31
- }
32
- }
33
-
34
- Text {
35
- id: text
36
- anchors.centerIn: parent
37
- // text: isFontIcon ? icon : "" // 仅当 `icon` 是单字符时显示
38
- text: isUnicode ? icon : String.fromCharCode(Utils.fontIconIndex[icon]) // 显示 FluentSystemIcons 字体图标
39
- font.family: Utils.iconFontFamily
40
- font.pixelSize: size
41
- }
42
-
43
- Image {
44
- id: iconImage
45
- anchors.centerIn: parent
46
- source: root.source // 仅当 `icon` 不是字体图标时加载图片
47
- width: size
48
- height: size
49
- mipmap: true
50
- fillMode: Image.PreserveAspectFit // 适配图片大小
51
- }
52
- }
1
+ import QtQuick 2.15
2
+ import "../components"
3
+ import "../themes"
4
+ import "../utils"
5
+ // import "../assets/fonts/FluentSystemIcons-Index.js" as Icons
6
+
7
+
8
+ Item {
9
+ id: root
10
+ property string icon: "" // 字体图标(如 "\uf103")
11
+ property string source: "" // 图片路径(如 "icons/image.png")
12
+ property alias color: text.color
13
+ // property string fontSource: Qt.resolvedUrl("../assets/fonts/" + Theme.currentTheme.typography.fontIcon)
14
+ // property string fontSource: Qt.resolvedUrl("../assets/fonts/FluentSystemIcons-Resizable.ttf") // 字体图标路径
15
+
16
+ property int size: 16
17
+
18
+ // 计算是否是字体图标
19
+ property bool isUnicode: icon.length === 1 // 判断是否为单字符(字体图标通常是单个字符)
20
+ property bool isFontIcon: source === "" // 判断是否为字体图标
21
+
22
+ // 匹配尺寸
23
+ implicitWidth: size
24
+ implicitHeight: size
25
+
26
+ // 主题切换动画
27
+ Behavior on color {
28
+ ColorAnimation {
29
+ duration: 250
30
+ easing.type: Easing.OutQuart
31
+ }
32
+ }
33
+
34
+ Text {
35
+ id: text
36
+ anchors.centerIn: parent
37
+ // text: isFontIcon ? icon : "" // 仅当 `icon` 是单字符时显示
38
+ text: isUnicode ? icon : String.fromCharCode(Utils.fontIconIndex[icon]) // 显示 FluentSystemIcons 字体图标
39
+ font.family: Utils.iconFontFamily
40
+ font.pixelSize: size
41
+ }
42
+
43
+ Image {
44
+ id: iconImage
45
+ anchors.centerIn: parent
46
+ source: root.source // 仅当 `icon` 不是字体图标时加载图片
47
+ width: size
48
+ height: size
49
+ mipmap: true
50
+ fillMode: Image.PreserveAspectFit // 适配图片大小
51
+ }
52
+ }
@@ -1,90 +1,90 @@
1
- import QtQuick 2.15
2
- import QtQuick.Controls 2.15
3
- import "../themes"
4
-
5
-
6
- Rectangle {
7
- id: indicator
8
-
9
- property int currentItemHeight: 38
10
- property var orientation: Qt.Vertical
11
-
12
- implicitWidth: orientation === Qt.Horizontal? 16 : 3
13
- implicitHeight: orientation === Qt.Horizontal? 3 : currentItemHeight - 23
14
- radius: 10
15
- color: Theme.currentTheme.colors.primaryColor
16
-
17
- y: orientation === Qt.Horizontal? parent.height - height : (parent.height - height) / 2
18
- x: orientation === Qt.Horizontal? (parent.width - width) / 2 : 0
19
-
20
- onVisibleChanged: {
21
- if (visible) {
22
- enterAnimation.start()
23
- }
24
- }
25
-
26
- // 动画 / Animation //
27
- ParallelAnimation {
28
- id: enterAnimation
29
- PropertyAnimation {
30
- target: indicator
31
- property: "opacity"
32
- from: 0.0
33
- to: 1.0
34
- duration: Utils.animationSpeed
35
- easing.type: Easing.OutQuad
36
- }
37
- ScriptAction {
38
- script: {
39
- if (indicator.orientation === Qt.Horizontal) {
40
- enterAnimationHorizontal.start()
41
- } else {
42
- enterAnimationVertical.start()
43
- }
44
- }
45
- }
46
- }
47
- // 垂直方向动画group // Vertical Animation
48
- ParallelAnimation {
49
- id: enterAnimationVertical
50
- PropertyAnimation {
51
- target: indicator
52
- property: "height"
53
- from: 0
54
- to: indicator.implicitHeight
55
- duration: Utils.animationSpeedMiddle
56
- easing.type: Easing.OutQuint
57
- }
58
-
59
- PropertyAnimation {
60
- target: indicator
61
- property: "y"
62
- from: parent.height / 2
63
- to: (parent.height - indicator.implicitHeight) / 2
64
- duration: Utils.animationSpeedMiddle
65
- easing.type: Easing.OutQuint
66
- }
67
- }
68
-
69
- // 垂直方向动画group // Vertical Animation
70
- ParallelAnimation {
71
- id: enterAnimationHorizontal
72
- PropertyAnimation {
73
- target: indicator
74
- property: "width"
75
- from: 0
76
- to: indicator.implicitWidth
77
- duration: Utils.animationSpeedMiddle
78
- easing.type: Easing.OutQuint
79
- }
80
-
81
- PropertyAnimation {
82
- target: indicator
83
- property: "x"
84
- from: parent.width / 2
85
- to: (parent.width - indicator.implicitWidth) / 2
86
- duration: Utils.animationSpeedMiddle
87
- easing.type: Easing.OutQuint
88
- }
89
- }
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import "../themes"
4
+
5
+
6
+ Rectangle {
7
+ id: indicator
8
+
9
+ property int currentItemHeight: 38
10
+ property var orientation: Qt.Vertical
11
+
12
+ implicitWidth: orientation === Qt.Horizontal? 16 : 3
13
+ implicitHeight: orientation === Qt.Horizontal? 3 : currentItemHeight - 23
14
+ radius: 10
15
+ color: Theme.currentTheme.colors.primaryColor
16
+
17
+ y: orientation === Qt.Horizontal? parent.height - height : (parent.height - height) / 2
18
+ x: orientation === Qt.Horizontal? (parent.width - width) / 2 : 0
19
+
20
+ onVisibleChanged: {
21
+ if (visible) {
22
+ enterAnimation.start()
23
+ }
24
+ }
25
+
26
+ // 动画 / Animation //
27
+ ParallelAnimation {
28
+ id: enterAnimation
29
+ PropertyAnimation {
30
+ target: indicator
31
+ property: "opacity"
32
+ from: 0.0
33
+ to: 1.0
34
+ duration: Utils.animationSpeed
35
+ easing.type: Easing.OutQuad
36
+ }
37
+ ScriptAction {
38
+ script: {
39
+ if (indicator.orientation === Qt.Horizontal) {
40
+ enterAnimationHorizontal.start()
41
+ } else {
42
+ enterAnimationVertical.start()
43
+ }
44
+ }
45
+ }
46
+ }
47
+ // 垂直方向动画group // Vertical Animation
48
+ ParallelAnimation {
49
+ id: enterAnimationVertical
50
+ PropertyAnimation {
51
+ target: indicator
52
+ property: "height"
53
+ from: 0
54
+ to: indicator.implicitHeight
55
+ duration: Utils.animationSpeedMiddle
56
+ easing.type: Easing.OutQuint
57
+ }
58
+
59
+ PropertyAnimation {
60
+ target: indicator
61
+ property: "y"
62
+ from: parent.height / 2
63
+ to: (parent.height - indicator.implicitHeight) / 2
64
+ duration: Utils.animationSpeedMiddle
65
+ easing.type: Easing.OutQuint
66
+ }
67
+ }
68
+
69
+ // 垂直方向动画group // Vertical Animation
70
+ ParallelAnimation {
71
+ id: enterAnimationHorizontal
72
+ PropertyAnimation {
73
+ target: indicator
74
+ property: "width"
75
+ from: 0
76
+ to: indicator.implicitWidth
77
+ duration: Utils.animationSpeedMiddle
78
+ easing.type: Easing.OutQuint
79
+ }
80
+
81
+ PropertyAnimation {
82
+ target: indicator
83
+ property: "x"
84
+ from: parent.width / 2
85
+ to: (parent.width - indicator.implicitWidth) / 2
86
+ duration: Utils.animationSpeedMiddle
87
+ easing.type: Easing.OutQuint
88
+ }
89
+ }
90
90
  }