RinUI 0.1.1.post1__py3-none-any.whl → 0.1.2__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 +1 -1
- RinUI/components/BasicInput/ComboBox.qml +0 -11
- RinUI/components/MenusAndToolbars/Menu.qml +8 -17
- RinUI/components/MenusAndToolbars/MenuItem.qml +4 -1
- RinUI/components/MenusAndToolbars/MenuSeparator.qml +2 -0
- RinUI/components/Text/TextField.qml +1 -0
- RinUI/core/launcher.py +21 -8
- RinUI/core/theme.py +1 -0
- RinUI/themes/utils.qml +2 -1
- {rinui-0.1.1.post1.dist-info → rinui-0.1.2.dist-info}/METADATA +2 -2
- {rinui-0.1.1.post1.dist-info → rinui-0.1.2.dist-info}/RECORD +17 -17
- {rinui-0.1.1.post1.data → rinui-0.1.2.data}/data/LICENSE +0 -0
- {rinui-0.1.1.post1.data → rinui-0.1.2.data}/data/README.md +0 -0
- {rinui-0.1.1.post1.dist-info → rinui-0.1.2.dist-info}/WHEEL +0 -0
- {rinui-0.1.1.post1.dist-info → rinui-0.1.2.dist-info}/entry_points.txt +0 -0
- {rinui-0.1.1.post1.dist-info → rinui-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {rinui-0.1.1.post1.dist-info → rinui-0.1.2.dist-info}/top_level.txt +0 -0
RinUI/__init__.py
CHANGED
@@ -85,17 +85,6 @@ ComboBox {
|
|
85
85
|
onClicked: menu.open()
|
86
86
|
}
|
87
87
|
|
88
|
-
// Text //
|
89
|
-
// contentItem: Text {
|
90
|
-
// id: text
|
91
|
-
// typography: Typography.Body
|
92
|
-
// anchors.left: parent.left
|
93
|
-
// anchors.leftMargin: 11 // 左边距为 11
|
94
|
-
// verticalAlignment: Text.AlignVCenter
|
95
|
-
// height: parent.height
|
96
|
-
// text: root.displayText ? root.displayText : root.placeholderText
|
97
|
-
// color: root.displayText ? Theme.currentTheme.colors.textColor : Theme.currentTheme.colors.textSecondaryColor
|
98
|
-
// }
|
99
88
|
|
100
89
|
contentItem: TextField {
|
101
90
|
id: text
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import QtQuick 2.15
|
2
2
|
import QtQuick.Controls 2.15
|
3
|
+
import QtQuick.Layouts 2.15
|
3
4
|
import "../../themes"
|
4
5
|
import "../../components"
|
5
6
|
|
@@ -34,15 +35,11 @@ Menu {
|
|
34
35
|
case Position.Right:
|
35
36
|
return (parent.height - root.height) / 2
|
36
37
|
default:
|
37
|
-
// return -root.height + 5 // 默认顶部
|
38
38
|
return root.y
|
39
39
|
}
|
40
40
|
}
|
41
41
|
|
42
|
-
|
43
|
-
implicitHeight: contentItem.implicitHeight
|
44
|
-
// x: (parent.width - root.width) / 2
|
45
|
-
// y: parent.height + 5
|
42
|
+
width: Math.max(contentItem.implicitWidth, 80)
|
46
43
|
|
47
44
|
enter: Transition {
|
48
45
|
ParallelAnimation {
|
@@ -101,13 +98,11 @@ Menu {
|
|
101
98
|
}
|
102
99
|
}
|
103
100
|
|
104
|
-
spacing: 5
|
105
101
|
topPadding: 5
|
106
102
|
bottomPadding: 5
|
107
103
|
|
108
104
|
background: Rectangle {
|
109
|
-
|
110
|
-
implicitHeight: 36
|
105
|
+
anchors.fill: parent
|
111
106
|
radius: Theme.currentTheme.appearance.windowRadius
|
112
107
|
color: Theme.currentTheme.colors.backgroundAcrylicColor
|
113
108
|
border.color: Theme.currentTheme.colors.flyoutBorderColor
|
@@ -125,20 +120,16 @@ Menu {
|
|
125
120
|
contentItem: Flickable {
|
126
121
|
id: flickable
|
127
122
|
clip: true
|
128
|
-
anchors.
|
129
|
-
// contentWidth: width
|
130
|
-
// contentHeight: column.implicitHeight
|
123
|
+
anchors.centerIn: parent
|
131
124
|
implicitWidth: column.implicitWidth
|
132
125
|
implicitHeight: column.implicitHeight
|
133
|
-
// interactive: column.implicitHeight > height
|
134
126
|
|
135
|
-
|
127
|
+
ColumnLayout {
|
136
128
|
id: column
|
137
|
-
|
138
|
-
|
129
|
+
x: -5
|
130
|
+
spacing: 0
|
139
131
|
Repeater {
|
140
|
-
model: root.contentModel
|
141
|
-
delegate: root.delegate
|
132
|
+
model: root.contentModel
|
142
133
|
}
|
143
134
|
}
|
144
135
|
|
@@ -7,6 +7,9 @@ import "../../components"
|
|
7
7
|
|
8
8
|
MenuItem {
|
9
9
|
id: root
|
10
|
+
|
11
|
+
Layout.fillWidth: true
|
12
|
+
|
10
13
|
implicitWidth: {
|
11
14
|
const leftMargin = 16;
|
12
15
|
const arrowWidth = arrow.visible ? arrow.width + 16 : root.checked ? indicator.width + 16 : 0;
|
@@ -94,7 +97,7 @@ MenuItem {
|
|
94
97
|
}
|
95
98
|
Text {
|
96
99
|
id: shortcutText
|
97
|
-
Layout.alignment: Qt.
|
100
|
+
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
98
101
|
typography: Typography.Caption
|
99
102
|
text: root.action ? root.action.shortcut : ""
|
100
103
|
color: Theme.currentTheme.colors.textSecondaryColor
|
RinUI/core/launcher.py
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
import os
|
2
2
|
import sys
|
3
|
+
from typing import Union
|
3
4
|
|
4
5
|
from PySide6.QtCore import QCoreApplication, QUrl, QObject
|
5
6
|
from PySide6.QtGui import QIcon
|
6
7
|
from PySide6.QtWidgets import QApplication
|
7
8
|
from PySide6.QtQml import QQmlApplicationEngine
|
9
|
+
from pathlib import Path
|
8
10
|
|
9
11
|
from .theme import ThemeManager
|
10
12
|
from .config import BackdropEffect, is_windows, Theme, RINUI_PATH, RinConfig
|
11
13
|
|
12
14
|
|
13
15
|
class RinUIWindow:
|
14
|
-
def __init__(self, qml_path: str):
|
16
|
+
def __init__(self, qml_path: Union[str, Path] = None):
|
15
17
|
"""
|
16
18
|
Create an application window with RinUI.
|
17
|
-
|
19
|
+
If qml_path is provided, it will automatically load the specified QML file.
|
20
|
+
:param qml_path: str or Path, QML file path (eg = "path/to/main.qml")
|
18
21
|
"""
|
19
22
|
super().__init__()
|
20
23
|
if hasattr(self, "_initialized") and self._initialized:
|
@@ -33,14 +36,22 @@ class RinUIWindow:
|
|
33
36
|
self.autoSetWindowsEffect = True
|
34
37
|
|
35
38
|
app_instance.aboutToQuit.connect(self.theme_manager.clean_up)
|
36
|
-
self._setup_application()
|
37
|
-
self.print_startup_info()
|
38
39
|
|
39
|
-
|
40
|
-
|
40
|
+
if qml_path is not None:
|
41
|
+
self.load(qml_path)
|
42
|
+
|
43
|
+
def load(self, qml_path: Union[str, Path] = None) -> None:
|
44
|
+
"""
|
45
|
+
Load the QML file and set up the application window.
|
46
|
+
:param qml_path:
|
47
|
+
:return:
|
48
|
+
"""
|
41
49
|
# RInUI 模块
|
42
50
|
print(f"UI Module Path: {RINUI_PATH}")
|
43
51
|
|
52
|
+
if qml_path is not None:
|
53
|
+
self.qml_path = qml_path
|
54
|
+
|
44
55
|
if os.path.exists(RINUI_PATH):
|
45
56
|
self.engine.addImportPath(RINUI_PATH)
|
46
57
|
else:
|
@@ -62,6 +73,8 @@ class RinUIWindow:
|
|
62
73
|
self.theme_manager.set_window(self.root_window)
|
63
74
|
self._apply_windows_effects() if self.autoSetWindowsEffect else None
|
64
75
|
|
76
|
+
self._print_startup_info()
|
77
|
+
|
65
78
|
def setIcon(self, path: str) -> None:
|
66
79
|
"""
|
67
80
|
Sets the icon for the application.
|
@@ -109,9 +122,9 @@ class RinUIWindow:
|
|
109
122
|
root = object.__getattribute__(self, "root_window")
|
110
123
|
return getattr(root, name)
|
111
124
|
except AttributeError:
|
112
|
-
raise AttributeError(f"\"RinUIWindow\" object has no attribute '{name}'")
|
125
|
+
raise AttributeError(f"\"RinUIWindow\" object has no attribute '{name}', you need to load() qml at first.")
|
113
126
|
|
114
|
-
def
|
127
|
+
def _print_startup_info(self) -> None:
|
115
128
|
border = "=" * 40
|
116
129
|
print(f"\n{border}")
|
117
130
|
print("✨ RinUIWindow Loaded Successfully!")
|
RinUI/core/theme.py
CHANGED
RinUI/themes/utils.qml
CHANGED
@@ -5,7 +5,8 @@ import "../themes"
|
|
5
5
|
import "../utils"
|
6
6
|
|
7
7
|
QtObject {
|
8
|
-
property string fontFamily: Qt.
|
8
|
+
property string fontFamily: Qt.platform.os === "windows"
|
9
|
+
? "Microsoft YaHei" : Qt.application.font.family // 默认字体
|
9
10
|
property string iconFontFamily: FontIconLoader.name
|
10
11
|
property string fontIconSource: Qt.resolvedUrl("../assets/fonts/FluentSystemIcons-Resizable.ttf") // 字体图标路径
|
11
12
|
property string fontIconIndexSource: Qt.resolvedUrl("../assets/fonts/FluentSystemIcons-Index.js") // 字体图标索引路径
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: RinUI
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.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
|
7
7
|
Classifier: License :: OSI Approved :: MIT License
|
8
8
|
Classifier: Operating System :: OS Independent
|
9
|
-
Requires-Python: >=3.
|
9
|
+
Requires-Python: >=3.12
|
10
10
|
Description-Content-Type: text/markdown
|
11
11
|
License-File: LICENSE
|
12
12
|
Requires-Dist: PySide6>=6.6.3.1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
RinUI/__init__.py,sha256=
|
1
|
+
RinUI/__init__.py,sha256=fNeQkYoiWjQ-_ixBLh28FY6AJ00dKNUUs3rX2ixJLQk,65
|
2
2
|
RinUI/qmldir,sha256=fwUoGC3efxNnNJmFU6inBDH6Tx9s3-OI4b3-a-25o0U,3829
|
3
3
|
RinUI/assets/fonts/FluentSystemIcons-Index.js,sha256=M2fUmCiOI7A1rxLWMFaekrB4KmasTSwbociYOzHJegE,253422
|
4
4
|
RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf,sha256=-IfF3NT1eODD0vOLVLC0Z2U5bsR6woSQAziX3qD1TqU,1447252
|
@@ -14,7 +14,7 @@ RinUI/components/Shadow.qml,sha256=8y9iAFr45hqDdXXnsfD49t90HHhiFyMzGUHqJa2tavk,1
|
|
14
14
|
RinUI/components/qmldir,sha256=KiTLgqw5x2LehrUxVfaFZUkD0Al2n2dPjD30gA_6fWk,2255
|
15
15
|
RinUI/components/BasicInput/Button.qml,sha256=78Qi7w7cR7N7nwdc9n1JNQ9F_SBlhF6KdVmdPQyqR2o,5244
|
16
16
|
RinUI/components/BasicInput/CheckBox.qml,sha256=SJkmo16EY-5omXBxkS74Pk3UcSE_LODABIjiP086aNM,3085
|
17
|
-
RinUI/components/BasicInput/ComboBox.qml,sha256
|
17
|
+
RinUI/components/BasicInput/ComboBox.qml,sha256=-ZT3FWGybTX1ltEDhTJuoxiG0gW3OlDcxfPdHnVwqsM,4111
|
18
18
|
RinUI/components/BasicInput/DropDownButton.qml,sha256=TEgRZgjCCOZMPuT8xXrsqCIEuZ7wObRX88PF1unWuaE,390
|
19
19
|
RinUI/components/BasicInput/Hyperlink.qml,sha256=8K1JoyX6AKw25QJW-aiVFah5yKmvS1WpxEcXMduM94M,329
|
20
20
|
RinUI/components/BasicInput/PillButton.qml,sha256=2eFgpKupz7xlGIWcJOHya4nK616ffByYD_oPRKQiSTg,205
|
@@ -42,11 +42,11 @@ RinUI/components/ListAndCollections/SettingCard.qml,sha256=hrNlpWmxvzUiGzBvBXkdk
|
|
42
42
|
RinUI/components/ListAndCollections/TableView.qml,sha256=71zKoiHLmfmmxD72WJvmmGGLyvfNeGKzllD7EgB9Ok0,2151
|
43
43
|
RinUI/components/ListAndCollections/TableViewDelegate.qml,sha256=IW8JVDiRSO9X7Z-lForRh6q4qFWuuhjtWKZXBjaZXOg,2283
|
44
44
|
RinUI/components/Media/Avatar.qml,sha256=8I7MlIalrs4S0WTKTuMU9qxbUkYDrJ-bhKPHjv12-SM,2088
|
45
|
-
RinUI/components/MenusAndToolbars/Menu.qml,sha256=
|
45
|
+
RinUI/components/MenusAndToolbars/Menu.qml,sha256=iTk9J1KlZv7BdzQNGbPVPYVGC8dqC94lPX3ggtsZv9E,4103
|
46
46
|
RinUI/components/MenusAndToolbars/MenuBar.qml,sha256=YqNcY9Tn2t3NmaDqYCHJIUd_j9EXtn0dtOHYCd7sRXQ,1055
|
47
|
-
RinUI/components/MenusAndToolbars/MenuItem.qml,sha256=
|
47
|
+
RinUI/components/MenusAndToolbars/MenuItem.qml,sha256=L2ZThrVEzw6_klVWKm60LOZXuLYPaab_kYQQI_8Pel0,3813
|
48
48
|
RinUI/components/MenusAndToolbars/MenuItemGroup.qml,sha256=FqnDxo7C6DQ-1xvurHtjxuiRZOD69MxdsKT-h236cIk,1014
|
49
|
-
RinUI/components/MenusAndToolbars/MenuSeparator.qml,sha256=
|
49
|
+
RinUI/components/MenusAndToolbars/MenuSeparator.qml,sha256=BQGQ_EjzwtnlJ14fDXT96LEBOoaQwmoNidON0LzAJX8,312
|
50
50
|
RinUI/components/MenusAndToolbars/TextInputMenu.qml,sha256=Rm0CT6sKdK5IOQAjtYEaJxqK3RdEZqXe9PjIoWBp1yM,939
|
51
51
|
RinUI/components/MenusAndToolbars/ToolSeparator.qml,sha256=X2cKZnTYhYUO0jOVRCwx81QSz4YNwVWRXoSD7kT86V4,414
|
52
52
|
RinUI/components/Navigation/ErrorPage.qml,sha256=XplTs6CKs1Y1441uvp9nSD4AeD08OIqoXlmz5RlpCPo,1039
|
@@ -67,12 +67,12 @@ RinUI/components/StatusAndInfo/ToolTip.qml,sha256=f6S9rG_0GsHQl8BB1m4Niik35s7Lng
|
|
67
67
|
RinUI/components/Text/SpinBox.qml,sha256=rY17yJ3a0ckkl6pX00qVIQQYLmoO-GLtcSZh-WKtPZs,4616
|
68
68
|
RinUI/components/Text/Text.qml,sha256=SWJBJtAWkq9XldrX6_BWfCXGRcLQLBNofkRO5NG8q2Q,1714
|
69
69
|
RinUI/components/Text/TextArea.qml,sha256=guhwcFBSEyZkTRT2V0ER3S03xW9WOkH_4U2Oor2I9PY,3706
|
70
|
-
RinUI/components/Text/TextField.qml,sha256=
|
70
|
+
RinUI/components/Text/TextField.qml,sha256=BXuJ16AUQaSh-Og7jaYSNEu9r1PcyG7FQ95DaGciJZs,3556
|
71
71
|
RinUI/components/Text/TextInput.qml,sha256=gyTJmrYi5yuc-j5dDRSbu5PCxiuQo2xNBm6jWL9ezYk,1611
|
72
72
|
RinUI/core/__init__.py,sha256=LF4-YjoBLaix1UEWYzc5rhXiYGdZXC_J-NyCoYkCpUE,196
|
73
73
|
RinUI/core/config.py,sha256=kO0bR1EhZB6Mh0KFa7uyBa0KgYr58DdBsHEP2oSGX7U,3722
|
74
|
-
RinUI/core/launcher.py,sha256=
|
75
|
-
RinUI/core/theme.py,sha256=
|
74
|
+
RinUI/core/launcher.py,sha256=Bep-74tsgFvzMw1GHklwgOgQBRjtr4ptPV8FlYDJ5AQ,5046
|
75
|
+
RinUI/core/theme.py,sha256=IKyyBXzlakvSsP6Oxf6gGfb0wQWFkxvnVMyfw4RdSo4,10719
|
76
76
|
RinUI/core/translator.py,sha256=5GK7Iy7-2iMicF8hQr79CwU9UWvCwE-8vGd8QkhJ1h8,1037
|
77
77
|
RinUI/hooks/__init__.py,sha256=7sQJlly1ZbiZTzZUkCV2hI_gY-DAxWP_0kLyhZQ2Tm8,74
|
78
78
|
RinUI/hooks/hook-RinUI.py,sha256=VvQui-b3YNuxvhqjRJqLPKdtnWQ6Ev8G9DEgzGNUUUI,116
|
@@ -86,7 +86,7 @@ RinUI/themes/dark.qml,sha256=qAn7MDh18K-44f4gPIRiA1l_T_PWoBxhhzh0Z6igC0w,5793
|
|
86
86
|
RinUI/themes/light.qml,sha256=L1Qy1yotvF3GemfhQxxTt1keyMdsjOoK9COP6NyVQHE,5741
|
87
87
|
RinUI/themes/qmldir,sha256=7SbN6C8cqEW6VvPb-eYg9AlppfkehmekbciYNHRoNSA,184
|
88
88
|
RinUI/themes/theme.qml,sha256=srSHRVV9KmQBc9uYitHDjMvXFzvLPolaLu82Tf0uc_Q,4265
|
89
|
-
RinUI/themes/utils.qml,sha256=
|
89
|
+
RinUI/themes/utils.qml,sha256=wJfvrsBTYZWi3uJmS-LFIJmsGWzxuT1lTvA7ufiG6Qg,1735
|
90
90
|
RinUI/utils/Animation.qml,sha256=hRzsJU_5G78JArYLvVtxTmRxX2VAuMgeWdAHzqyuYWQ,134
|
91
91
|
RinUI/utils/FloatLayer.qml,sha256=D0rkYxK6_09OjrNuLHDXhdsb4xbUq5l2IiuLHCsLGhE,3471
|
92
92
|
RinUI/utils/FontIconLoader.qml,sha256=Zm-talvAPxCBSt4nd8gpJ6jY91R1uRoJvaXKU3AaWEU,294
|
@@ -102,11 +102,11 @@ RinUI/windows/TitleBar.qml,sha256=zzOGP6fLm692BMY2UF_eDwjsgtVIZ0Fx90VDPGweHLA,37
|
|
102
102
|
RinUI/windows/qmldir,sha256=LMeM0QzRNU0CIHemtD1j19hGRCuV987DRDuB5W6UJ-k,205
|
103
103
|
RinUI/windows/window/ApplicationWindow.qml,sha256=4_COTBi9SoHeHdS0lIOPvqncevUB4P18svZfH3V5GaM,188
|
104
104
|
RinUI/windows/window/Window.qml,sha256=pye3j-RI7Tzm8WW7oIctaeFxQ-FJsqXpW2U4Xp3m418,3485
|
105
|
-
rinui-0.1.
|
106
|
-
rinui-0.1.
|
107
|
-
rinui-0.1.
|
108
|
-
rinui-0.1.
|
109
|
-
rinui-0.1.
|
110
|
-
rinui-0.1.
|
111
|
-
rinui-0.1.
|
112
|
-
rinui-0.1.
|
105
|
+
rinui-0.1.2.data/data/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
|
106
|
+
rinui-0.1.2.data/data/README.md,sha256=8ZcR55RYV2slRAQbhoYhqDTPOLXmewkFSvuA_cE6zD0,3044
|
107
|
+
rinui-0.1.2.dist-info/licenses/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
|
108
|
+
rinui-0.1.2.dist-info/METADATA,sha256=TqEp5U_YJcreGSLKjUF8I-j0TlN3F7eySHM2_7Ui9-s,3590
|
109
|
+
rinui-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
110
|
+
rinui-0.1.2.dist-info/entry_points.txt,sha256=taxuZYCggoQa2LPubwcurQYRjBRC4cNYOjWaqOYZVxw,54
|
111
|
+
rinui-0.1.2.dist-info/top_level.txt,sha256=vKKjXBXEw5OFRIzTxZWUC5ZOj0CK5e3atbymBB4eJ6w,6
|
112
|
+
rinui-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|