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.
Files changed (115) hide show
  1. RinUI/__init__.py +4 -4
  2. RinUI/assets/fonts/FluentSystemIcons-Index.js +5255 -5255
  3. RinUI/assets/img/default_app_icon.png +0 -0
  4. RinUI/components/Base.qml +78 -78
  5. RinUI/components/BasicInput/Button.qml +146 -147
  6. RinUI/components/BasicInput/CheckBox.qml +98 -98
  7. RinUI/components/BasicInput/ComboBox.qml +159 -159
  8. RinUI/components/BasicInput/DropDownButton.qml +20 -20
  9. RinUI/components/BasicInput/Hyperlink.qml +17 -17
  10. RinUI/components/BasicInput/PillButton.qml +10 -10
  11. RinUI/components/BasicInput/RadioButton.qml +94 -94
  12. RinUI/components/BasicInput/RoundButton.qml +26 -26
  13. RinUI/components/BasicInput/Slider.qml +212 -212
  14. RinUI/components/BasicInput/Switch.qml +101 -101
  15. RinUI/components/BasicInput/ToggleButton.qml +10 -10
  16. RinUI/components/BasicInput/ToolButton.qml +30 -30
  17. RinUI/components/ContextMenu.qml +183 -183
  18. RinUI/components/DateAndTime/DatePicker.qml +142 -140
  19. RinUI/components/DateAndTime/PickerView.qml +223 -223
  20. RinUI/components/DateAndTime/TimePicker.qml +114 -114
  21. RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -106
  22. RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -47
  23. RinUI/components/DialogsAndFlyouts/Flyout.qml +87 -144
  24. RinUI/components/DialogsAndFlyouts/Popup.qml +110 -106
  25. RinUI/components/FocusIndicator.qml +33 -33
  26. RinUI/components/IconWidget.qml +52 -52
  27. RinUI/components/Indicator.qml +89 -89
  28. RinUI/components/Layout/Expander.qml +159 -159
  29. RinUI/components/Layout/SettingExpander.qml +66 -66
  30. RinUI/components/Layout/SettingItem.qml +70 -70
  31. RinUI/components/ListAndCollections/Clip.qml +21 -21
  32. RinUI/components/ListAndCollections/Frame.qml +43 -43
  33. RinUI/components/ListAndCollections/ListView.qml +104 -104
  34. RinUI/components/ListAndCollections/ListViewDelegate.qml +82 -82
  35. RinUI/components/ListAndCollections/SettingCard.qml +72 -72
  36. RinUI/components/ListAndCollections/TableView.qml +81 -81
  37. RinUI/components/ListAndCollections/TableViewDelegate.qml +88 -88
  38. RinUI/components/Media/Avatar.qml +83 -0
  39. RinUI/components/MenusAndToolbars/Menu.qml +150 -150
  40. RinUI/components/MenusAndToolbars/MenuBar.qml +42 -42
  41. RinUI/components/MenusAndToolbars/MenuItem.qml +131 -131
  42. RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -43
  43. RinUI/components/MenusAndToolbars/MenuSeparator.qml +13 -13
  44. RinUI/components/MenusAndToolbars/TextInputMenu.qml +37 -37
  45. RinUI/components/MenusAndToolbars/ToolSeparator.qml +16 -16
  46. RinUI/components/Navigation/ErrorPage.qml +48 -48
  47. RinUI/components/Navigation/NavigationBar.qml +179 -179
  48. RinUI/components/Navigation/NavigationItem.qml +193 -193
  49. RinUI/components/Navigation/NavigationSubItem.qml +103 -103
  50. RinUI/components/Navigation/NavigationView.qml +228 -227
  51. RinUI/components/Navigation/Segmented.qml +17 -0
  52. RinUI/components/Navigation/SegmentedItem.qml +108 -0
  53. RinUI/components/Navigation/SelectorBar.qml +12 -57
  54. RinUI/components/Navigation/SelectorBarItem.qml +89 -0
  55. RinUI/components/ScrollBar.qml +204 -204
  56. RinUI/components/ScrollView.qml +12 -12
  57. RinUI/components/Shadow.qml +47 -47
  58. RinUI/components/StatusAndInfo/InfoBadge.qml +77 -77
  59. RinUI/components/StatusAndInfo/InfoBar.qml +256 -251
  60. RinUI/components/StatusAndInfo/ProgressBar.qml +126 -126
  61. RinUI/components/StatusAndInfo/ProgressRing.qml +149 -0
  62. RinUI/components/StatusAndInfo/Toast.qml +236 -236
  63. RinUI/components/StatusAndInfo/ToolTip.qml +93 -93
  64. RinUI/components/Text/SpinBox.qml +150 -133
  65. RinUI/components/Text/Text.qml +44 -44
  66. RinUI/components/Text/TextArea.qml +117 -117
  67. RinUI/components/Text/TextField.qml +113 -113
  68. RinUI/components/Text/TextInput.qml +47 -47
  69. RinUI/components/qmldir +80 -77
  70. RinUI/core/__init__.py +4 -4
  71. RinUI/core/config.py +129 -129
  72. RinUI/core/launcher.py +129 -129
  73. RinUI/core/theme.py +339 -339
  74. RinUI/core/translator.py +25 -25
  75. RinUI/hooks/__init__.py +3 -3
  76. RinUI/hooks/hook-RinUI.py +3 -3
  77. RinUI/qmldir +108 -97
  78. RinUI/themes/Appearance.qml +36 -0
  79. RinUI/themes/Colors.qml +36 -0
  80. RinUI/themes/dark.qml +145 -136
  81. RinUI/themes/light.qml +145 -136
  82. RinUI/themes/qmldir +9 -6
  83. RinUI/themes/theme.qml +151 -149
  84. RinUI/themes/utils.qml +37 -37
  85. RinUI/utils/Animation.qml +12 -12
  86. RinUI/utils/FloatLayer.qml +132 -123
  87. RinUI/utils/FontIconLoader.qml +13 -13
  88. RinUI/utils/Position.qml +19 -19
  89. RinUI/utils/Severity.qml +13 -13
  90. RinUI/utils/Typography.qml +17 -17
  91. RinUI/utils/qmldir +4 -4
  92. RinUI/windows/CtrlBtn.qml +118 -118
  93. RinUI/windows/FluentPage.qml +92 -92
  94. RinUI/windows/FluentWindow.qml +31 -30
  95. RinUI/windows/FluentWindowBase.qml +158 -158
  96. RinUI/windows/TitleBar.qml +135 -135
  97. RinUI/windows/qmldir +7 -7
  98. RinUI/windows/window/ApplicationWindow.qml +8 -8
  99. RinUI/windows/window/Window.qml +118 -118
  100. {rinui-0.0.11.data → rinui-0.1.1.data}/data/LICENSE +21 -21
  101. {rinui-0.0.11.data → rinui-0.1.1.data}/data/README.md +100 -97
  102. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/METADATA +116 -112
  103. rinui-0.1.1.dist-info/RECORD +112 -0
  104. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/WHEEL +1 -1
  105. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info/licenses}/LICENSE +21 -21
  106. RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  107. RinUI/config/rin_ui.json +0 -8
  108. RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  109. RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  110. RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  111. RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  112. RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
  113. rinui-0.0.11.dist-info/RECORD +0 -112
  114. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/entry_points.txt +0 -0
  115. {rinui-0.0.11.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) => 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
+ }