RinUI 0.0.9.1.post1__tar.gz → 0.0.9.2__tar.gz

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 (110) hide show
  1. {rinui-0.0.9.1.post1/RinUI.egg-info → rinui-0.0.9.2}/PKG-INFO +2 -2
  2. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/README.md +1 -1
  3. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/__init__.py +1 -1
  4. rinui-0.0.9.2/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  5. rinui-0.0.9.2/RinUI/components/DateAndTime/DatePicker.qml +140 -0
  6. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/DateAndTime/PickerView.qml +11 -4
  7. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Navigation/NavigationView.qml +3 -0
  8. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/StatusAndInfo/InfoBar.qml +1 -1
  9. rinui-0.0.9.2/RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  10. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/core/launcher.py +3 -2
  11. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/qmldir +1 -0
  12. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/themes/utils.qml +5 -1
  13. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/FluentWindowBase.qml +6 -6
  14. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/window/ApplicationWindow.qml +1 -1
  15. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/window/Window.qml +7 -0
  16. {rinui-0.0.9.1.post1 → rinui-0.0.9.2/RinUI.egg-info}/PKG-INFO +2 -2
  17. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI.egg-info/SOURCES.txt +0 -1
  18. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/pyproject.toml +1 -1
  19. rinui-0.0.9.1.post1/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  20. rinui-0.0.9.1.post1/RinUI/components/DateAndTime/DatePicker.qml +0 -115
  21. rinui-0.0.9.1.post1/RinUI/components/Utils/Blur.qml +0 -42
  22. rinui-0.0.9.1.post1/RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  23. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/LICENSE +0 -0
  24. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/MANIFEST.in +0 -0
  25. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/assets/fonts/FluentSystemIcons-Index.js +0 -0
  26. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf +0 -0
  27. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/assets/img/default_app_icon.png +0 -0
  28. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Base.qml +0 -0
  29. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/Button.qml +0 -0
  30. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/CheckBox.qml +0 -0
  31. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/ComboBox.qml +0 -0
  32. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/DropDownButton.qml +0 -0
  33. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/Hyperlink.qml +0 -0
  34. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/RadioButton.qml +0 -0
  35. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/Slider.qml +0 -0
  36. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/Switch.qml +0 -0
  37. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/ToggleButton.qml +0 -0
  38. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/BasicInput/ToolButton.qml +0 -0
  39. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ContextMenu.qml +0 -0
  40. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/DateAndTime/TimePicker.qml +0 -0
  41. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/DialogsAndFlyouts/Dialog.qml +0 -0
  42. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +0 -0
  43. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/DialogsAndFlyouts/Flyout.qml +0 -0
  44. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/DialogsAndFlyouts/Popup.qml +0 -0
  45. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/FocusIndicator.qml +0 -0
  46. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/IconWidget.qml +0 -0
  47. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Indicator.qml +0 -0
  48. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Layout/Expander.qml +0 -0
  49. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Layout/SettingExpander.qml +0 -0
  50. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Layout/SettingItem.qml +0 -0
  51. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ListAndCollections/Clip.qml +0 -0
  52. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ListAndCollections/Frame.qml +0 -0
  53. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ListAndCollections/ListView.qml +0 -0
  54. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ListAndCollections/ListViewDelegate.qml +0 -0
  55. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ListAndCollections/SettingCard.qml +0 -0
  56. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ListAndCollections/TableView.qml +0 -0
  57. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ListAndCollections/TableViewDelegate.qml +0 -0
  58. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/MenusAndToolbars/Menu.qml +0 -0
  59. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/MenusAndToolbars/MenuBar.qml +0 -0
  60. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/MenusAndToolbars/MenuItem.qml +0 -0
  61. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/MenusAndToolbars/MenuItemGroup.qml +0 -0
  62. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/MenusAndToolbars/MenuSeparator.qml +0 -0
  63. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/MenusAndToolbars/ToolSeparator.qml +0 -0
  64. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Navigation/ErrorPage.qml +0 -0
  65. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Navigation/NavigationBar.qml +0 -0
  66. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Navigation/NavigationItem.qml +0 -0
  67. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Navigation/NavigationSubItem.qml +0 -0
  68. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Navigation/SelectorBar.qml +0 -0
  69. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ScrollBar.qml +0 -0
  70. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/ScrollView.qml +0 -0
  71. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Shadow.qml +0 -0
  72. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/StatusAndInfo/InfoBadge.qml +0 -0
  73. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/StatusAndInfo/ProgressBar.qml +0 -0
  74. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/StatusAndInfo/Toast.qml +0 -0
  75. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/StatusAndInfo/ToolTip.qml +0 -0
  76. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Text/SpinBox.qml +0 -0
  77. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Text/Text.qml +0 -0
  78. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Text/TextField.qml +0 -0
  79. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/Text/TextInput.qml +0 -0
  80. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/components/qmldir +0 -0
  81. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/config/rin_ui.json +0 -0
  82. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/core/__init__.py +0 -0
  83. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  84. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  85. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  86. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/core/config.py +0 -0
  87. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/core/theme.py +0 -0
  88. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/hooks/__init__.py +0 -0
  89. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/hooks/hook-RinUI.py +0 -0
  90. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/themes/dark.qml +0 -0
  91. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/themes/light.qml +0 -0
  92. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/themes/qmldir +0 -0
  93. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/themes/theme.qml +0 -0
  94. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/utils/Animation.qml +0 -0
  95. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/utils/FloatLayer.qml +0 -0
  96. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/utils/FontIconLoader.qml +0 -0
  97. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/utils/Position.qml +0 -0
  98. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/utils/Severity.qml +0 -0
  99. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/utils/Typography.qml +0 -0
  100. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/utils/qmldir +0 -0
  101. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/CtrlBtn.qml +0 -0
  102. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/FluentPage.qml +0 -0
  103. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/FluentWindow.qml +0 -0
  104. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/TitleBar.qml +0 -0
  105. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI/windows/qmldir +0 -0
  106. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI.egg-info/dependency_links.txt +0 -0
  107. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI.egg-info/entry_points.txt +0 -0
  108. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI.egg-info/requires.txt +0 -0
  109. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/RinUI.egg-info/top_level.txt +0 -0
  110. {rinui-0.0.9.1.post1 → rinui-0.0.9.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RinUI
3
- Version: 0.0.9.1.post1
3
+ Version: 0.0.9.2
4
4
  Summary: A Fluent Design-like UI library for Qt Quick (QML) based on PySide6
5
5
  Author-email: RinLit <lintu233_qwq@icloud.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -53,7 +53,7 @@ With simple configuration, you can quickly develop elegant UI interfaces in the
53
53
 
54
54
  ## 🪄 Usage
55
55
 
56
- You can install RinUI via pip: (coming soon, but now you can install via test-pypi)
56
+ You can install RinUI via pip:
57
57
  ```bash
58
58
  pip install RinUI
59
59
  ```
@@ -38,7 +38,7 @@ With simple configuration, you can quickly develop elegant UI interfaces in the
38
38
 
39
39
  ## 🪄 Usage
40
40
 
41
- You can install RinUI via pip: (coming soon, but now you can install via test-pypi)
41
+ You can install RinUI via pip:
42
42
  ```bash
43
43
  pip install RinUI
44
44
  ```
@@ -1,4 +1,4 @@
1
1
  from .core import *
2
2
 
3
- __version__ = "0.0.9.1"
3
+ __version__ = "0.0.9.2"
4
4
  __author__ = "RinLit"
@@ -0,0 +1,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) => 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
+ }
@@ -17,15 +17,21 @@ Popup {
17
17
  property var value2: undefined
18
18
  property var value3: undefined
19
19
 
20
+ property alias index1: hours.currentIndex
21
+ property alias index2: minutes.currentIndex
22
+ property alias index3: added.currentIndex
23
+
20
24
  property var model1: 12
21
25
  property var model2: 60
22
26
  property var model3: [qsTr("AM"), qsTr("PM")]
23
27
 
24
- readonly property bool gotData: typeof value1!== "undefined" && typeof value2!== "undefined"
28
+ property bool gotData: typeof value1!== "undefined" && typeof value2!== "undefined"
29
+
30
+ signal valueChanged(var value1, var value2, var value3)
25
31
 
26
32
  function formatText(count, modelData) {
27
- let data = count === 60 ? modelData : modelData;
28
- return data.toString().length < 2 && count !== 12 ? "0" + data
33
+ let data = modelData;
34
+ return data.toString().length < 2 && count === 60 ? "0" + data
29
35
  : data === 0 && count === 12 ? 12 : data
30
36
  }
31
37
 
@@ -136,6 +142,7 @@ Popup {
136
142
  value1 = hours.currentItem.text
137
143
  value2 = minutes.currentItem.text
138
144
  typeof model3 !== "undefined" ? value3 = added.currentItem.text : undefined
145
+ valueChanged(value1, value2, value3)
139
146
  root.close()
140
147
  }
141
148
  }
