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