RinUI 0.1.0__py3-none-any.whl → 0.1.1.post1__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.
Files changed (114) hide show
  1. RinUI/__init__.py +4 -4
  2. RinUI/assets/fonts/FluentSystemIcons-Index.js +5255 -5255
  3. RinUI/components/Base.qml +78 -78
  4. RinUI/components/BasicInput/Button.qml +146 -146
  5. RinUI/components/BasicInput/CheckBox.qml +98 -98
  6. RinUI/components/BasicInput/ComboBox.qml +159 -159
  7. RinUI/components/BasicInput/DropDownButton.qml +20 -20
  8. RinUI/components/BasicInput/Hyperlink.qml +17 -17
  9. RinUI/components/BasicInput/PillButton.qml +10 -10
  10. RinUI/components/BasicInput/RadioButton.qml +94 -94
  11. RinUI/components/BasicInput/RoundButton.qml +26 -26
  12. RinUI/components/BasicInput/Slider.qml +212 -212
  13. RinUI/components/BasicInput/Switch.qml +101 -101
  14. RinUI/components/BasicInput/ToggleButton.qml +10 -10
  15. RinUI/components/BasicInput/ToolButton.qml +30 -30
  16. RinUI/components/ContextMenu.qml +183 -183
  17. RinUI/components/DateAndTime/DatePicker.qml +142 -140
  18. RinUI/components/DateAndTime/PickerView.qml +223 -223
  19. RinUI/components/DateAndTime/TimePicker.qml +114 -114
  20. RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -106
  21. RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -47
  22. RinUI/components/DialogsAndFlyouts/Flyout.qml +87 -87
  23. RinUI/components/DialogsAndFlyouts/Popup.qml +110 -106
  24. RinUI/components/FocusIndicator.qml +33 -33
  25. RinUI/components/IconWidget.qml +52 -52
  26. RinUI/components/Indicator.qml +89 -89
  27. RinUI/components/Layout/Expander.qml +159 -159
  28. RinUI/components/Layout/SettingExpander.qml +66 -66
  29. RinUI/components/Layout/SettingItem.qml +70 -70
  30. RinUI/components/ListAndCollections/Clip.qml +21 -21
  31. RinUI/components/ListAndCollections/Frame.qml +43 -43
  32. RinUI/components/ListAndCollections/ListView.qml +104 -104
  33. RinUI/components/ListAndCollections/ListViewDelegate.qml +82 -82
  34. RinUI/components/ListAndCollections/SettingCard.qml +72 -72
  35. RinUI/components/ListAndCollections/TableView.qml +81 -81
  36. RinUI/components/ListAndCollections/TableViewDelegate.qml +88 -88
  37. RinUI/components/Media/Avatar.qml +82 -82
  38. RinUI/components/MenusAndToolbars/Menu.qml +150 -150
  39. RinUI/components/MenusAndToolbars/MenuBar.qml +42 -42
  40. RinUI/components/MenusAndToolbars/MenuItem.qml +131 -131
  41. RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -43
  42. RinUI/components/MenusAndToolbars/MenuSeparator.qml +13 -13
  43. RinUI/components/MenusAndToolbars/TextInputMenu.qml +37 -37
  44. RinUI/components/MenusAndToolbars/ToolSeparator.qml +16 -16
  45. RinUI/components/Navigation/ErrorPage.qml +48 -48
  46. RinUI/components/Navigation/NavigationBar.qml +179 -179
  47. RinUI/components/Navigation/NavigationItem.qml +193 -193
  48. RinUI/components/Navigation/NavigationSubItem.qml +103 -103
  49. RinUI/components/Navigation/NavigationView.qml +228 -227
  50. RinUI/components/Navigation/Segmented.qml +16 -16
  51. RinUI/components/Navigation/SegmentedItem.qml +107 -107
  52. RinUI/components/Navigation/SelectorBar.qml +12 -12
  53. RinUI/components/Navigation/SelectorBarItem.qml +88 -88
  54. RinUI/components/ScrollBar.qml +204 -204
  55. RinUI/components/ScrollView.qml +12 -12
  56. RinUI/components/Shadow.qml +47 -47
  57. RinUI/components/StatusAndInfo/InfoBadge.qml +77 -77
  58. RinUI/components/StatusAndInfo/InfoBar.qml +256 -251
  59. RinUI/components/StatusAndInfo/ProgressBar.qml +126 -126
  60. RinUI/components/StatusAndInfo/ProgressRing.qml +149 -0
  61. RinUI/components/StatusAndInfo/Toast.qml +236 -236
  62. RinUI/components/StatusAndInfo/ToolTip.qml +93 -93
  63. RinUI/components/Text/SpinBox.qml +150 -133
  64. RinUI/components/Text/Text.qml +44 -44
  65. RinUI/components/Text/TextArea.qml +117 -117
  66. RinUI/components/Text/TextField.qml +113 -113
  67. RinUI/components/Text/TextInput.qml +47 -47
  68. RinUI/components/qmldir +80 -80
  69. RinUI/core/__init__.py +4 -4
  70. RinUI/core/config.py +129 -129
  71. RinUI/core/launcher.py +129 -129
  72. RinUI/core/theme.py +339 -339
  73. RinUI/core/translator.py +26 -25
  74. RinUI/hooks/__init__.py +3 -3
  75. RinUI/hooks/hook-RinUI.py +3 -3
  76. RinUI/qmldir +108 -104
  77. RinUI/themes/Appearance.qml +36 -0
  78. RinUI/themes/Colors.qml +36 -0
  79. RinUI/themes/dark.qml +145 -145
  80. RinUI/themes/light.qml +145 -145
  81. RinUI/themes/qmldir +9 -6
  82. RinUI/themes/theme.qml +151 -149
  83. RinUI/themes/utils.qml +37 -37
  84. RinUI/utils/Animation.qml +12 -12
  85. RinUI/utils/FloatLayer.qml +132 -123
  86. RinUI/utils/FontIconLoader.qml +13 -13
  87. RinUI/utils/Position.qml +19 -19
  88. RinUI/utils/Severity.qml +13 -13
  89. RinUI/utils/Typography.qml +17 -17
  90. RinUI/utils/qmldir +4 -4
  91. RinUI/windows/CtrlBtn.qml +118 -118
  92. RinUI/windows/FluentPage.qml +92 -92
  93. RinUI/windows/FluentWindow.qml +31 -30
  94. RinUI/windows/FluentWindowBase.qml +158 -158
  95. RinUI/windows/TitleBar.qml +135 -135
  96. RinUI/windows/qmldir +7 -7
  97. RinUI/windows/window/ApplicationWindow.qml +8 -8
  98. RinUI/windows/window/Window.qml +118 -118
  99. {rinui-0.1.0.data → rinui-0.1.1.post1.data}/data/LICENSE +21 -21
  100. {rinui-0.1.0.data → rinui-0.1.1.post1.data}/data/README.md +100 -100
  101. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info}/METADATA +116 -115
  102. rinui-0.1.1.post1.dist-info/RECORD +112 -0
  103. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info}/WHEEL +1 -1
  104. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info/licenses}/LICENSE +21 -21
  105. RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  106. RinUI/config/rin_ui.json +0 -8
  107. RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  108. RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  109. RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  110. RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  111. RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
  112. rinui-0.1.0.dist-info/RECORD +0 -116
  113. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info}/entry_points.txt +0 -0
  114. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.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) => i + 1).map(getMonthName)