@@ -184,7 +191,7 @@ Popup {
184
191
  )
185
192
  added.positionViewAtIndex(
186
193
  typeof value3 === "undefined" ? 0
187
- : typeof model3 === "number" ? value3 : model3.indexOf(value3), Tumbler.Center
194
+ : typeof model3 === "number" ? value3 : model3.indexOf(parseInt(value3)), Tumbler.Center
188
195
  )
189
196
  }
190
197
  }
@@ -18,6 +18,8 @@ RowLayout {
18
18
  property int pushEnterFromY: height
19
19
  property var window: parent // 窗口对象
20
20
 
21
+ signal pageChanged() // 页面切换信号
22
+
21
23
  id: navigationView
22
24
  anchors.fill: parent
23
25
 
@@ -195,6 +197,7 @@ RowLayout {
195
197
  navigationBar.lastPages.push(navigationBar.currentPage) // 记录当前页面
196
198
  navigationBar.lastPages = navigationBar.lastPages // refresh
197
199
  navigationBar.currentPage = page.toString()
200
+ pageChanged()
198
201
 
199
202
  if (page instanceof Component) {
200
203
  // let obj = page.createObject(stackView)
@@ -118,7 +118,7 @@ Frame {
118
118
  }
119
119
  Text {
120
120
  id: bodyText
121
- property bool wrap: (parent.width - titleText.width - custom.width - 24) < implicitWidth
121
+ property bool wrap: (infoBar.width - titleText.width - custom.width - 24) < implicitWidth
122
122
  width: wrap ?
123
123
  parent.width : implicitWidth
124
124
  typography: Typography.Body
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import sys
3
3
 
4
- from PySide6.QtCore import QCoreApplication
4
+ from PySide6.QtCore import QCoreApplication, QObject
5
5
  from PySide6.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout
6
6
  from PySide6.QtQml import QQmlApplicationEngine
7
7
  from .theme import ThemeManager
@@ -29,7 +29,7 @@ class TestWindow(QWidget):
29
29
  self.resize(400, 300)
30
30
 
31
31
 
32
- class RinUIWindow:
32
+ class RinUIWindow(QObject):
33
33
  # _instance = None
34
34
  #
35
35
  # def __new__(cls, *args, **kwargs): # 单例模式管理
@@ -42,6 +42,7 @@ class RinUIWindow:
42
42
  创建基于 RinUI 的 QML 应用程序。
43
43
  :param qml_path: str, QML 文件路径
44
44
  """
45
+ super().__init__()
45
46
  if hasattr(self, "_initialized") and self._initialized:
46
47
  return
47
48
  self._initialized = True
@@ -20,6 +20,7 @@ Slider 1.0 components/BasicInput/Slider.qml
20
20
 
21
21
  # Date & Time
22
22
  TimePicker 1.0 components/DateAndTime/TimePicker.qml
23
+ DatePicker 1.0 components/DateAndTime/DatePicker.qml
23
24
  PickerView 1.0 components/DateAndTime/PickerView.qml
24
25
 
25
26
  # Dialogs & Flyouts
@@ -5,7 +5,7 @@ import "../themes"
5
5
  import "../utils"
6
6
 
7
7
  QtObject {
8
- property string fontFamily: Qt.application.font.family // 默认字体
8
+ property string fontFamily: Qt.application.font.family // 默认字体
9
9
  property string iconFontFamily: FontIconLoader.name
10
10
  property string fontIconSource: Qt.resolvedUrl("../assets/fonts/FluentSystemIcons-Resizable.ttf") // 字体图标路径
11
11
  property string fontIconIndexSource: Qt.resolvedUrl("../assets/fonts/FluentSystemIcons-Index.js") // 字体图标索引路径
@@ -26,4 +26,8 @@ QtObject {
26
26
  function loadFontIconIndex() {
27
27
  Qt.include(fontIconIndexSource);
28
28
  }
29
+
30
+ Component.onCompleted: {
31
+ console.log("Font Family: " + fontFamily)
32
+ }
29
33
  }
@@ -42,12 +42,6 @@ ApplicationWindow {
42
42
  }
43
43
  }
44
44
 
45
- FloatLayer {
46
- id: floatLayer
47
- anchors.topMargin: titleBarHeight
48
- z: 998
49
- }
50
-
51
45
  // 布局
52
46
  ColumnLayout {
53
47
  anchors.fill: parent
@@ -117,6 +111,12 @@ ApplicationWindow {
117
111
  }
118
112
  }
119
113
 
114
+ FloatLayer {
115
+ id: floatLayer
116
+ anchors.topMargin: titleBarHeight
117
+ z: 998
118
+ }
119
+
120
120
 
121
121
  //改变鼠标形状
122
122
  MouseArea {
@@ -5,5 +5,5 @@ import "../../windows"
5
5
  FluentWindowBase {
6
6
  id: baseWindow
7
7
  frameless: false
8
- default property alias content: baseWindow.data
8
+ default property alias content: baseWindow.content
9
9
  }
@@ -11,6 +11,7 @@ Window {
11
11
 
12
12
  color: frameless ? "transparent" : Theme.currentTheme.colors.backgroundColor
13
13
  property bool frameless: false
14
+ property alias floatLayer: baseWindow.floatLayer
14
15
  default property alias content: baseWindow.data
15
16
  property int titleBarHeight: Theme.currentTheme.appearance.dialogTitleBarHeight
16
17
 
@@ -37,6 +38,12 @@ Window {
37
38
  }
38
39
  }
39
40
 
41
+ FloatLayer {
42
+ id: floatLayer
43
+ anchors.topMargin: titleBarHeight
44
+ z: 998
45
+ }
46
+
40
47
  // 标题栏
41
48
  TitleBar {
42
49
  id: titleBar
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RinUI
3
- Version: 0.0.9.1.post1
3
+ Version: 0.0.9.2
4
4
  Summary: A Fluent Design-like UI library for Qt Quick (QML) based on PySide6
5
5
  Author-email: RinLit <lintu233_qwq@icloud.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -53,7 +53,7 @@ With simple configuration, you can quickly develop elegant UI interfaces in the
53
53
 
54
54
  ## 🪄 Usage
55
55
 
56
- You can install RinUI via pip: (coming soon, but now you can install via test-pypi)
56
+ You can install RinUI via pip:
57
57
  ```bash
58
58
  pip install RinUI
59
59
  ```
@@ -71,7 +71,6 @@ RinUI/components/Text/SpinBox.qml
71
71
  RinUI/components/Text/Text.qml
72
72
  RinUI/components/Text/TextField.qml
73
73
  RinUI/components/Text/TextInput.qml
74
- RinUI/components/Utils/Blur.qml
75
74
  RinUI/config/rin_ui.json
76
75
  RinUI/core/__init__.py
77
76
  RinUI/core/config.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "RinUI"
7
- version = "0.0.9.1.post1"
7
+ version = "0.0.9.2"
8
8
  authors = [
9
9
  { name = "RinLit", email = "lintu233_qwq@icloud.com" }
10
10
  ]
@@ -1,115 +0,0 @@
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
- }
@@ -1,42 +0,0 @@
1
- import QtQuick
2
- import Qt5Compat.GraphicalEffects
3
- import FluentUI
4
-
5
- Item {
6
- id: control
7
- property color tintColor: Qt.rgba(1, 1, 1, 1)
8
- property real tintOpacity: 0.65
9
- property real luminosity: 0.01
10
- property real noiseOpacity: 0.02
11
- property var target
12
- property int blurRadius: 32
13
- property rect targetRect: Qt.rect(control.x, control.y, control.width,control.height)
14
-
15
- ShaderEffectSource {
16
- id: effect_source
17
- anchors.fill: parent
18
- visible: false
19
- sourceRect: control.targetRect
20
- sourceItem: control.target
21
- }
22
- FastBlur {
23
- id: fast_blur
24
- anchors.fill: parent
25
- source: effect_source
26
- radius: control.blurRadius
27
- }
28
- Rectangle {
29
- anchors.fill: parent
30
- color: Qt.rgba(1, 1, 1, luminosity)
31
- }
32
- Rectangle {
33
- anchors.fill: parent
34
- color: Qt.rgba(tintColor.r, tintColor.g, tintColor.b, tintOpacity)
35
- }
36
- Image {
37
- anchors.fill: parent
38
- source: "qrc:/qt/qml/FluentUI/Image/noise.png"
39
- fillMode: Image.Tile
40
- opacity: control.noiseOpacity
41
- }
42
- }
File without changes
File without changes
File without changes