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,237 +1,237 @@
|
|
1
|
-
import QtQuick 2.15
|
2
|
-
import QtQuick.Layouts 2.15
|
3
|
-
import "../../themes"
|
4
|
-
import "../../components"
|
5
|
-
|
6
|
-
|
7
|
-
Frame {
|
8
|
-
id: infoBar
|
9
|
-
property string title: ""
|
10
|
-
property string text: ""
|
11
|
-
property int timeout: -1
|
12
|
-
property int position: 0
|
13
|
-
property bool isDynamic: false // 动态创建
|
14
|
-
property bool closable: true // 显示关闭按钮
|
15
|
-
property bool iconVisible: true // 显示图标
|
16
|
-
property real startPosX: {
|
17
|
-
switch (position) {
|
18
|
-
case Position.TopLeft:
|
19
|
-
case Position.BottomLeft:
|
20
|
-
return -width / 2;
|
21
|
-
case Position.TopRight:
|
22
|
-
case Position.BottomRight:
|
23
|
-
return width / 2;
|
24
|
-
default:
|
25
|
-
return 0;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
property real startPosY: 0
|
30
|
-
readonly property real endPosX: x
|
31
|
-
|
32
|
-
|
33
|
-
function calculateStartPosY() {
|
34
|
-
switch (position) {
|
35
|
-
case Position.Top:
|
36
|
-
return -height / 2 ;
|
37
|
-
case Position.Bottom:
|
38
|
-
return height / 2 ;
|
39
|
-
default:
|
40
|
-
return 0;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
color: Theme.currentTheme.colors.backgroundAcrylicColor
|
45
|
-
borderColor: Theme.currentTheme.colors.flyoutBorderColor
|
46
|
-
|
47
|
-
// width: 200
|
48
|
-
Layout.fillWidth: true
|
49
|
-
padding: 5
|
50
|
-
leftPadding: 15
|
51
|
-
hoverable: false
|
52
|
-
opacity: 0
|
53
|
-
|
54
|
-
Timer {
|
55
|
-
id: autoCloseTimer
|
56
|
-
interval: timeout
|
57
|
-
running: timeout >= 0
|
58
|
-
repeat: false
|
59
|
-
onTriggered: {
|
60
|
-
// infoBar.visible = false
|
61
|
-
// infoBar.destroy()
|
62
|
-
exitAnimation.start()
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
RowLayout {
|
67
|
-
id: main
|
68
|
-
anchors.fill: parent
|
69
|
-
spacing: 13
|
70
|
-
|
71
|
-
IconWidget {
|
72
|
-
id: iconWidget
|
73
|
-
Layout.preferredHeight: 38
|
74
|
-
Layout.alignment: Qt.AlignTop
|
75
|
-
size: 18
|
76
|
-
icon: {
|
77
|
-
switch (severity) {
|
78
|
-
case Severity.Info: return "ic_fluent_info_20_filled";
|
79
|
-
case Severity.Success: return "ic_fluent_checkmark_circle_20_filled";
|
80
|
-
case Severity.Warning: return "ic_fluent_error_circle_20_filled";
|
81
|
-
case Severity.Error: return "ic_fluent_dismiss_circle_20_filled";
|
82
|
-
default: return "ic_fluent_question_circle_20_filled";
|
83
|
-
}
|
84
|
-
}
|
85
|
-
color: {
|
86
|
-
switch (severity) {
|
87
|
-
case Severity.Info: return Theme.currentTheme.colors.systemAttentionColor;
|
88
|
-
case Severity.Success: return Theme.currentTheme.colors.systemSuccessColor;
|
89
|
-
case Severity.Warning: return Theme.currentTheme.colors.systemCautionColor;
|
90
|
-
case Severity.Error: return Theme.currentTheme.colors.systemCriticalColor;
|
91
|
-
default: return Theme.currentTheme.colors.systemNeutralColor;
|
92
|
-
}
|
93
|
-
}
|
94
|
-
visible: iconVisible
|
95
|
-
}
|
96
|
-
|
97
|
-
Flow {
|
98
|
-
Layout.alignment: Qt.AlignTop
|
99
|
-
Layout.fillWidth: true
|
100
|
-
Layout.topMargin: 3
|
101
|
-
// Layout.bottomMargin: 8
|
102
|
-
spacing: bodyText.wrap ? 0 :12
|
103
|
-
|
104
|
-
Text {
|
105
|
-
id: titleText
|
106
|
-
typography: Typography.BodyStrong
|
107
|
-
text: infoBar.title
|
108
|
-
topPadding: 6
|
109
|
-
}
|
110
|
-
Text {
|
111
|
-
id: bodyText
|
112
|
-
property bool wrap: (parent.width - titleText.width - custom.width - 24) < implicitWidth
|
113
|
-
width: wrap ?
|
114
|
-
parent.width : implicitWidth
|
115
|
-
typography: Typography.Body
|
116
|
-
text: infoBar.text
|
117
|
-
topPadding: wrap? 0 : 6
|
118
|
-
}
|
119
|
-
|
120
|
-
Item {
|
121
|
-
width: parent.width
|
122
|
-
height: bodyText.wrap && custom.children.length > 0 ? 16 : 0
|
123
|
-
}
|
124
|
-
Row {
|
125
|
-
id: custom
|
126
|
-
spacing: 6
|
127
|
-
}
|
128
|
-
Item {
|
129
|
-
width: parent.width
|
130
|
-
height: bodyText.wrap ? 9 : 0
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
RowLayout {
|
135
|
-
id: rights
|
136
|
-
Layout.alignment: Qt.AlignTop
|
137
|
-
|
138
|
-
ToolButton {
|
139
|
-
Layout.alignment: Qt.AlignTop
|
140
|
-
id: closeButton
|
141
|
-
flat: true
|
142
|
-
icon.name: "ic_fluent_dismiss_20_regular"
|
143
|
-
size: 18
|
144
|
-
Layout.preferredWidth: 38
|
145
|
-
Layout.preferredHeight: 38
|
146
|
-
visible: closable
|
147
|
-
onClicked: {
|
148
|
-
exitAnimation.start()
|
149
|
-
// if (infoBar.isDynamic) {
|
150
|
-
// infoBar.destroy()
|
151
|
-
// } else {
|
152
|
-
// infoBar.visible = false
|
153
|
-
// }
|
154
|
-
}
|
155
|
-
ToolTip {
|
156
|
-
text: qsTr("Close")
|
157
|
-
parent: parent
|
158
|
-
visible: parent.hovered
|
159
|
-
}
|
160
|
-
}
|
161
|
-
}
|
162
|
-
}
|
163
|
-
|
164
|
-
|
165
|
-
// Animations
|
166
|
-
Component.onCompleted: {
|
167
|
-
startPosY = calculateStartPosY();
|
168
|
-
enterAnimation.start()
|
169
|
-
}
|
170
|
-
|
171
|
-
// Behavior on y { NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint } }
|
172
|
-
transform: Translate {
|
173
|
-
id: slideTransform
|
174
|
-
y: 0
|
175
|
-
}
|
176
|
-
|
177
|
-
ParallelAnimation {
|
178
|
-
id: enterAnimation
|
179
|
-
|
180
|
-
NumberAnimation{
|
181
|
-
target: infoBar
|
182
|
-
property: "x"
|
183
|
-
from: infoBar.startPosX
|
184
|
-
to: infoBar.endPosX
|
185
|
-
easing.type: Easing.OutQuart
|
186
|
-
duration: Utils.animationSpeed
|
187
|
-
}
|
188
|
-
NumberAnimation {
|
189
|
-
target: slideTransform
|
190
|
-
property: "y"
|
191
|
-
from: infoBar.startPosY
|
192
|
-
to: 0
|
193
|
-
easing.type: Easing.OutCubic
|
194
|
-
duration: Utils.animationSpeed
|
195
|
-
}
|
196
|
-
NumberAnimation{
|
197
|
-
target: infoBar
|
198
|
-
property: "opacity"
|
199
|
-
from: 0
|
200
|
-
to: 1
|
201
|
-
duration: Utils.appearanceSpeed
|
202
|
-
}
|
203
|
-
}
|
204
|
-
|
205
|
-
SequentialAnimation{
|
206
|
-
id: exitAnimation
|
207
|
-
|
208
|
-
ParallelAnimation{
|
209
|
-
NumberAnimation{
|
210
|
-
target: infoBar
|
211
|
-
property: "y"
|
212
|
-
to: infoBar.startPosY
|
213
|
-
easing.type: Easing.OutQuart
|
214
|
-
duration: Utils.animationSpeed
|
215
|
-
running: false
|
216
|
-
}
|
217
|
-
NumberAnimation{
|
218
|
-
target: infoBar
|
219
|
-
property: "opacity"
|
220
|
-
from: 1
|
221
|
-
to: 0
|
222
|
-
duration: Utils.appearanceSpeed
|
223
|
-
}
|
224
|
-
}
|
225
|
-
ScriptAction{
|
226
|
-
script: {
|
227
|
-
if (infoBar.isDynamic) {
|
228
|
-
infoBar.destroy()
|
229
|
-
} else {
|
230
|
-
infoBar.visible = false
|
231
|
-
infoBar.opacity = 1
|
232
|
-
infoBar.y = 0
|
233
|
-
}
|
234
|
-
}
|
235
|
-
}
|
236
|
-
}
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Layouts 2.15
|
3
|
+
import "../../themes"
|
4
|
+
import "../../components"
|
5
|
+
|
6
|
+
|
7
|
+
Frame {
|
8
|
+
id: infoBar
|
9
|
+
property string title: ""
|
10
|
+
property string text: ""
|
11
|
+
property int timeout: -1
|
12
|
+
property int position: 0
|
13
|
+
property bool isDynamic: false // 动态创建
|
14
|
+
property bool closable: true // 显示关闭按钮
|
15
|
+
property bool iconVisible: true // 显示图标
|
16
|
+
property real startPosX: {
|
17
|
+
switch (position) {
|
18
|
+
case Position.TopLeft:
|
19
|
+
case Position.BottomLeft:
|
20
|
+
return -width / 2;
|
21
|
+
case Position.TopRight:
|
22
|
+
case Position.BottomRight:
|
23
|
+
return width / 2;
|
24
|
+
default:
|
25
|
+
return 0;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
property real startPosY: 0
|
30
|
+
readonly property real endPosX: x
|
31
|
+
|
32
|
+
|
33
|
+
function calculateStartPosY() {
|
34
|
+
switch (position) {
|
35
|
+
case Position.Top:
|
36
|
+
return -height / 2 ;
|
37
|
+
case Position.Bottom:
|
38
|
+
return height / 2 ;
|
39
|
+
default:
|
40
|
+
return 0;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
color: Theme.currentTheme.colors.backgroundAcrylicColor
|
45
|
+
borderColor: Theme.currentTheme.colors.flyoutBorderColor
|
46
|
+
|
47
|
+
// width: 200
|
48
|
+
Layout.fillWidth: true
|
49
|
+
padding: 5
|
50
|
+
leftPadding: 15
|
51
|
+
hoverable: false
|
52
|
+
opacity: 0
|
53
|
+
|
54
|
+
Timer {
|
55
|
+
id: autoCloseTimer
|
56
|
+
interval: timeout
|
57
|
+
running: timeout >= 0
|
58
|
+
repeat: false
|
59
|
+
onTriggered: {
|
60
|
+
// infoBar.visible = false
|
61
|
+
// infoBar.destroy()
|
62
|
+
exitAnimation.start()
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
RowLayout {
|
67
|
+
id: main
|
68
|
+
anchors.fill: parent
|
69
|
+
spacing: 13
|
70
|
+
|
71
|
+
IconWidget {
|
72
|
+
id: iconWidget
|
73
|
+
Layout.preferredHeight: 38
|
74
|
+
Layout.alignment: Qt.AlignTop
|
75
|
+
size: 18
|
76
|
+
icon: {
|
77
|
+
switch (severity) {
|
78
|
+
case Severity.Info: return "ic_fluent_info_20_filled";
|
79
|
+
case Severity.Success: return "ic_fluent_checkmark_circle_20_filled";
|
80
|
+
case Severity.Warning: return "ic_fluent_error_circle_20_filled";
|
81
|
+
case Severity.Error: return "ic_fluent_dismiss_circle_20_filled";
|
82
|
+
default: return "ic_fluent_question_circle_20_filled";
|
83
|
+
}
|
84
|
+
}
|
85
|
+
color: {
|
86
|
+
switch (severity) {
|
87
|
+
case Severity.Info: return Theme.currentTheme.colors.systemAttentionColor;
|
88
|
+
case Severity.Success: return Theme.currentTheme.colors.systemSuccessColor;
|
89
|
+
case Severity.Warning: return Theme.currentTheme.colors.systemCautionColor;
|
90
|
+
case Severity.Error: return Theme.currentTheme.colors.systemCriticalColor;
|
91
|
+
default: return Theme.currentTheme.colors.systemNeutralColor;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
visible: iconVisible
|
95
|
+
}
|
96
|
+
|
97
|
+
Flow {
|
98
|
+
Layout.alignment: Qt.AlignTop
|
99
|
+
Layout.fillWidth: true
|
100
|
+
Layout.topMargin: 3
|
101
|
+
// Layout.bottomMargin: 8
|
102
|
+
spacing: bodyText.wrap ? 0 :12
|
103
|
+
|
104
|
+
Text {
|
105
|
+
id: titleText
|
106
|
+
typography: Typography.BodyStrong
|
107
|
+
text: infoBar.title
|
108
|
+
topPadding: 6
|
109
|
+
}
|
110
|
+
Text {
|
111
|
+
id: bodyText
|
112
|
+
property bool wrap: (parent.width - titleText.width - custom.width - 24) < implicitWidth
|
113
|
+
width: wrap ?
|
114
|
+
parent.width : implicitWidth
|
115
|
+
typography: Typography.Body
|
116
|
+
text: infoBar.text
|
117
|
+
topPadding: wrap? 0 : 6
|
118
|
+
}
|
119
|
+
|
120
|
+
Item {
|
121
|
+
width: parent.width
|
122
|
+
height: bodyText.wrap && custom.children.length > 0 ? 16 : 0
|
123
|
+
}
|
124
|
+
Row {
|
125
|
+
id: custom
|
126
|
+
spacing: 6
|
127
|
+
}
|
128
|
+
Item {
|
129
|
+
width: parent.width
|
130
|
+
height: bodyText.wrap ? 9 : 0
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
RowLayout {
|
135
|
+
id: rights
|
136
|
+
Layout.alignment: Qt.AlignTop
|
137
|
+
|
138
|
+
ToolButton {
|
139
|
+
Layout.alignment: Qt.AlignTop
|
140
|
+
id: closeButton
|
141
|
+
flat: true
|
142
|
+
icon.name: "ic_fluent_dismiss_20_regular"
|
143
|
+
size: 18
|
144
|
+
Layout.preferredWidth: 38
|
145
|
+
Layout.preferredHeight: 38
|
146
|
+
visible: closable
|
147
|
+
onClicked: {
|
148
|
+
exitAnimation.start()
|
149
|
+
// if (infoBar.isDynamic) {
|
150
|
+
// infoBar.destroy()
|
151
|
+
// } else {
|
152
|
+
// infoBar.visible = false
|
153
|
+
// }
|
154
|
+
}
|
155
|
+
ToolTip {
|
156
|
+
text: qsTr("Close")
|
157
|
+
parent: parent
|
158
|
+
visible: parent.hovered
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
|
165
|
+
// Animations
|
166
|
+
Component.onCompleted: {
|
167
|
+
startPosY = calculateStartPosY();
|
168
|
+
enterAnimation.start()
|
169
|
+
}
|
170
|
+
|
171
|
+
// Behavior on y { NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint } }
|
172
|
+
transform: Translate {
|
173
|
+
id: slideTransform
|
174
|
+
y: 0
|
175
|
+
}
|
176
|
+
|
177
|
+
ParallelAnimation {
|
178
|
+
id: enterAnimation
|
179
|
+
|
180
|
+
NumberAnimation{
|
181
|
+
target: infoBar
|
182
|
+
property: "x"
|
183
|
+
from: infoBar.startPosX
|
184
|
+
to: infoBar.endPosX
|
185
|
+
easing.type: Easing.OutQuart
|
186
|
+
duration: Utils.animationSpeed
|
187
|
+
}
|
188
|
+
NumberAnimation {
|
189
|
+
target: slideTransform
|
190
|
+
property: "y"
|
191
|
+
from: infoBar.startPosY
|
192
|
+
to: 0
|
193
|
+
easing.type: Easing.OutCubic
|
194
|
+
duration: Utils.animationSpeed
|
195
|
+
}
|
196
|
+
NumberAnimation{
|
197
|
+
target: infoBar
|
198
|
+
property: "opacity"
|
199
|
+
from: 0
|
200
|
+
to: 1
|
201
|
+
duration: Utils.appearanceSpeed
|
202
|
+
}
|
203
|
+
}
|
204
|
+
|
205
|
+
SequentialAnimation{
|
206
|
+
id: exitAnimation
|
207
|
+
|
208
|
+
ParallelAnimation{
|
209
|
+
NumberAnimation{
|
210
|
+
target: infoBar
|
211
|
+
property: "y"
|
212
|
+
to: infoBar.startPosY
|
213
|
+
easing.type: Easing.OutQuart
|
214
|
+
duration: Utils.animationSpeed
|
215
|
+
running: false
|
216
|
+
}
|
217
|
+
NumberAnimation{
|
218
|
+
target: infoBar
|
219
|
+
property: "opacity"
|
220
|
+
from: 1
|
221
|
+
to: 0
|
222
|
+
duration: Utils.appearanceSpeed
|
223
|
+
}
|
224
|
+
}
|
225
|
+
ScriptAction{
|
226
|
+
script: {
|
227
|
+
if (infoBar.isDynamic) {
|
228
|
+
infoBar.destroy()
|
229
|
+
} else {
|
230
|
+
infoBar.visible = false
|
231
|
+
infoBar.opacity = 1
|
232
|
+
infoBar.y = 0
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
237
|
}
|
@@ -1,93 +1,93 @@
|
|
1
|
-
import QtQuick 2.15
|
2
|
-
import QtQuick.Controls.Basic 2.15
|
3
|
-
import QtQuick.Shapes 1.15
|
4
|
-
import "../../themes"
|
5
|
-
import "../../components"
|
6
|
-
|
7
|
-
ToolTip {
|
8
|
-
id: tooltip
|
9
|
-
timeout: -1 // 显示时长
|
10
|
-
text: "Tooltip"
|
11
|
-
|
12
|
-
// 公共属性 / Common Properties
|
13
|
-
property color backgroundColor: Theme.currentTheme.colors.backgroundAcrylicColor
|
14
|
-
property color borderColor: Theme.currentTheme.colors.cardBorderColor
|
15
|
-
property color textColor: Theme.currentTheme.colors.textColor
|
16
|
-
property real controlRadius: Theme.currentTheme.appearance.buttonRadius
|
17
|
-
|
18
|
-
function updateStyle() {
|
19
|
-
backgroundColor = Theme.currentTheme.colors.backgroundAcrylicColor
|
20
|
-
borderColor = Theme.currentTheme.colors.cardBorderColor
|
21
|
-
textColor = Theme.currentTheme.colors.textColor
|
22
|
-
controlRadius = Theme.currentTheme.appearance.buttonRadius
|
23
|
-
}
|
24
|
-
|
25
|
-
// 主题切换 / Theme Switching
|
26
|
-
Connections {
|
27
|
-
target: Theme
|
28
|
-
function onCurrentThemeChanged() {
|
29
|
-
updateStyle()
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
Component.onCompleted: updateStyle()
|
34
|
-
|
35
|
-
|
36
|
-
// 颜色动画 / Color Animation
|
37
|
-
Behavior on backgroundColor { ColorAnimation { duration: 150; easing.type: Easing.OutQuart } }
|
38
|
-
Behavior on textColor { ColorAnimation { duration: 150; easing.type: Easing.OutQuart } }
|
39
|
-
Behavior on borderColor { ColorAnimation { duration: 150; easing.type: Easing.OutQuart } }
|
40
|
-
|
41
|
-
property string tipText: text // 传递 tip 文字
|
42
|
-
|
43
|
-
contentItem: Text {
|
44
|
-
id: tooltipText
|
45
|
-
anchors.centerIn: background
|
46
|
-
typography: Typography.Caption
|
47
|
-
text: tipText
|
48
|
-
}
|
49
|
-
|
50
|
-
background: Rectangle {
|
51
|
-
id: background
|
52
|
-
width: tooltipText.width + 20
|
53
|
-
height: tooltipText.height + 13
|
54
|
-
anchors.horizontalCenter: parent.horizontalCenter
|
55
|
-
y: -6
|
56
|
-
|
57
|
-
radius: controlRadius
|
58
|
-
color: backgroundColor
|
59
|
-
border.color: borderColor
|
60
|
-
|
61
|
-
layer.enabled: true
|
62
|
-
layer.effect: Shadow {
|
63
|
-
style: "tooltip"
|
64
|
-
source: background
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
// 动画 / Animation //
|
69
|
-
enter: Transition {
|
70
|
-
ParallelAnimation {
|
71
|
-
NumberAnimation {
|
72
|
-
target: tooltip
|
73
|
-
property: "opacity"
|
74
|
-
from: 0
|
75
|
-
to: 1
|
76
|
-
duration: 250
|
77
|
-
easing.type: Easing.InOutQuart
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
81
|
-
exit: Transition {
|
82
|
-
ParallelAnimation {
|
83
|
-
NumberAnimation {
|
84
|
-
target: tooltip
|
85
|
-
property: "opacity"
|
86
|
-
from: 1
|
87
|
-
to: 0
|
88
|
-
duration: 300
|
89
|
-
easing.type: Easing.InOutQuart
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
}
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Controls.Basic 2.15
|
3
|
+
import QtQuick.Shapes 1.15
|
4
|
+
import "../../themes"
|
5
|
+
import "../../components"
|
6
|
+
|
7
|
+
ToolTip {
|
8
|
+
id: tooltip
|
9
|
+
timeout: -1 // 显示时长
|
10
|
+
text: "Tooltip"
|
11
|
+
|
12
|
+
// 公共属性 / Common Properties
|
13
|
+
property color backgroundColor: Theme.currentTheme.colors.backgroundAcrylicColor
|
14
|
+
property color borderColor: Theme.currentTheme.colors.cardBorderColor
|
15
|
+
property color textColor: Theme.currentTheme.colors.textColor
|
16
|
+
property real controlRadius: Theme.currentTheme.appearance.buttonRadius
|
17
|
+
|
18
|
+
function updateStyle() {
|
19
|
+
backgroundColor = Theme.currentTheme.colors.backgroundAcrylicColor
|
20
|
+
borderColor = Theme.currentTheme.colors.cardBorderColor
|
21
|
+
textColor = Theme.currentTheme.colors.textColor
|
22
|
+
controlRadius = Theme.currentTheme.appearance.buttonRadius
|
23
|
+
}
|
24
|
+
|
25
|
+
// 主题切换 / Theme Switching
|
26
|
+
Connections {
|
27
|
+
target: Theme
|
28
|
+
function onCurrentThemeChanged() {
|
29
|
+
updateStyle()
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
Component.onCompleted: updateStyle()
|
34
|
+
|
35
|
+
|
36
|
+
// 颜色动画 / Color Animation
|
37
|
+
Behavior on backgroundColor { ColorAnimation { duration: 150; easing.type: Easing.OutQuart } }
|
38
|
+
Behavior on textColor { ColorAnimation { duration: 150; easing.type: Easing.OutQuart } }
|
39
|
+
Behavior on borderColor { ColorAnimation { duration: 150; easing.type: Easing.OutQuart } }
|
40
|
+
|
41
|
+
property string tipText: text // 传递 tip 文字
|
42
|
+
|
43
|
+
contentItem: Text {
|
44
|
+
id: tooltipText
|
45
|
+
anchors.centerIn: background
|
46
|
+
typography: Typography.Caption
|
47
|
+
text: tipText
|
48
|
+
}
|
49
|
+
|
50
|
+
background: Rectangle {
|
51
|
+
id: background
|
52
|
+
width: tooltipText.width + 20
|
53
|
+
height: tooltipText.height + 13
|
54
|
+
anchors.horizontalCenter: parent.horizontalCenter
|
55
|
+
y: -6
|
56
|
+
|
57
|
+
radius: controlRadius
|
58
|
+
color: backgroundColor
|
59
|
+
border.color: borderColor
|
60
|
+
|
61
|
+
layer.enabled: true
|
62
|
+
layer.effect: Shadow {
|
63
|
+
style: "tooltip"
|
64
|
+
source: background
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
// 动画 / Animation //
|
69
|
+
enter: Transition {
|
70
|
+
ParallelAnimation {
|
71
|
+
NumberAnimation {
|
72
|
+
target: tooltip
|
73
|
+
property: "opacity"
|
74
|
+
from: 0
|
75
|
+
to: 1
|
76
|
+
duration: 250
|
77
|
+
easing.type: Easing.InOutQuart
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
exit: Transition {
|
82
|
+
ParallelAnimation {
|
83
|
+
NumberAnimation {
|
84
|
+
target: tooltip
|
85
|
+
property: "opacity"
|
86
|
+
from: 1
|
87
|
+
to: 0
|
88
|
+
duration: 300
|
89
|
+
easing.type: Easing.InOutQuart
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|