21
- readonly property int maxDays: new Date(pickerView.value3 || new Date().getFullYear(), pickerView.index1 + 1, 0).getDate()
22
-
23
- implicitWidth: 250
24
- padding: 0
25
-
26
- property string date: {
27
- if (!pickerView.gotData) return ""
28
- let y = typeof year === "number"? parseInt(year) : new Date().getFullYear()
29
- let m = parseInt(monthModel.indexOf(month) + 1)
30
- let d = parseInt(day)
31
- return y + "-" + m + "-" + d
32
- }
33
-
34
- function setDate(yyyymmdd) {
35
- // format
36
- if (!yyyymmdd || typeof yyyymmdd !== "string"
37
- || !yyyymmdd.match(/^\d{4}[-\/]\d{1,2}[-\/]\d{1,2}$/))
38
- return false
39
- let parts = yyyymmdd.split(/[-\/]/) // 使用正则分割符号 '-' 或 '/'
40
- let y = parseInt(parts[0])
41
- let m = parseInt(parts[1])
42
- let d = parseInt(parts[2])
43
-
44
- if (m >= 1 && m <= 12 && d >= 1 && d <= 31) {
45
- pickerView.value3 = y.toString()
46
- pickerView.value1 = getMonthName(m)
47
- pickerView.value2 = d.toString()
48
- pickerView.gotData = true
49
- return true
50
- }
51
- return -1
52
- }
53
-
54
- // 根据 locale 决定顺序
55
- property var dateOrder: {
56
- let fmt = Qt.locale().dateFormat(Locale.ShortFormat)
57
- let order = []
58
- if (fmt.indexOf("y") < fmt.indexOf("M") && fmt.indexOf("M") < fmt.indexOf("d"))
59
- order = ["year", "month", "day"]
60
- else if (fmt.indexOf("M") < fmt.indexOf("d") && fmt.indexOf("d") < fmt.indexOf("y"))
61
- order = ["month", "day", "year"]
62
- else if (fmt.indexOf("d") < fmt.indexOf("M") && fmt.indexOf("M") < fmt.indexOf("y"))
63
- order = ["day", "month", "year"]
64
-
65
- if (!yearVisible) {
66
- order = order.filter(item => item !== "year")
67
- }
68
- return order
69
- }
70
-
71
- // locale获取月份名称
72
- function getMonthName(num) {
73
- return datePicker.locale.monthName(num - 1)
74
- }
75
-
76
- onClicked: pickerView.open()
77
-
78
- contentItem: RowLayout {
79
- anchors.fill: parent
80
- spacing: 0
81
-
82
- Repeater {
83
- model: dateOrder
84
-
85
- delegate: Item {
86
- Layout.fillWidth: true
87
- Layout.maximumWidth: datePickerButton.implicitWidth / model.length
88
- implicitHeight: 32
89
-
90
- Text {
91
- anchors.centerIn: parent
92
- color: pickerView.gotData ? Theme.currentTheme.colors.textColor
93
- : Theme.currentTheme.colors.textSecondaryColor
94
-
95
- text: {
96
- const type = modelData
97
- if (!pickerView.gotData) {
98
- if (type === "year") return qsTr("year")
99
- if (type === "month") return qsTr("month")
100
- if (type === "day") return qsTr("day")
101
- }
102
- if (type === "year") return year
103
- if (type === "month") return month
104
- if (type === "day") return day
105
- return ""
106
- }
107
- }
108
- ToolSeparator {
109
- anchors.right: parent.right
110
- anchors.verticalCenter: parent.verticalCenter
111
- implicitHeight: parent.implicitHeight
112
- visible: index !== dateOrder.length - 1
113
- }
114
- }
115
- }
116
- }
117
-
118
- PickerView {
119
- id: pickerView
120
- width: parent.width
121
-
122
- model3: yearVisible
123
- ? (
124
- startYear <= endYear
125
- ? Array.apply(null, {length: endYear - startYear + 1}).map((_, i) => startYear + i)
126
- : []
127
- )
128
- : undefined
129
- model1: monthModel
130
- model2: Array.from({ length: maxDays }, (_, i) => i + 1) // 天
131
-
132
- // 初始值
133
- value3: yearVisible ? (new Date().getFullYear()) : undefined
134
- value1: getMonthName(new Date().getMonth() + 1)
135
- value2: new Date().getDate()
136
- gotData: false
137
-
138
- onValueChanged: gotData = true
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
+ }