RinUI 0.0.9__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 -0
- RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
- RinUI/assets/fonts/FluentSystemIcons-Index.js +5256 -0
- RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf +0 -0
- RinUI/assets/img/default_app_icon.png +0 -0
- RinUI/components/Base.qml +79 -0
- RinUI/components/BasicInput/Button.qml +148 -0
- RinUI/components/BasicInput/CheckBox.qml +99 -0
- RinUI/components/BasicInput/ComboBox.qml +160 -0
- RinUI/components/BasicInput/DropDownButton.qml +21 -0
- RinUI/components/BasicInput/Hyperlink.qml +18 -0
- RinUI/components/BasicInput/RadioButton.qml +95 -0
- RinUI/components/BasicInput/Slider.qml +212 -0
- RinUI/components/BasicInput/Switch.qml +102 -0
- RinUI/components/BasicInput/ToggleButton.qml +11 -0
- RinUI/components/BasicInput/ToolButton.qml +31 -0
- RinUI/components/ContextMenu.qml +184 -0
- RinUI/components/DateAndTime/PickerView.qml +217 -0
- RinUI/components/DateAndTime/TimePicker.qml +115 -0
- RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -0
- RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -0
- RinUI/components/DialogsAndFlyouts/Flyout.qml +144 -0
- RinUI/components/DialogsAndFlyouts/Popup.qml +106 -0
- RinUI/components/FocusIndicator.qml +33 -0
- RinUI/components/IconWidget.qml +52 -0
- RinUI/components/Indicator.qml +90 -0
- RinUI/components/Layout/Expander.qml +160 -0
- RinUI/components/Layout/SettingExpander.qml +67 -0
- RinUI/components/Layout/SettingItem.qml +71 -0
- RinUI/components/ListAndCollections/Clip.qml +22 -0
- RinUI/components/ListAndCollections/Frame.qml +44 -0
- RinUI/components/ListAndCollections/ListView.qml +105 -0
- RinUI/components/ListAndCollections/ListViewDelegate.qml +83 -0
- RinUI/components/ListAndCollections/SettingCard.qml +73 -0
- RinUI/components/ListAndCollections/TableView.qml +82 -0
- RinUI/components/ListAndCollections/TableViewDelegate.qml +89 -0
- RinUI/components/MenusAndToolbars/Menu.qml +149 -0
- RinUI/components/MenusAndToolbars/MenuBar.qml +43 -0
- RinUI/components/MenusAndToolbars/MenuItem.qml +119 -0
- RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -0
- RinUI/components/MenusAndToolbars/MenuSeparator.qml +14 -0
- RinUI/components/MenusAndToolbars/ToolSeparator.qml +17 -0
- RinUI/components/Navigation/ErrorPage.qml +48 -0
- RinUI/components/Navigation/NavigationBar.qml +179 -0
- RinUI/components/Navigation/NavigationItem.qml +193 -0
- RinUI/components/Navigation/NavigationSubItem.qml +103 -0
- RinUI/components/Navigation/NavigationView.qml +210 -0
- RinUI/components/Navigation/SelectorBar.qml +58 -0
- RinUI/components/ScrollBar.qml +163 -0
- RinUI/components/ScrollView.qml +13 -0
- RinUI/components/Shadow.qml +48 -0
- RinUI/components/StatusAndInfo/InfoBadge.qml +78 -0
- RinUI/components/StatusAndInfo/InfoBar.qml +246 -0
- RinUI/components/StatusAndInfo/ProgressBar.qml +127 -0
- RinUI/components/StatusAndInfo/Toast.qml +237 -0
- RinUI/components/StatusAndInfo/ToolTip.qml +93 -0
- RinUI/components/Text/SpinBox.qml +134 -0
- RinUI/components/Text/Text.qml +44 -0
- RinUI/components/Text/TextField.qml +94 -0
- RinUI/components/Text/TextInput.qml +29 -0
- RinUI/components/Utils/Blur.qml +42 -0
- RinUI/components/qmldir +76 -0
- RinUI/config/rin_ui.json +8 -0
- RinUI/core/__init__.py +3 -0
- 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/config.py +109 -0
- RinUI/core/launcher.py +144 -0
- RinUI/core/theme.py +342 -0
- RinUI/hooks/__init__.py +3 -0
- RinUI/hooks/hook-RinUI.py +3 -0
- RinUI/qmldir +92 -0
- RinUI/themes/dark.qml +137 -0
- RinUI/themes/light.qml +137 -0
- RinUI/themes/qmldir +7 -0
- RinUI/themes/theme.qml +126 -0
- RinUI/themes/utils.qml +28 -0
- RinUI/utils/Animation.qml +12 -0
- RinUI/utils/FloatLayer.qml +123 -0
- RinUI/utils/FontIconLoader.qml +14 -0
- RinUI/utils/Position.qml +19 -0
- RinUI/utils/Severity.qml +13 -0
- RinUI/utils/Typography.qml +17 -0
- RinUI/utils/qmldir +5 -0
- RinUI/windows/CtrlBtn.qml +119 -0
- RinUI/windows/FluentPage.qml +92 -0
- RinUI/windows/FluentWindow.qml +32 -0
- RinUI/windows/FluentWindowBase.qml +157 -0
- RinUI/windows/TitleBar.qml +132 -0
- RinUI/windows/qmldir +8 -0
- RinUI/windows/window/ApplicationWindow.qml +9 -0
- RinUI/windows/window/Window.qml +112 -0
- rinui-0.0.9.data/data/LICENSE +21 -0
- rinui-0.0.9.data/data/README.md +90 -0
- rinui-0.0.9.dist-info/LICENSE +21 -0
- rinui-0.0.9.dist-info/METADATA +105 -0
- rinui-0.0.9.dist-info/RECORD +102 -0
- rinui-0.0.9.dist-info/WHEEL +5 -0
- rinui-0.0.9.dist-info/entry_points.txt +2 -0
- rinui-0.0.9.dist-info/top_level.txt +1 -0
@@ -0,0 +1,217 @@
|
|
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
|
+
Popup {
|
8
|
+
id: root
|
9
|
+
|
10
|
+
width: 300
|
11
|
+
height: 330
|
12
|
+
implicitHeight: 330
|
13
|
+
y: -height / 2 + buttonRow.height
|
14
|
+
position: Position.Center // RinUI popup自定义属性
|
15
|
+
|
16
|
+
property var value1: undefined
|
17
|
+
property var value2: undefined
|
18
|
+
property var value3: undefined
|
19
|
+
|
20
|
+
property var model1: 12
|
21
|
+
property var model2: 60
|
22
|
+
property var model3: [qsTr("AM"), qsTr("PM")]
|
23
|
+
|
24
|
+
readonly property bool gotData: typeof value1!== "undefined" && typeof value2!== "undefined"
|
25
|
+
|
26
|
+
function formatText(count, modelData) {
|
27
|
+
let data = count === 60 ? modelData : modelData;
|
28
|
+
return data.toString().length < 2 && count !== 12 ? "0" + data
|
29
|
+
: data === 0 && count === 12 ? 12 : data
|
30
|
+
}
|
31
|
+
|
32
|
+
property int visibleItemCount: 7
|
33
|
+
|
34
|
+
// 数字/文字 选择 //
|
35
|
+
Component {
|
36
|
+
id: delegateComponent
|
37
|
+
|
38
|
+
Text {
|
39
|
+
readonly property bool highlighted: Tumbler.displacement < 0.5 && Tumbler.displacement > -0.5
|
40
|
+
text: formatText(Tumbler.tumbler.count, modelData)
|
41
|
+
color: highlighted? Theme.currentTheme.colors.textOnAccentColor : Theme.currentTheme.colors.textColor
|
42
|
+
horizontalAlignment: Text.AlignHCenter
|
43
|
+
verticalAlignment: Text.AlignVCenter
|
44
|
+
|
45
|
+
// 点击选择喵 看看啥时候把背景加上
|
46
|
+
MouseArea {
|
47
|
+
anchors.fill: parent
|
48
|
+
onClicked: Tumbler.tumbler.currentIndex = index
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
padding: 0
|
53
|
+
|
54
|
+
ColumnLayout {
|
55
|
+
id: columnLayout
|
56
|
+
anchors.fill: parent
|
57
|
+
spacing: -2
|
58
|
+
|
59
|
+
Frame {
|
60
|
+
Layout.fillWidth: true
|
61
|
+
Layout.fillHeight: true
|
62
|
+
padding: 0
|
63
|
+
leftPadding: 4
|
64
|
+
rightPadding: 4
|
65
|
+
|
66
|
+
frameless: true
|
67
|
+
background: Rectangle {
|
68
|
+
id: highlightBackground
|
69
|
+
anchors.centerIn: parent
|
70
|
+
height: 40
|
71
|
+
radius: Theme.currentTheme.appearance.buttonRadius
|
72
|
+
color: Theme.currentTheme.colors.primaryColor
|
73
|
+
width: parent.width - parent.leftPadding - parent.rightPadding
|
74
|
+
}
|
75
|
+
|
76
|
+
RowLayout {
|
77
|
+
id: tumblerRow
|
78
|
+
anchors.fill: parent
|
79
|
+
|
80
|
+
Tumbler {
|
81
|
+
Layout.fillWidth: true
|
82
|
+
Layout.fillHeight: true
|
83
|
+
id: hours
|
84
|
+
model: model1
|
85
|
+
visibleItemCount: root.visibleItemCount
|
86
|
+
delegate: delegateComponent
|
87
|
+
|
88
|
+
}
|
89
|
+
ToolSeparator {
|
90
|
+
Layout.fillHeight: true
|
91
|
+
}
|
92
|
+
Tumbler {
|
93
|
+
Layout.fillWidth: true
|
94
|
+
Layout.fillHeight: true
|
95
|
+
id: minutes
|
96
|
+
model: model2
|
97
|
+
visibleItemCount: root.visibleItemCount
|
98
|
+
delegate: delegateComponent
|
99
|
+
}
|
100
|
+
ToolSeparator {
|
101
|
+
Layout.fillHeight: true
|
102
|
+
visible: added.visible
|
103
|
+
}
|
104
|
+
Tumbler {
|
105
|
+
Layout.fillWidth: true
|
106
|
+
Layout.fillHeight: true
|
107
|
+
id: added
|
108
|
+
model: model3
|
109
|
+
visibleItemCount: root.visibleItemCount
|
110
|
+
delegate: delegateComponent
|
111
|
+
visible: typeof model3 !== "undefined"
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
Rectangle { // 分割线
|
117
|
+
Layout.fillWidth: true
|
118
|
+
implicitHeight: 1
|
119
|
+
color: Theme.currentTheme.colors.dividerBorderColor
|
120
|
+
}
|
121
|
+
|
122
|
+
// 确认/取消 按钮区域
|
123
|
+
RowLayout {
|
124
|
+
id: buttonRow
|
125
|
+
Layout.fillWidth: true
|
126
|
+
Layout.leftMargin: 4
|
127
|
+
Layout.rightMargin: 4
|
128
|
+
spacing: 0
|
129
|
+
|
130
|
+
// confirm
|
131
|
+
ToolButton {
|
132
|
+
Layout.fillWidth: true
|
133
|
+
flat: true
|
134
|
+
icon.name: "ic_fluent_checkmark_20_regular"
|
135
|
+
onClicked: {
|
136
|
+
value1 = hours.currentItem.text
|
137
|
+
value2 = minutes.currentItem.text
|
138
|
+
typeof model3 !== "undefined" ? value3 = added.currentItem.text : undefined
|
139
|
+
root.close()
|
140
|
+
}
|
141
|
+
}
|
142
|
+
ToolSeparator {
|
143
|
+
implicitHeight: 40
|
144
|
+
}
|
145
|
+
// cancel
|
146
|
+
ToolButton {
|
147
|
+
Layout.fillWidth: true
|
148
|
+
flat: true
|
149
|
+
icon.name: "ic_fluent_dismiss_20_regular"
|
150
|
+
onClicked: {
|
151
|
+
root.close()
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
enter: Transition {
|
158
|
+
ParallelAnimation {
|
159
|
+
NumberAnimation {
|
160
|
+
target: root
|
161
|
+
property: "opacity"
|
162
|
+
from: 0
|
163
|
+
to: 1
|
164
|
+
duration: Utils.appearanceSpeed
|
165
|
+
easing.type: Easing.OutQuint
|
166
|
+
}
|
167
|
+
NumberAnimation {
|
168
|
+
target: root
|
169
|
+
property: "height"
|
170
|
+
from: implicitHeight / 2
|
171
|
+
to: implicitHeight
|
172
|
+
duration: Utils.animationSpeedMiddle * 0.8
|
173
|
+
easing.type: Easing.OutQuint
|
174
|
+
}
|
175
|
+
ScriptAction {
|
176
|
+
script: {
|
177
|
+
hours.positionViewAtIndex(
|
178
|
+
typeof value1 === "undefined" ? 0
|
179
|
+
: typeof model1 === "number" ? value1 : model1.indexOf(value1), Tumbler.Center
|
180
|
+
)
|
181
|
+
minutes.positionViewAtIndex(
|
182
|
+
typeof value2 === "undefined" ? 0
|
183
|
+
: typeof model2 === "number" ? value2 : model2.indexOf(value2), Tumbler.Center
|
184
|
+
)
|
185
|
+
added.positionViewAtIndex(
|
186
|
+
typeof value3 === "undefined" ? 0
|
187
|
+
: typeof model3 === "number" ? value3 : model3.indexOf(value3), Tumbler.Center
|
188
|
+
)
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
background: Rectangle {
|
195
|
+
id: background
|
196
|
+
anchors.fill: parent
|
197
|
+
anchors.horizontalCenter: parent.horizontalCenter
|
198
|
+
y: -6
|
199
|
+
|
200
|
+
radius: Theme.currentTheme.appearance.windowRadius
|
201
|
+
color: Theme.currentTheme.colors.backgroundAcrylicColor
|
202
|
+
border.color: Theme.currentTheme.colors.flyoutBorderColor
|
203
|
+
|
204
|
+
Behavior on color {
|
205
|
+
ColorAnimation {
|
206
|
+
duration: Utils.appearanceSpeed
|
207
|
+
easing.type: Easing.OutQuart
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
layer.enabled: true
|
212
|
+
layer.effect: Shadow {
|
213
|
+
style: "flyout"
|
214
|
+
source: background
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
@@ -0,0 +1,115 @@
|
|
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
|
+
Button {
|
8
|
+
id: timePickerButton
|
9
|
+
|
10
|
+
property string amText: qsTr("AM")
|
11
|
+
property string pmText: qsTr("PM")
|
12
|
+
property string hourText: qsTr("hour")
|
13
|
+
property string minuteText: qsTr("minute")
|
14
|
+
|
15
|
+
// 是否使用24小时制
|
16
|
+
property bool use24Hour: false
|
17
|
+
|
18
|
+
property alias hour: pickerView.value1
|
19
|
+
property alias minute: pickerView.value2
|
20
|
+
property alias hourSystem: pickerView.value3
|
21
|
+
|
22
|
+
implicitWidth: 250
|
23
|
+
padding: 0
|
24
|
+
|
25
|
+
// 获取 / 设置时间 // Get / Set time (hh:mm)
|
26
|
+
// 获取 / 设置时间 (hh:mm)
|
27
|
+
property string time: {
|
28
|
+
if (!pickerView.gotData) return ""
|
29
|
+
let h = parseInt(hour)
|
30
|
+
if (!use24Hour) {
|
31
|
+
if (hourSystem === pmText && h < 12) h += 12
|
32
|
+
if (hourSystem === amText && h === 12) h = 0
|
33
|
+
}
|
34
|
+
let hh = h < 10 ? "0" + h : "" + h
|
35
|
+
let mm = parseInt(minute)
|
36
|
+
let mmStr = mm < 10 ? "0" + mm : "" + mm
|
37
|
+
return hh + ":" + mmStr
|
38
|
+
}
|
39
|
+
|
40
|
+
function setTime(hhmm) {
|
41
|
+
if (!hhmm || typeof hhmm !== "string" || !hhmm.match(/^\d{2}:\d{2}$/)) return
|
42
|
+
|
43
|
+
let parts = hhmm.split(":")
|
44
|
+
let h = parseInt(parts[0])
|
45
|
+
let m = parseInt(parts[1])
|
46
|
+
|
47
|
+
if (h >= 0 && h < 24 && m >= 0 && m < 60) {
|
48
|
+
if (use24Hour) {
|
49
|
+
pickerView.value1 = h.toString()
|
50
|
+
pickerView.value2 = m.toString()
|
51
|
+
pickerView.value3 = undefined
|
52
|
+
} else {
|
53
|
+
pickerView.value1 = ((h % 12 === 0) ? 12 : h % 12).toString()
|
54
|
+
pickerView.value2 = m.toString()
|
55
|
+
pickerView.value3 = h >= 12 ? pmText : amText
|
56
|
+
}
|
57
|
+
pickerView.gotData = true
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
// 重写按钮结果
|
62
|
+
contentItem: RowLayout {
|
63
|
+
anchors.fill: parent
|
64
|
+
spacing: 0
|
65
|
+
|
66
|
+
Text {
|
67
|
+
Layout.fillWidth: true
|
68
|
+
Layout.maximumWidth: use24Hour ? timePickerButton.implicitWidth / 2 : timePickerButton.implicitWidth / 3
|
69
|
+
color: pickerView.gotData ? Theme.currentTheme.colors.textColor
|
70
|
+
: Theme.currentTheme.colors.textSecondaryColor
|
71
|
+
horizontalAlignment: Text.AlignHCenter
|
72
|
+
verticalAlignment: Text.AlignVCenter
|
73
|
+
|
74
|
+
text: pickerView.gotData ? pickerView.value1 : hourText
|
75
|
+
}
|
76
|
+
ToolSeparator {
|
77
|
+
implicitHeight: 32
|
78
|
+
}
|
79
|
+
Text {
|
80
|
+
Layout.fillWidth: true
|
81
|
+
Layout.maximumWidth: use24Hour ? timePickerButton.implicitWidth / 2 : timePickerButton.implicitWidth / 3
|
82
|
+
color: pickerView.gotData ? Theme.currentTheme.colors.textColor
|
83
|
+
: Theme.currentTheme.colors.textSecondaryColor
|
84
|
+
horizontalAlignment: Text.AlignHCenter
|
85
|
+
verticalAlignment: Text.AlignVCenter
|
86
|
+
|
87
|
+
text: pickerView.gotData ? pickerView.value2 : minuteText
|
88
|
+
}
|
89
|
+
ToolSeparator {
|
90
|
+
implicitHeight: 32
|
91
|
+
visible: !use24Hour
|
92
|
+
}
|
93
|
+
Text {
|
94
|
+
Layout.fillWidth: true
|
95
|
+
Layout.maximumWidth: timePickerButton.implicitWidth / 3
|
96
|
+
color: pickerView.gotData ? Theme.currentTheme.colors.textColor
|
97
|
+
: Theme.currentTheme.colors.textSecondaryColor
|
98
|
+
horizontalAlignment: Text.AlignHCenter
|
99
|
+
verticalAlignment: Text.AlignVCenter
|
100
|
+
|
101
|
+
text: pickerView.gotData ? pickerView.value3 : amText
|
102
|
+
visible: !use24Hour
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
onClicked: pickerView.open()
|
107
|
+
|
108
|
+
PickerView {
|
109
|
+
id: pickerView
|
110
|
+
width: parent.width
|
111
|
+
|
112
|
+
model1: use24Hour ? 24 : 12
|
113
|
+
model3: use24Hour ? undefined : [amText, pmText]
|
114
|
+
}
|
115
|
+
}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Controls 2.15
|
3
|
+
import QtQuick.Layouts 2.15
|
4
|
+
import "../../themes"
|
5
|
+
import "../../components"
|
6
|
+
|
7
|
+
|
8
|
+
Dialog {
|
9
|
+
id: root
|
10
|
+
|
11
|
+
property bool titleBarVisible: false
|
12
|
+
|
13
|
+
anchors.centerIn: Overlay.overlay // Center in the overlay
|
14
|
+
closePolicy: Popup.NoAutoClose // 更符合fds规范
|
15
|
+
|
16
|
+
padding: 24
|
17
|
+
topPadding: 24
|
18
|
+
bottomPadding: 24
|
19
|
+
implicitWidth: Math.max(Utils.dialogMinimumWidth, Math.min(implicitContentWidth + 48, Utils.dialogMaximumWidth))
|
20
|
+
|
21
|
+
contentItem: ColumnLayout {
|
22
|
+
spacing: 12
|
23
|
+
Text {
|
24
|
+
Layout.fillWidth: true
|
25
|
+
typography: Typography.Subtitle
|
26
|
+
text: root.title
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
header: Item {}
|
32
|
+
|
33
|
+
// 定制footer
|
34
|
+
footer: DialogButtonBox {
|
35
|
+
id: buttonBox
|
36
|
+
standardButtons: root.standardButtons
|
37
|
+
}
|
38
|
+
|
39
|
+
background: Rectangle {
|
40
|
+
id: background
|
41
|
+
anchors.fill: parent
|
42
|
+
color: Theme.currentTheme.colors.backgroundAcrylicColor
|
43
|
+
border.color: Theme.currentTheme.colors.windowBorderColor
|
44
|
+
border.width: 1
|
45
|
+
radius: Theme.currentTheme.appearance.windowRadius
|
46
|
+
|
47
|
+
Behavior on color {
|
48
|
+
ColorAnimation {
|
49
|
+
duration: Utils.backdropEnabled ? 0 : 150
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
layer.enabled: true
|
54
|
+
layer.effect: Shadow {
|
55
|
+
style: "dialog"
|
56
|
+
source: background
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
Overlay.modal: Rectangle {
|
61
|
+
color: Theme.currentTheme.colors.backgroundSmokeColor
|
62
|
+
}
|
63
|
+
|
64
|
+
// 动画 / Animation //
|
65
|
+
enter: Transition {
|
66
|
+
ParallelAnimation {
|
67
|
+
NumberAnimation {
|
68
|
+
target: root
|
69
|
+
property: "opacity"
|
70
|
+
from: 0
|
71
|
+
to: 1
|
72
|
+
duration: Utils.appearanceSpeed
|
73
|
+
easing.type: Easing.InOutQuart
|
74
|
+
}
|
75
|
+
NumberAnimation {
|
76
|
+
target: root
|
77
|
+
property: "scale"
|
78
|
+
from: 1.1
|
79
|
+
to: 1
|
80
|
+
duration: Utils.animationSpeedMiddle
|
81
|
+
easing.type: Easing.OutQuint
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
exit: Transition {
|
87
|
+
ParallelAnimation {
|
88
|
+
NumberAnimation {
|
89
|
+
target: root
|
90
|
+
property: "opacity"
|
91
|
+
from: 1
|
92
|
+
to: 0
|
93
|
+
duration: 100
|
94
|
+
easing.type: Easing.InOutQuart
|
95
|
+
}
|
96
|
+
NumberAnimation {
|
97
|
+
target: root
|
98
|
+
property: "scale"
|
99
|
+
from: 1
|
100
|
+
to: 1.1
|
101
|
+
duration: Utils.animationSpeedMiddle
|
102
|
+
easing.type: Easing.OutQuint
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Controls 2.15
|
3
|
+
import QtQuick.Layouts 2.15
|
4
|
+
import "../../components"
|
5
|
+
|
6
|
+
|
7
|
+
DialogButtonBox {
|
8
|
+
id: buttonBox
|
9
|
+
|
10
|
+
implicitWidth: 320
|
11
|
+
|
12
|
+
background: Rectangle {
|
13
|
+
anchors.fill: parent
|
14
|
+
color: Theme.currentTheme.colors.backgroundColor
|
15
|
+
border.color: Theme.currentTheme.colors.windowBorderColor
|
16
|
+
radius: Theme.currentTheme.appearance.windowRadius
|
17
|
+
|
18
|
+
Rectangle {
|
19
|
+
anchors.top: parent.top
|
20
|
+
anchors.left: parent.left
|
21
|
+
anchors.right: parent.right
|
22
|
+
anchors.margins: 1
|
23
|
+
height: parent.radius
|
24
|
+
color: parent.color
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
padding: 24
|
29
|
+
spacing: 8
|
30
|
+
|
31
|
+
alignment: undefined
|
32
|
+
|
33
|
+
contentItem: RowLayout {
|
34
|
+
spacing: buttonBox.spacing
|
35
|
+
|
36
|
+
Repeater {
|
37
|
+
model: buttonBox.contentModel
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
delegate: Button {
|
42
|
+
Layout.alignment: Qt.AlignRight
|
43
|
+
Layout.preferredWidth: buttonBox.availableWidth / 2
|
44
|
+
Layout.fillWidth: !(buttonBox.count === 1)
|
45
|
+
highlighted: DialogButtonBox.buttonRole === DialogButtonBox.AcceptRole // 高亮
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,144 @@
|
|
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: flyout
|
10
|
+
property string text: "Flyout"
|
11
|
+
property alias buttonBox: buttonLayout.data // 按钮列表
|
12
|
+
property string image: "" // 图片
|
13
|
+
property real maximumWidth: 350 // 最大宽度
|
14
|
+
|
15
|
+
position: Position.Top
|
16
|
+
|
17
|
+
padding: 16
|
18
|
+
|
19
|
+
// 坐标
|
20
|
+
|
21
|
+
contentItem: ColumnLayout {
|
22
|
+
spacing: 0
|
23
|
+
|
24
|
+
Image {
|
25
|
+
id: flyoutImg
|
26
|
+
Layout.fillWidth: true
|
27
|
+
Layout.maximumWidth: maximumWidth
|
28
|
+
Layout.margins: -flyout.padding + 2
|
29
|
+
Layout.bottomMargin: 0
|
30
|
+
Layout.preferredHeight: width * (sourceSize.height / sourceSize.width)
|
31
|
+
fillMode: Image.PreserveAspectCrop
|
32
|
+
source: flyout.image
|
33
|
+
visible: flyout.image !== ""
|
34
|
+
|
35
|
+
layer.enabled: true
|
36
|
+
layer.smooth: true
|
37
|
+
layer.effect: OpacityMask {
|
38
|
+
maskSource: Rectangle {
|
39
|
+
width: flyoutImg.width
|
40
|
+
height: flyoutImg.height
|
41
|
+
radius: background.radius
|
42
|
+
color: "black"
|
43
|
+
|
44
|
+
Rectangle {
|
45
|
+
anchors.bottom: parent.bottom
|
46
|
+
width: parent.width
|
47
|
+
height: background.radius
|
48
|
+
color: "black"
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
Item {
|
55
|
+
height: 16
|
56
|
+
visible: flyoutImg.visible
|
57
|
+
}
|
58
|
+
|
59
|
+
Text {
|
60
|
+
id: flyoutText
|
61
|
+
Layout.fillWidth: true
|
62
|
+
Layout.maximumWidth: maximumWidth
|
63
|
+
typography: Typography.Body
|
64
|
+
text: flyout.text
|
65
|
+
}
|
66
|
+
|
67
|
+
Item {
|
68
|
+
height: 16
|
69
|
+
visible: buttonLayout.children.length > 0
|
70
|
+
}
|
71
|
+
|
72
|
+
RowLayout {
|
73
|
+
Layout.fillWidth: true
|
74
|
+
id: buttonLayout
|
75
|
+
spacing: 8
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
// background: Rectangle {
|
80
|
+
// id: background
|
81
|
+
// anchors.fill: parent
|
82
|
+
// anchors.horizontalCenter: parent.horizontalCenter
|
83
|
+
// y: -6
|
84
|
+
//
|
85
|
+
// radius: Theme.currentTheme.appearance.windowRadius
|
86
|
+
// color: Theme.currentTheme.colors.backgroundAcrylicColor
|
87
|
+
// border.color: Theme.currentTheme.colors.flyoutBorderColor
|
88
|
+
//
|
89
|
+
// Behavior on color {
|
90
|
+
// ColorAnimation {
|
91
|
+
// duration: Utils.appearanceSpeed
|
92
|
+
// easing.type: Easing.OutQuart
|
93
|
+
// }
|
94
|
+
// }
|
95
|
+
//
|
96
|
+
// layer.enabled: true
|
97
|
+
// layer.effect: Shadow {
|
98
|
+
// style: "flyout"
|
99
|
+
// source: background
|
100
|
+
// }
|
101
|
+
// }
|
102
|
+
|
103
|
+
// 动画 / Animation //
|
104
|
+
enter: Transition {
|
105
|
+
ParallelAnimation {
|
106
|
+
NumberAnimation {
|
107
|
+
target: flyout
|
108
|
+
property: "opacity"
|
109
|
+
from: 0
|
110
|
+
to: 1
|
111
|
+
duration: Utils.appearanceSpeed
|
112
|
+
easing.type: Easing.OutQuint
|
113
|
+
}
|
114
|
+
NumberAnimation {
|
115
|
+
target: flyout
|
116
|
+
property: "y"
|
117
|
+
from: posY + (position === Position.Top ? 15 : position === Position.Bottom ? -15 : 0)
|
118
|
+
to: posY
|
119
|
+
duration: Utils.animationSpeedMiddle * 1.25
|
120
|
+
easing.type: Easing.OutQuint
|
121
|
+
}
|
122
|
+
NumberAnimation {
|
123
|
+
target: flyout
|
124
|
+
property: "x"
|
125
|
+
from: posX + (position === Position.Left ? 15 : position === Position.Right ? -15 : 0)
|
126
|
+
to: posX
|
127
|
+
duration: Utils.animationSpeedMiddle * 1.25
|
128
|
+
easing.type: Easing.OutQuint
|
129
|
+
}
|
130
|
+
}
|
131
|
+
}
|
132
|
+
exit: Transition {
|
133
|
+
ParallelAnimation {
|
134
|
+
NumberAnimation {
|
135
|
+
target: flyout
|
136
|
+
property: "opacity"
|
137
|
+
from: 1
|
138
|
+
to: 0
|
139
|
+
duration: Utils.animationSpeed
|
140
|
+
easing.type: Easing.OutQuint
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|