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,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
|
17
|
-
property
|
18
|
-
property
|
19
|
-
property
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
Layout.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
border.
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
anchors.
|
79
|
-
anchors.
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
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
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
//
|
150
|
-
//
|
151
|
-
//
|
152
|
-
//
|
153
|
-
// let
|
154
|
-
//
|
155
|
-
//
|
156
|
-
//
|
157
|
-
//
|
158
|
-
//
|
159
|
-
//
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
navigationBar.
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
navigationBar.lastPages
|
199
|
-
navigationBar.
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
stackView.
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
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
|
}
|