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,227 +1,228 @@
1
- import QtQuick 2.15
2
- import QtQuick.Controls 2.15
3
- import QtQuick.Layouts 2.15
4
- import "../../themes"
5
- import "../../components"
6
- import "../../windows"
7
-
8
-
9
- RowLayout {
10
- // 外观 / Appearance //
11
- property bool appLayerEnabled: true // 应用层背景
12
- property alias navExpandWidth: navigationBar.expandWidth // 导航栏宽度
13
- property alias navMinimumExpandWidth: navigationBar.minimumExpandWidth // 导航栏保持展开时窗口的最小宽度
14
-
15
- property alias navigationItems: navigationBar.navigationItems // 导航栏item
16
- property string defaultPage: "" // 默认索引项
17
- property var lastPages: [] // 上个页面索引
18
- property int pushEnterFromY: height
19
- property var window: parent // 窗口对象
20
-
21
- signal pageChanged() // 页面切换信号
22
-
23
- id: navigationView
24
- anchors.fill: parent
25
-
26
- Connections {
27
- target: window
28
- function onWidthChanged() {
29
- navigationBar.collapsed = navigationBar.isNotOverMinimumWidth() // 判断窗口是否小于最小宽度
30
- }
31
- }
32
-
33
- NavigationBar {
34
- id: navigationBar
35
- windowTitle: window.title
36
- windowIcon: window.icon
37
- windowWidth: window.width
38
- stackView: stackView
39
- z: 999
40
- Layout.fillHeight: true
41
- }
42
-
43
- // 主体内容区域
44
- Item {
45
- Layout.fillWidth: true
46
- Layout.fillHeight: true
47
-
48
- // 导航栏展开自动收起
49
- MouseArea {
50
- id: collapseCatcher
51
- anchors.fill: parent
52
- z: 1
53
- hoverEnabled: true
54
- acceptedButtons: Qt.AllButtons
55
-
56
- visible: !navigationBar.collapsed && navigationBar.isNotOverMinimumWidth()
57
-
58
- onClicked: {
59
- navigationBar.collapsed = true
60
- }
61
- }
62
-
63
- Rectangle {
64
- id: appLayer
65
- width: parent.width + Utils.windowDragArea + radius
66
- height: parent.height + Utils.windowDragArea + radius
67
- color: Theme.currentTheme.colors.layerColor
68
- border.color: Theme.currentTheme.colors.cardBorderColor
69
- border.width: 1
70
- opacity: window.appLayerEnabled
71
- radius: Theme.currentTheme.appearance.windowRadius
72
- }
73
-
74
-
75
- StackView {
76
- id: stackView
77
- anchors.fill: parent
78
- anchors.leftMargin: 1
79
- anchors.topMargin: 1
80
-
81
-
82
- // 切换动画 / Page Transition //
83
- pushEnter : Transition {
84
- PropertyAnimation {
85
- property: "opacity"
86
- from: 0
87
- to: 1
88
- duration: Utils.animationSpeed
89
- easing.type: Easing.InOutQuad
90
- }
91
-
92
- PropertyAnimation {
93
- property: "y"
94
- from: pushEnterFromY
95
- to: 0
96
- duration: Utils.animationSpeedMiddle
97
- easing.type: Easing.OutQuint
98
- }
99
- }
100
-
101
- pushExit : Transition {
102
- PropertyAnimation {
103
- property: "opacity"
104
- from: 1
105
- to: 0
106
- duration: Utils.animationSpeed
107
- easing.type: Easing.InOutQuad
108
- }
109
- }
110
-
111
- popExit : Transition {
112
- PropertyAnimation {
113
- property: "opacity"
114
- from: 1
115
- to: 0
116
- duration: Utils.animationSpeed
117
- easing.type: Easing.InOutQuad
118
- }
119
-
120
- PropertyAnimation {
121
- property: "y"
122
- from: 0
123
- to: pushEnterFromY
124
- duration: Utils.animationSpeedMiddle
125
- easing.type: Easing.InOutQuint
126
- }
127
- }
128
-
129
- popEnter : Transition {
130
- SequentialAnimation {
131
- PauseAnimation { // 延时 200ms
132
- duration: Utils.animationSpeed
133
- }
134
- PropertyAnimation {
135
- property: "opacity"
136
- from: 0
137
- to: 1
138
- duration: Utils.appearanceSpeed
139
- easing.type: Easing.InOutQuad
140
- }
141
- }
142
- }
143
-
144
- initialItem: Item {}
145
-
146
- }
147
-
148
- // 导航切换逻辑
149
- // Connections {
150
- // target: navigationBar
151
- // function onCurrentIndexChanged() {
152
- // let index = navigationBar.currentIndex
153
- // let page = navigationItems[index].page
154
- // console.log("Pushing Page:", page, "Index:", index)
155
- // if (stackView.depth === 0 || stackView.currentItem.objectName !== page) {
156
- // checkPage(page)
157
- // }
158
- // }
159
- // }
160
-
161
-
162
- Component.onCompleted: {
163
- if (navigationItems.length > 0) {
164
- if (defaultPage !== "") {
165
- safePush(defaultPage, false)
166
- } else {
167
- safePush(navigationItems[0].page, false) // 推送默认页面
168
- } // 推送页面
169
- }
170
- }
171
- }
172
-
173
- function safePop() {
174
- console.log("Popping Page; Depth:", stackView.depth)
175
- if (navigationBar.lastPages.length > 1) {
176
- navigationBar.currentPage = navigationBar.lastPages.pop() // Retrieve and remove the last page
177
- navigationBar.lastPages = navigationBar.lastPages // refresh
178
- stackView.pop()
179
- } else {
180
- console.log("Can't pop: only root page left")
181
- }
182
- }
183
-
184
- function safePush(page, reload) {
185
- // 无效检测
186
- if (!(typeof page === "object" || typeof page === "string" || page instanceof Component)) {
187
- console.error("Invalid page:", page)
188
- return
189
- }
190
-
191
- // 重复检测
192
- if (navigationBar.currentPage === page && !reload) {
193
- console.log("Page already loaded:", page)
194
- return
195
- }
196
-
197
- navigationBar.lastPages.push(navigationBar.currentPage) // 记录当前页面
198
- navigationBar.lastPages = navigationBar.lastPages // refresh
199
- navigationBar.currentPage = page.toString()
200
- pageChanged()
201
-
202
- if (page instanceof Component) {
203
- // let obj = page.createObject(stackView)
204
- stackView.push(page)
205
-
206
- } else if (typeof page === "object" || typeof page === "string" ) {
207
- let component = Qt.createComponent(page) // 页面转控件
208
-
209
- if (component.status === Component.Ready) {
210
- console.log("Depth:", stackView.depth)
211
- stackView.push(component)
212
-
213
- } else if (component.status === Component.Error) {
214
- console.error("Failed to load:", page, component.errorString())
215
- stackView.push("ErrorPage.qml", {
216
- errorMessage: component.errorString(), // 传参
217
- page: page,
218
- })
219
- }
220
- }
221
- }
222
-
223
- function findPageByKey(key) {
224
- const item = menuItems.find(i => i.key === key);
225
- return item ? item.page : null;
226
- }
227
- }
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import "../../themes"
5
+ import "../../components"
6
+ import "../../windows"
7
+
8
+
9
+ RowLayout {
10
+ // 外观 / Appearance //
11
+ property bool appLayerEnabled: true // 应用层背景
12
+ property alias navExpandWidth: navigationBar.expandWidth // 导航栏宽度
13
+ property alias navMinimumExpandWidth: navigationBar.minimumExpandWidth // 导航栏保持展开时窗口的最小宽度
14
+
15
+ property alias navigationItems: navigationBar.navigationItems // 导航栏item
16
+ property alias currentPage: navigationBar.currentPage // 当前页面索引
17
+ property string defaultPage: "" // 默认索引项
18
+ property var lastPages: [] // 上个页面索引
19
+ property int pushEnterFromY: height
20
+ property var window: parent // 窗口对象
21
+
22
+ signal pageChanged() // 页面切换信号
23
+
24
+ id: navigationView
25
+ anchors.fill: parent
26
+
27
+ Connections {
28
+ target: window
29
+ function onWidthChanged() {
30
+ navigationBar.collapsed = navigationBar.isNotOverMinimumWidth() // 判断窗口是否小于最小宽度
31
+ }
32
+ }
33
+
34
+ NavigationBar {
35
+ id: navigationBar
36
+ windowTitle: window.title
37
+ windowIcon: window.icon
38
+ windowWidth: window.width
39
+ stackView: stackView
40
+ z: 999
41
+ Layout.fillHeight: true
42
+ }
43
+
44
+ // 主体内容区域
45
+ Item {
46
+ Layout.fillWidth: true
47
+ Layout.fillHeight: true
48
+
49
+ // 导航栏展开自动收起
50
+ MouseArea {
51
+ id: collapseCatcher
52
+ anchors.fill: parent
53
+ z: 1
54
+ hoverEnabled: true
55
+ acceptedButtons: Qt.AllButtons
56
+
57
+ visible: !navigationBar.collapsed && navigationBar.isNotOverMinimumWidth()
58
+
59
+ onClicked: {
60
+ navigationBar.collapsed = true
61
+ }
62
+ }
63
+
64
+ Rectangle {
65
+ id: appLayer
66
+ width: parent.width + Utils.windowDragArea + radius
67
+ height: parent.height + Utils.windowDragArea + radius
68
+ color: Theme.currentTheme.colors.layerColor
69
+ border.color: Theme.currentTheme.colors.cardBorderColor
70
+ border.width: 1
71
+ opacity: window.appLayerEnabled
72
+ radius: Theme.currentTheme.appearance.windowRadius
73
+ }
74
+
75
+
76
+ StackView {
77
+ id: stackView
78
+ anchors.fill: parent
79
+ anchors.leftMargin: 1
80
+ anchors.topMargin: 1
81
+
82
+
83
+ // 切换动画 / Page Transition //
84
+ pushEnter : Transition {
85
+ PropertyAnimation {
86
+ property: "opacity"
87
+ from: 0
88
+ to: 1
89
+ duration: Utils.animationSpeed
90
+ easing.type: Easing.InOutQuad
91
+ }
92
+
93
+ PropertyAnimation {
94
+ property: "y"
95
+ from: pushEnterFromY
96
+ to: 0
97
+ duration: Utils.animationSpeedMiddle
98
+ easing.type: Easing.OutQuint
99
+ }
100
+ }
101
+
102
+ pushExit : Transition {
103
+ PropertyAnimation {
104
+ property: "opacity"
105
+ from: 1
106
+ to: 0
107
+ duration: Utils.animationSpeed
108
+ easing.type: Easing.InOutQuad
109
+ }
110
+ }
111
+
112
+ popExit : Transition {
113
+ PropertyAnimation {
114
+ property: "opacity"
115
+ from: 1
116
+ to: 0
117
+ duration: Utils.animationSpeed
118
+ easing.type: Easing.InOutQuad
119
+ }
120
+
121
+ PropertyAnimation {
122
+ property: "y"
123
+ from: 0
124
+ to: pushEnterFromY
125
+ duration: Utils.animationSpeedMiddle
126
+ easing.type: Easing.InOutQuint
127
+ }
128
+ }
129
+
130
+ popEnter : Transition {
131
+ SequentialAnimation {
132
+ PauseAnimation { // 延时 200ms
133
+ duration: Utils.animationSpeed
134
+ }
135
+ PropertyAnimation {
136
+ property: "opacity"
137
+ from: 0
138
+ to: 1
139
+ duration: Utils.appearanceSpeed
140
+ easing.type: Easing.InOutQuad
141
+ }
142
+ }
143
+ }
144
+
145
+ initialItem: Item {}
146
+
147
+ }
148
+
149
+ // 导航切换逻辑
150
+ // Connections {
151
+ // target: navigationBar
152
+ // function onCurrentIndexChanged() {
153
+ // let index = navigationBar.currentIndex
154
+ // let page = navigationItems[index].page
155
+ // console.log("Pushing Page:", page, "Index:", index)
156
+ // if (stackView.depth === 0 || stackView.currentItem.objectName !== page) {
157
+ // checkPage(page)
158
+ // }
159
+ // }
160
+ // }
161
+
162
+
163
+ Component.onCompleted: {
164
+ if (navigationItems.length > 0) {
165
+ if (defaultPage !== "") {
166
+ safePush(defaultPage, false)
167
+ } else {
168
+ safePush(navigationItems[0].page, false) // 推送默认页面
169
+ } // 推送页面
170
+ }
171
+ }
172
+ }
173
+
174
+ function safePop() {
175
+ console.log("Popping Page; Depth:", stackView.depth)
176
+ if (navigationBar.lastPages.length > 1) {
177
+ navigationBar.currentPage = navigationBar.lastPages.pop() // Retrieve and remove the last page
178
+ navigationBar.lastPages = navigationBar.lastPages // refresh
179
+ stackView.pop()
180
+ } else {
181
+ console.log("Can't pop: only root page left")
182
+ }
183
+ }
184
+
185
+ function safePush(page, reload) {
186
+ // 无效检测
187
+ if (!(typeof page === "object" || typeof page === "string" || page instanceof Component)) {
188
+ console.error("Invalid page:", page)
189
+ return
190
+ }
191
+
192
+ // 重复检测
193
+ if (navigationBar.currentPage === page && !reload) {
194
+ console.log("Page already loaded:", page)
195
+ return
196
+ }
197
+
198
+ navigationBar.lastPages.push(navigationBar.currentPage) // 记录当前页面
199
+ navigationBar.lastPages = navigationBar.lastPages // refresh
200
+ navigationBar.currentPage = page.toString()
201
+ pageChanged()
202
+
203
+ if (page instanceof Component) {
204
+ // let obj = page.createObject(stackView)
205
+ stackView.push(page)
206
+
207
+ } else if (typeof page === "object" || typeof page === "string" ) {
208
+ let component = Qt.createComponent(page) // 页面转控件
209
+
210
+ if (component.status === Component.Ready) {
211
+ console.log("Depth:", stackView.depth)
212
+ stackView.push(component)
213
+
214
+ } else if (component.status === Component.Error) {
215
+ console.error("Failed to load:", page, component.errorString())
216
+ stackView.push("ErrorPage.qml", {
217
+ errorMessage: component.errorString(), // 传参
218
+ page: page,
219
+ })
220
+ }
221
+ }
222
+ }
223
+
224
+ function findPageByKey(key) {
225
+ const item = menuItems.find(i => i.key === key);
226
+ return item ? item.page : null;
227
+ }
228
+ }
@@ -1,17 +1,17 @@
1
- import QtQuick 2.15
2
- import QtQuick.Controls 2.15
3
- import QtQuick.Layouts 2.15
4
- import "../../components"
5
- import "../../themes"
6
-
7
- TabBar {
8
- id: root
9
- implicitWidth: contentWidth
10
-
11
- background: Rectangle {
12
- border.width: Theme.currentTheme.appearance.borderWidth // 边框宽度 / Border Width
13
- border.color: Theme.currentTheme.colors.controlBorderColor
14
- radius: Theme.currentTheme.appearance.buttonRadius
15
- color: Theme.currentTheme.colors.controlAltSecondaryColor
16
- }
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import "../../components"
5
+ import "../../themes"
6
+
7
+ TabBar {
8
+ id: root
9
+ implicitWidth: contentWidth
10
+
11
+ background: Rectangle {
12
+ border.width: Theme.currentTheme.appearance.borderWidth // 边框宽度 / Border Width
13
+ border.color: Theme.currentTheme.colors.controlBorderColor
14
+ radius: Theme.currentTheme.appearance.buttonRadius
15
+ color: Theme.currentTheme.colors.controlAltSecondaryColor
16
+ }
17
17
  }