RinUI 0.1.0__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/components/Base.qml +78 -78
- RinUI/components/BasicInput/Button.qml +146 -146
- 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 -87
- 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 +82 -82
- 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 +16 -16
- RinUI/components/Navigation/SegmentedItem.qml +107 -107
- RinUI/components/Navigation/SelectorBar.qml +12 -12
- RinUI/components/Navigation/SelectorBarItem.qml +88 -88
- 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 -80
- 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 -104
- RinUI/themes/Appearance.qml +36 -0
- RinUI/themes/Colors.qml +36 -0
- RinUI/themes/dark.qml +145 -145
- RinUI/themes/light.qml +145 -145
- 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.1.0.data → rinui-0.1.1.data}/data/LICENSE +21 -21
- {rinui-0.1.0.data → rinui-0.1.1.data}/data/README.md +100 -100
- {rinui-0.1.0.dist-info → rinui-0.1.1.dist-info}/METADATA +116 -115
- rinui-0.1.1.dist-info/RECORD +112 -0
- {rinui-0.1.0.dist-info → rinui-0.1.1.dist-info}/WHEEL +1 -1
- {rinui-0.1.0.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.1.0.dist-info/RECORD +0 -116
- {rinui-0.1.0.dist-info → rinui-0.1.1.dist-info}/entry_points.txt +0 -0
- {rinui-0.1.0.dist-info → rinui-0.1.1.dist-info}/top_level.txt +0 -0
@@ -1,140 +1,142 @@
|
|
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: datePickerButton
|
9
|
-
|
10
|
-
property bool yearVisible: true
|
11
|
-
|
12
|
-
property alias year: pickerView.value3
|
13
|
-
property alias month: pickerView.value1
|
14
|
-
property alias monthIndex: pickerView.index1
|
15
|
-
property alias day: pickerView.value2
|
16
|
-
|
17
|
-
property int startYear: 1925
|
18
|
-
property int endYear: 2125
|
19
|
-
|
20
|
-
readonly property var monthModel: (new Array(12)).fill(0).map((_, i) =>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
let
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
let
|
42
|
-
let
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
pickerView.
|
48
|
-
pickerView.
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
order = ["
|
62
|
-
else if (fmt.indexOf("
|
63
|
-
order = ["
|
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
|
-
if (type === "
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
if (type === "
|
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
|
-
|
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: datePickerButton
|
9
|
+
|
10
|
+
property bool yearVisible: true
|
11
|
+
|
12
|
+
property alias year: pickerView.value3
|
13
|
+
property alias month: pickerView.value1
|
14
|
+
property alias monthIndex: pickerView.index1
|
15
|
+
property alias day: pickerView.value2
|
16
|
+
|
17
|
+
property int startYear: 1925
|
18
|
+
property int endYear: 2125
|
19
|
+
|
20
|
+
readonly property var monthModel: (new Array(12)).fill(0).map((_, i) => Qt.locale().monthName(i))
|
21
|
+
function calculateMaxDays(year, monthIndex) {
|
22
|
+
return new Date(year, monthIndex + 1, 0).getDate()
|
23
|
+
}
|
24
|
+
|
25
|
+
implicitWidth: 250
|
26
|
+
padding: 0
|
27
|
+
|
28
|
+
property string date: {
|
29
|
+
if (!pickerView.gotData) return ""
|
30
|
+
let y = typeof year === "number"? parseInt(year) : new Date().getFullYear()
|
31
|
+
let m = parseInt(monthModel.indexOf(month) + 1)
|
32
|
+
let d = parseInt(day)
|
33
|
+
return y + "-" + m + "-" + d
|
34
|
+
}
|
35
|
+
|
36
|
+
function setDate(yyyymmdd) {
|
37
|
+
// format
|
38
|
+
if (!yyyymmdd || typeof yyyymmdd !== "string"
|
39
|
+
|| !yyyymmdd.match(/^\d{4}[-\/]\d{1,2}[-\/]\d{1,2}$/))
|
40
|
+
return false
|
41
|
+
let parts = yyyymmdd.split(/[-\/]/) // 使用正则分割符号 '-' 或 '/'
|
42
|
+
let y = parseInt(parts[0])
|
43
|
+
let m = parseInt(parts[1])
|
44
|
+
let d = parseInt(parts[2])
|
45
|
+
|
46
|
+
if (m >= 1 && m <= 12 && d >= 1 && d <= 31) {
|
47
|
+
pickerView.value3 = y.toString()
|
48
|
+
pickerView.value1 = getMonthName(m)
|
49
|
+
pickerView.value2 = d.toString()
|
50
|
+
pickerView.gotData = true
|
51
|
+
return true
|
52
|
+
}
|
53
|
+
return -1
|
54
|
+
}
|
55
|
+
|
56
|
+
// 根据 locale 决定顺序
|
57
|
+
property var dateOrder: {
|
58
|
+
let fmt = Qt.locale().dateFormat(Locale.ShortFormat)
|
59
|
+
let order = []
|
60
|
+
if (fmt.indexOf("y") < fmt.indexOf("M") && fmt.indexOf("M") < fmt.indexOf("d"))
|
61
|
+
order = ["year", "month", "day"]
|
62
|
+
else if (fmt.indexOf("M") < fmt.indexOf("d") && fmt.indexOf("d") < fmt.indexOf("y"))
|
63
|
+
order = ["month", "day", "year"]
|
64
|
+
else if (fmt.indexOf("d") < fmt.indexOf("M") && fmt.indexOf("M") < fmt.indexOf("y"))
|
65
|
+
order = ["day", "month", "year"]
|
66
|
+
|
67
|
+
if (!yearVisible) {
|
68
|
+
order = order.filter(item => item !== "year")
|
69
|
+
}
|
70
|
+
return order
|
71
|
+
}
|
72
|
+
|
73
|
+
// locale获取月份名称
|
74
|
+
function getMonthName(num) {
|
75
|
+
return datePicker.locale.monthName(num - 1)
|
76
|
+
}
|
77
|
+
|
78
|
+
onClicked: pickerView.open()
|
79
|
+
|
80
|
+
contentItem: RowLayout {
|
81
|
+
anchors.fill: parent
|
82
|
+
spacing: 0
|
83
|
+
|
84
|
+
Repeater {
|
85
|
+
model: dateOrder
|
86
|
+
|
87
|
+
delegate: Item {
|
88
|
+
Layout.fillWidth: true
|
89
|
+
Layout.maximumWidth: datePickerButton.implicitWidth / model.length
|
90
|
+
implicitHeight: 32
|
91
|
+
|
92
|
+
Text {
|
93
|
+
anchors.centerIn: parent
|
94
|
+
color: pickerView.gotData ? Theme.currentTheme.colors.textColor
|
95
|
+
: Theme.currentTheme.colors.textSecondaryColor
|
96
|
+
|
97
|
+
text: {
|
98
|
+
const type = modelData
|
99
|
+
if (!pickerView.gotData) {
|
100
|
+
if (type === "year") return qsTr("year")
|
101
|
+
if (type === "month") return qsTr("month")
|
102
|
+
if (type === "day") return qsTr("day")
|
103
|
+
}
|
104
|
+
if (type === "year") return year
|
105
|
+
if (type === "month") return month
|
106
|
+
if (type === "day") return day
|
107
|
+
return ""
|
108
|
+
}
|
109
|
+
}
|
110
|
+
ToolSeparator {
|
111
|
+
anchors.right: parent.right
|
112
|
+
anchors.verticalCenter: parent.verticalCenter
|
113
|
+
implicitHeight: parent.implicitHeight
|
114
|
+
visible: index !== dateOrder.length - 1
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
PickerView {
|
121
|
+
id: pickerView
|
122
|
+
width: parent.width
|
123
|
+
|
124
|
+
model3: yearVisible
|
125
|
+
? (
|
126
|
+
startYear <= endYear
|
127
|
+
? Array.apply(null, {length: endYear - startYear + 1}).map((_, i) => startYear + i)
|
128
|
+
: []
|
129
|
+
)
|
130
|
+
: undefined
|
131
|
+
model1: monthModel
|
132
|
+
model2: Array.apply(null, {length: calculateMaxDays(model3[index3], monthIndex)}).map((_, i) => i + 1)
|
133
|
+
|
134
|
+
// 初始值
|
135
|
+
value3: yearVisible ? (new Date().getFullYear()) : undefined
|
136
|
+
value1: getMonthName(new Date().getMonth() + 1)
|
137
|
+
value2: new Date().getDate()
|
138
|
+
gotData: false
|
139
|
+
|
140
|
+
onValueChanged: gotData = true
|
141
|
+
}
|
142
|
+
}
|