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.
- RinUI/__init__.py +4 -4
- RinUI/assets/fonts/FluentSystemIcons-Index.js +5255 -5255
- RinUI/assets/img/default_app_icon.png +0 -0
- RinUI/components/Base.qml +78 -78
- RinUI/components/BasicInput/Button.qml +146 -147
- RinUI/components/BasicInput/CheckBox.qml +98 -98
- RinUI/components/BasicInput/ComboBox.qml +159 -159
- RinUI/components/BasicInput/DropDownButton.qml +20 -20
- RinUI/components/BasicInput/Hyperlink.qml +17 -17
- RinUI/components/BasicInput/PillButton.qml +10 -10
- RinUI/components/BasicInput/RadioButton.qml +94 -94
- RinUI/components/BasicInput/RoundButton.qml +26 -26
- RinUI/components/BasicInput/Slider.qml +212 -212
- RinUI/components/BasicInput/Switch.qml +101 -101
- RinUI/components/BasicInput/ToggleButton.qml +10 -10
- RinUI/components/BasicInput/ToolButton.qml +30 -30
- RinUI/components/ContextMenu.qml +183 -183
- RinUI/components/DateAndTime/DatePicker.qml +142 -140
- RinUI/components/DateAndTime/PickerView.qml +223 -223
- RinUI/components/DateAndTime/TimePicker.qml +114 -114
- RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -106
- RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -47
- RinUI/components/DialogsAndFlyouts/Flyout.qml +87 -144
- RinUI/components/DialogsAndFlyouts/Popup.qml +110 -106
- RinUI/components/FocusIndicator.qml +33 -33
- RinUI/components/IconWidget.qml +52 -52
- RinUI/components/Indicator.qml +89 -89
- RinUI/components/Layout/Expander.qml +159 -159
- RinUI/components/Layout/SettingExpander.qml +66 -66
- RinUI/components/Layout/SettingItem.qml +70 -70
- RinUI/components/ListAndCollections/Clip.qml +21 -21
- RinUI/components/ListAndCollections/Frame.qml +43 -43
- RinUI/components/ListAndCollections/ListView.qml +104 -104
- RinUI/components/ListAndCollections/ListViewDelegate.qml +82 -82
- RinUI/components/ListAndCollections/SettingCard.qml +72 -72
- RinUI/components/ListAndCollections/TableView.qml +81 -81
- RinUI/components/ListAndCollections/TableViewDelegate.qml +88 -88
- RinUI/components/Media/Avatar.qml +83 -0
- RinUI/components/MenusAndToolbars/Menu.qml +150 -150
- RinUI/components/MenusAndToolbars/MenuBar.qml +42 -42
- RinUI/components/MenusAndToolbars/MenuItem.qml +131 -131
- RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -43
- RinUI/components/MenusAndToolbars/MenuSeparator.qml +13 -13
- RinUI/components/MenusAndToolbars/TextInputMenu.qml +37 -37
- RinUI/components/MenusAndToolbars/ToolSeparator.qml +16 -16
- RinUI/components/Navigation/ErrorPage.qml +48 -48
- RinUI/components/Navigation/NavigationBar.qml +179 -179
- RinUI/components/Navigation/NavigationItem.qml +193 -193
- RinUI/components/Navigation/NavigationSubItem.qml +103 -103
- RinUI/components/Navigation/NavigationView.qml +228 -227
- RinUI/components/Navigation/Segmented.qml +17 -0
- RinUI/components/Navigation/SegmentedItem.qml +108 -0
- RinUI/components/Navigation/SelectorBar.qml +12 -57
- RinUI/components/Navigation/SelectorBarItem.qml +89 -0
- RinUI/components/ScrollBar.qml +204 -204
- RinUI/components/ScrollView.qml +12 -12
- RinUI/components/Shadow.qml +47 -47
- RinUI/components/StatusAndInfo/InfoBadge.qml +77 -77
- RinUI/components/StatusAndInfo/InfoBar.qml +256 -251
- RinUI/components/StatusAndInfo/ProgressBar.qml +126 -126
- RinUI/components/StatusAndInfo/ProgressRing.qml +149 -0
- RinUI/components/StatusAndInfo/Toast.qml +236 -236
- RinUI/components/StatusAndInfo/ToolTip.qml +93 -93
- RinUI/components/Text/SpinBox.qml +150 -133
- RinUI/components/Text/Text.qml +44 -44
- RinUI/components/Text/TextArea.qml +117 -117
- RinUI/components/Text/TextField.qml +113 -113
- RinUI/components/Text/TextInput.qml +47 -47
- RinUI/components/qmldir +80 -77
- RinUI/core/__init__.py +4 -4
- RinUI/core/config.py +129 -129
- RinUI/core/launcher.py +129 -129
- RinUI/core/theme.py +339 -339
- RinUI/core/translator.py +25 -25
- RinUI/hooks/__init__.py +3 -3
- RinUI/hooks/hook-RinUI.py +3 -3
- RinUI/qmldir +108 -97
- RinUI/themes/Appearance.qml +36 -0
- RinUI/themes/Colors.qml +36 -0
- RinUI/themes/dark.qml +145 -136
- RinUI/themes/light.qml +145 -136
- RinUI/themes/qmldir +9 -6
- RinUI/themes/theme.qml +151 -149
- RinUI/themes/utils.qml +37 -37
- RinUI/utils/Animation.qml +12 -12
- RinUI/utils/FloatLayer.qml +132 -123
- RinUI/utils/FontIconLoader.qml +13 -13
- RinUI/utils/Position.qml +19 -19
- RinUI/utils/Severity.qml +13 -13
- RinUI/utils/Typography.qml +17 -17
- RinUI/utils/qmldir +4 -4
- RinUI/windows/CtrlBtn.qml +118 -118
- RinUI/windows/FluentPage.qml +92 -92
- RinUI/windows/FluentWindow.qml +31 -30
- RinUI/windows/FluentWindowBase.qml +158 -158
- RinUI/windows/TitleBar.qml +135 -135
- RinUI/windows/qmldir +7 -7
- RinUI/windows/window/ApplicationWindow.qml +8 -8
- RinUI/windows/window/Window.qml +118 -118
- {rinui-0.0.11.data → rinui-0.1.1.data}/data/LICENSE +21 -21
- {rinui-0.0.11.data → rinui-0.1.1.data}/data/README.md +100 -97
- {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/METADATA +116 -112
- rinui-0.1.1.dist-info/RECORD +112 -0
- {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/WHEEL +1 -1
- {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info/licenses}/LICENSE +21 -21
- RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
- RinUI/config/rin_ui.json +0 -8
- RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
- rinui-0.0.11.dist-info/RECORD +0 -112
- {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/entry_points.txt +0 -0
- {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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
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
|
+
}
|
RinUI/components/IconWidget.qml
CHANGED
@@ -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
|
+
}
|
RinUI/components/Indicator.qml
CHANGED
@@ -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
|
}
|