RinUI 0.1.3.2__py3-none-any.whl → 0.1.4.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 +1 -1
- RinUI/components/StatusAndInfo/BusyIndicator.qml +11 -0
- RinUI/components/StatusAndInfo/ProgressBar.qml +1 -1
- RinUI/components/StatusAndInfo/ProgressRing.qml +1 -1
- RinUI/components/qmldir +1 -0
- RinUI/core/__init__.py +5 -2
- RinUI/core/config.py +9 -8
- RinUI/core/launcher.py +20 -8
- RinUI/qmldir +2 -0
- RinUI/windows/TitleBar.qml +4 -3
- RinUI/windows/WindowManager.qml +14 -5
- {rinui-0.1.3.2.dist-info → rinui-0.1.4.1.dist-info}/METADATA +1 -1
- {rinui-0.1.3.2.dist-info → rinui-0.1.4.1.dist-info}/RECORD +19 -18
- {rinui-0.1.3.2.data → rinui-0.1.4.1.data}/data/LICENSE +0 -0
- {rinui-0.1.3.2.data → rinui-0.1.4.1.data}/data/README.md +0 -0
- {rinui-0.1.3.2.dist-info → rinui-0.1.4.1.dist-info}/WHEEL +0 -0
- {rinui-0.1.3.2.dist-info → rinui-0.1.4.1.dist-info}/entry_points.txt +0 -0
- {rinui-0.1.3.2.dist-info → rinui-0.1.4.1.dist-info}/licenses/LICENSE +0 -0
- {rinui-0.1.3.2.dist-info → rinui-0.1.4.1.dist-info}/top_level.txt +0 -0
RinUI/__init__.py
CHANGED
@@ -0,0 +1,11 @@
|
|
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
|
+
ProgressRing {
|
8
|
+
property bool running: true // 兼容BusyIndicator
|
9
|
+
state: ProgressRing.Running
|
10
|
+
indeterminate: running
|
11
|
+
}
|
@@ -54,7 +54,7 @@ ProgressBar {
|
|
54
54
|
radius: root.radius
|
55
55
|
color: root.state === 1 ? Theme.currentTheme.colors.systemCautionColor :
|
56
56
|
root.state === 2 ? Theme.currentTheme.colors.systemCriticalColor :
|
57
|
-
|
57
|
+
primaryColor
|
58
58
|
|
59
59
|
width: indeterminate ? state === 0 ? root.width / 3 : parent.width : root.visualPosition * parent.width
|
60
60
|
x: indeterminate ? -indicator.width : 0
|
RinUI/components/qmldir
CHANGED
RinUI/core/__init__.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
from .theme import ThemeManager
|
2
2
|
from .launcher import RinUIWindow
|
3
|
-
from .config import DEFAULT_CONFIG, RinConfig, PATH, Theme, BackdropEffect, ConfigManager
|
3
|
+
from .config import DEFAULT_CONFIG, RinConfig, PATH, Theme, BackdropEffect, ConfigManager, is_windows
|
4
4
|
from .translator import RinUITranslator
|
5
|
-
|
5
|
+
|
6
|
+
|
7
|
+
if is_windows():
|
8
|
+
from .window import WinEventFilter, WinEventManager
|
RinUI/core/config.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import os
|
2
1
|
import json
|
3
2
|
import platform
|
4
3
|
import sys
|
5
|
-
from PySide6.QtCore import QLocale
|
6
4
|
from enum import Enum
|
5
|
+
from pathlib import Path
|
6
|
+
import os
|
7
7
|
|
8
8
|
|
9
9
|
def is_win11():
|
@@ -27,15 +27,16 @@ def is_windows():
|
|
27
27
|
def resource_path(relative_path):
|
28
28
|
"""兼容 PyInstaller 打包和开发环境的路径"""
|
29
29
|
if hasattr(sys, '_MEIPASS'):
|
30
|
-
return
|
31
|
-
return
|
30
|
+
return Path(sys._MEIPASS) / relative_path
|
31
|
+
return Path(relative_path).resolve()
|
32
|
+
|
32
33
|
|
34
|
+
rinui_core_path = Path(__file__).resolve().parent # RinUI/core 目录
|
33
35
|
|
34
|
-
|
36
|
+
BASE_DIR = Path.cwd().resolve()
|
37
|
+
PATH = BASE_DIR / "RinUI" / "config"
|
38
|
+
RINUI_PATH = resource_path(rinui_core_path.parent.parent) # 使用 resource_path 处理路径,等同 ../../
|
35
39
|
|
36
|
-
BASE_DIR = os.path.abspath(os.getcwd())
|
37
|
-
PATH = os.path.join(BASE_DIR, "RinUI/config")
|
38
|
-
RINUI_PATH = resource_path(os.path.join(rinui_core_path, "../../")) # 使用 resource_path 处理路径
|
39
40
|
DEFAULT_CONFIG = {
|
40
41
|
"theme": {
|
41
42
|
"current_theme": "Auto",
|
RinUI/core/launcher.py
CHANGED
@@ -9,8 +9,7 @@ from PySide6.QtQml import QQmlApplicationEngine
|
|
9
9
|
from pathlib import Path
|
10
10
|
|
11
11
|
from .theme import ThemeManager
|
12
|
-
from .
|
13
|
-
from .config import BackdropEffect, is_windows, Theme, RINUI_PATH, RinConfig
|
12
|
+
from .config import BackdropEffect, is_windows, Theme, RINUI_PATH
|
14
13
|
|
15
14
|
|
16
15
|
class RinUIWindow:
|
@@ -28,7 +27,7 @@ class RinUIWindow:
|
|
28
27
|
self.engine = QQmlApplicationEngine()
|
29
28
|
self.theme_manager = ThemeManager()
|
30
29
|
self.win_event_filter = None
|
31
|
-
self.win_event_manager =
|
30
|
+
self.win_event_manager = None
|
32
31
|
self.qml_path = qml_path
|
33
32
|
self._initialized = True
|
34
33
|
|
@@ -78,19 +77,32 @@ class RinUIWindow:
|
|
78
77
|
self.theme_manager.set_window(self.root_window)
|
79
78
|
|
80
79
|
# 窗口句柄管理
|
80
|
+
self._window_handle_setup()
|
81
|
+
|
82
|
+
self._print_startup_info()
|
83
|
+
|
84
|
+
def _window_handle_setup(self) -> None:
|
85
|
+
"""
|
86
|
+
set up the window handle. (Only available on Windows platform)
|
87
|
+
:return:
|
88
|
+
"""
|
89
|
+
if not is_windows():
|
90
|
+
return
|
91
|
+
|
92
|
+
from .window import WinEventFilter, WinEventManager
|
93
|
+
|
81
94
|
self.win_event_filter = WinEventFilter(self.root_window)
|
95
|
+
self.win_event_manager = WinEventManager()
|
82
96
|
|
83
97
|
app_instance = QApplication.instance()
|
84
98
|
app_instance.installNativeEventFilter(self.win_event_filter)
|
85
99
|
self.engine.rootContext().setContextProperty("WinEventManager", self.win_event_manager)
|
86
100
|
self._apply_windows_effects()
|
87
101
|
|
88
|
-
|
89
|
-
|
90
|
-
def setIcon(self, path: str) -> None:
|
102
|
+
def setIcon(self, path: Union[str, Path] = None) -> None:
|
91
103
|
"""
|
92
104
|
Sets the icon for the application.
|
93
|
-
:param path: str, icon file path (eg = "path/to/icon.png")
|
105
|
+
:param path: str or Path, icon file path (eg = "path/to/icon.png")
|
94
106
|
:return:
|
95
107
|
"""
|
96
108
|
app_instance = QApplication.instance()
|
@@ -105,7 +117,7 @@ class RinUIWindow:
|
|
105
117
|
Apply Windows effects to the window.
|
106
118
|
:return:
|
107
119
|
"""
|
108
|
-
if
|
120
|
+
if is_windows():
|
109
121
|
self.theme_manager.apply_backdrop_effect(self.theme_manager.get_backdrop_effect())
|
110
122
|
self.theme_manager.apply_window_effects()
|
111
123
|
|
RinUI/qmldir
CHANGED
@@ -29,6 +29,7 @@ PickerView 1.0 components/DateAndTime/PickerView.qml
|
|
29
29
|
|
30
30
|
# Dialogs & Flyouts
|
31
31
|
Dialog 1.0 components/DialogsAndFlyouts/Dialog.qml
|
32
|
+
DialogButtonBox 1.0 components/DialogsAndFlyouts/DialogButtonBox.qml
|
32
33
|
Flyout 1.0 components/DialogsAndFlyouts/Flyout.qml
|
33
34
|
Popup 1.0 components/DialogsAndFlyouts/Popup.qml
|
34
35
|
TeachingTip 1.0 components/DialogsAndFlyouts/TeachingTip.qml
|
@@ -53,6 +54,7 @@ InfoBar 1.0 components/StatusAndInfo/InfoBar.qml
|
|
53
54
|
ProgressBar 1.0 components/StatusAndInfo/ProgressBar.qml
|
54
55
|
ProgressRing 1.0 components/StatusAndInfo/ProgressRing.qml
|
55
56
|
ToolTip 1.0 components/StatusAndInfo/ToolTip.qml
|
57
|
+
BusyIndicator 1.0 components/StatusAndInfo/BusyIndicator.qml
|
56
58
|
|
57
59
|
# ListAndCollections
|
58
60
|
Clip 1.0 components/ListAndCollections/Clip.qml
|
RinUI/windows/TitleBar.qml
CHANGED
@@ -54,8 +54,8 @@ Item {
|
|
54
54
|
onPressed: {
|
55
55
|
clickPos = Qt.point(mouseX, mouseY)
|
56
56
|
|
57
|
-
if (
|
58
|
-
return
|
57
|
+
if (Qt.platform.os !== "windows" || !WindowManager._isWinMgrInitialized()) {
|
58
|
+
return
|
59
59
|
}
|
60
60
|
WindowManager.sendDragWindowEvent(window)
|
61
61
|
}
|
@@ -65,7 +65,8 @@ Item {
|
|
65
65
|
return
|
66
66
|
}
|
67
67
|
|
68
|
-
if (
|
68
|
+
if (Qt.platform.os !== "windows" && WindowManager._isWinMgrInitialized()) {
|
69
|
+
log("Windows only")
|
69
70
|
return // 在win环境使用原生方法拖拽
|
70
71
|
}
|
71
72
|
|
RinUI/windows/WindowManager.qml
CHANGED
@@ -8,7 +8,7 @@ Item {
|
|
8
8
|
|
9
9
|
function sendDragWindowEvent(window) {
|
10
10
|
if (!_isWinMgrInitialized()) {
|
11
|
-
console.error("
|
11
|
+
console.error("WindowManager is not defined.")
|
12
12
|
return -1
|
13
13
|
}
|
14
14
|
WinEventManager.dragWindowEvent(WinEventManager.getWindowId(window))
|
@@ -16,14 +16,23 @@ Item {
|
|
16
16
|
|
17
17
|
function maximizeWindow(window) {
|
18
18
|
if (!_isWinMgrInitialized()) {
|
19
|
-
console.
|
20
|
-
return -1
|
19
|
+
console.warn("WindowManager is not defined.")
|
21
20
|
}
|
22
|
-
if (
|
21
|
+
if (Qt.platform.os === "windows") {
|
23
22
|
WinEventManager.maximizeWindow(WinEventManager.getWindowId(window))
|
24
23
|
return // 在win环境使用原生方法拖拽
|
25
24
|
}
|
26
25
|
|
27
|
-
window
|
26
|
+
toggleMaximizeWindow(window)
|
27
|
+
}
|
28
|
+
|
29
|
+
function toggleMaximizeWindow(window) {
|
30
|
+
if (!window) return;
|
31
|
+
|
32
|
+
if (window.visibility === Window.Maximized || window.isMaximized) {
|
33
|
+
window.showNormal();
|
34
|
+
} else {
|
35
|
+
window.showMaximized();
|
36
|
+
}
|
28
37
|
}
|
29
38
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
RinUI/__init__.py,sha256=
|
2
|
-
RinUI/qmldir,sha256=
|
1
|
+
RinUI/__init__.py,sha256=d9IqpbSfnP6x6uXkS5V5liug1uHaNhct-nbJQXNhEAA,67
|
2
|
+
RinUI/qmldir,sha256=M0TVfvNm_nrx1s6rxXvUIP-8m3Oc9UhqHDxQfEIdQTA,3959
|
3
3
|
RinUI/assets/fonts/FluentSystemIcons-Index.js,sha256=M2fUmCiOI7A1rxLWMFaekrB4KmasTSwbociYOzHJegE,253422
|
4
4
|
RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf,sha256=-IfF3NT1eODD0vOLVLC0Z2U5bsR6woSQAziX3qD1TqU,1447252
|
5
5
|
RinUI/assets/img/default_app_icon.png,sha256=8O83zl-bghUNsmEx9iCWYiXS8aC_0VGZKqMHdNKjB4A,292885
|
@@ -11,7 +11,7 @@ RinUI/components/Indicator.qml,sha256=nTF4i3tqLirb-gZlK1BCNzt0pVXgcvDBcJ2O-tOcQ8
|
|
11
11
|
RinUI/components/ScrollBar.qml,sha256=EZt2o_yVi--Q0BPQCqebau9bu7_ogNvqglrRXnB_eW8,6914
|
12
12
|
RinUI/components/ScrollView.qml,sha256=nMXwarFEnr8HVxRE1FjwyCuVIm2jvt_ZZBi8LGlkwCI,263
|
13
13
|
RinUI/components/Shadow.qml,sha256=8y9iAFr45hqDdXXnsfD49t90HHhiFyMzGUHqJa2tavk,1591
|
14
|
-
RinUI/components/qmldir,sha256=
|
14
|
+
RinUI/components/qmldir,sha256=C97LLzpdSj5ytAp8KBIpYI4nVECTk6yUhC4ayOkX5Ys,2303
|
15
15
|
RinUI/components/BasicInput/Button.qml,sha256=78Qi7w7cR7N7nwdc9n1JNQ9F_SBlhF6KdVmdPQyqR2o,5244
|
16
16
|
RinUI/components/BasicInput/CheckBox.qml,sha256=SJkmo16EY-5omXBxkS74Pk3UcSE_LODABIjiP086aNM,3085
|
17
17
|
RinUI/components/BasicInput/ComboBox.qml,sha256=-ZT3FWGybTX1ltEDhTJuoxiG0gW3OlDcxfPdHnVwqsM,4111
|
@@ -58,10 +58,11 @@ RinUI/components/Navigation/Segmented.qml,sha256=GnLKbJlNxGsaYnSnNflZ3rB3fe5HsRC
|
|
58
58
|
RinUI/components/Navigation/SegmentedItem.qml,sha256=r2e1PteQJTPiqjpCqtGlSIuzCLG03ov9AcPIfqwRJDg,2894
|
59
59
|
RinUI/components/Navigation/SelectorBar.qml,sha256=R0DWhWD75QaRYBYV5TTltJm4Y6KJ1ax29khdtn5GvDI,207
|
60
60
|
RinUI/components/Navigation/SelectorBarItem.qml,sha256=ohdqUxczPJw_SNFLYOIu8rIYa3gWDH-PTd5DRQ8jUpU,2104
|
61
|
+
RinUI/components/StatusAndInfo/BusyIndicator.qml,sha256=N99PKoAH-mvayLBtKUOjWObOXE7uHrvEY8j0rl1Qx7Q,263
|
61
62
|
RinUI/components/StatusAndInfo/InfoBadge.qml,sha256=G_mRlnGVhL-Eyo0LB7PWl-i8C-sUGzzXeKaVkz9Fpa0,2380
|
62
63
|
RinUI/components/StatusAndInfo/InfoBar.qml,sha256=M_oG4vNFEdPexCB8lOOwk57HEasyCc07cLNFxJ-HC80,7578
|
63
|
-
RinUI/components/StatusAndInfo/ProgressBar.qml,sha256=
|
64
|
-
RinUI/components/StatusAndInfo/ProgressRing.qml,sha256
|
64
|
+
RinUI/components/StatusAndInfo/ProgressBar.qml,sha256=4q2LKNHNFYChl81Hwhwm_9GcYcBfefaUXz9rKCSjQ0k,3363
|
65
|
+
RinUI/components/StatusAndInfo/ProgressRing.qml,sha256=aeWl1v3hom-iI2MNkO_FfFkJaJy23Lo49oiL6bwclaM,5088
|
65
66
|
RinUI/components/StatusAndInfo/Toast.qml,sha256=XWZPgFBJnqoWoS6H9W3ycC9JTU1CTzehqVIm2KXhD6Y,6815
|
66
67
|
RinUI/components/StatusAndInfo/ToolTip.qml,sha256=f6S9rG_0GsHQl8BB1m4Niik35s7LngelAasLfFkdR7s,2664
|
67
68
|
RinUI/components/Text/SpinBox.qml,sha256=rY17yJ3a0ckkl6pX00qVIQQYLmoO-GLtcSZh-WKtPZs,4616
|
@@ -69,9 +70,9 @@ RinUI/components/Text/Text.qml,sha256=SWJBJtAWkq9XldrX6_BWfCXGRcLQLBNofkRO5NG8q2
|
|
69
70
|
RinUI/components/Text/TextArea.qml,sha256=guhwcFBSEyZkTRT2V0ER3S03xW9WOkH_4U2Oor2I9PY,3706
|
70
71
|
RinUI/components/Text/TextField.qml,sha256=BXuJ16AUQaSh-Og7jaYSNEu9r1PcyG7FQ95DaGciJZs,3556
|
71
72
|
RinUI/components/Text/TextInput.qml,sha256=gyTJmrYi5yuc-j5dDRSbu5PCxiuQo2xNBm6jWL9ezYk,1611
|
72
|
-
RinUI/core/__init__.py,sha256=
|
73
|
-
RinUI/core/config.py,sha256=
|
74
|
-
RinUI/core/launcher.py,sha256=
|
73
|
+
RinUI/core/__init__.py,sha256=xNbsFDXuObMebyn0Xsxieenh0fsAEjULqBd9qd8suTY,283
|
74
|
+
RinUI/core/config.py,sha256=h5tbQurVtpnfB10OMTWEZstzsF93zDOPDmbP9NRgvJk,3683
|
75
|
+
RinUI/core/launcher.py,sha256=ZWBGQP0DT2oWZXvqRK9cW7eRmImZe8L1B1-0ONgaGnc,5812
|
75
76
|
RinUI/core/theme.py,sha256=r47QltFKy_s-B1neVAjYIx_jOxxtsdJEMP-u-YJ8mpA,9832
|
76
77
|
RinUI/core/translator.py,sha256=5GK7Iy7-2iMicF8hQr79CwU9UWvCwE-8vGd8QkhJ1h8,1037
|
77
78
|
RinUI/core/window.py,sha256=KIu3qpN_RKcMc-8o6qxYAWecDVNBtjxCjqUN04RaI6I,7161
|
@@ -99,16 +100,16 @@ RinUI/windows/CtrlBtn.qml,sha256=8wQH3PWYmZ_e6A0_CIdmYa7uIrU6O6MZCG_RR4S4fkg,315
|
|
99
100
|
RinUI/windows/FluentPage.qml,sha256=J7mXTOyMahdWA8U13rSjesJVsvxklZFQyqwVMiJarT8,2748
|
100
101
|
RinUI/windows/FluentWindow.qml,sha256=CUx9H5crOKtPSCnA6_AUst4PcLEbhSjDRrSuWH8novA,969
|
101
102
|
RinUI/windows/FluentWindowBase.qml,sha256=rUUHO1lIjIIvrHjKHwSIEn8WOG2kY45mJQQT_KrGZDM,4335
|
102
|
-
RinUI/windows/TitleBar.qml,sha256=
|
103
|
-
RinUI/windows/WindowManager.qml,sha256=
|
103
|
+
RinUI/windows/TitleBar.qml,sha256=QjnSb27Db2e8o2QniuJUMT0QI6awMbavVNex70Wsy2s,3591
|
104
|
+
RinUI/windows/WindowManager.qml,sha256=f-Il6FCPf3_o6edj5BbscK2XxQd3mmUVnZPZuOO88kc,1037
|
104
105
|
RinUI/windows/qmldir,sha256=oxyWR7Q8dWCrwwCwGNyf3l60qe6s4-beiZWWMAEkKcM,252
|
105
106
|
RinUI/windows/window/ApplicationWindow.qml,sha256=qRaM8IY0TJxfq1j1DogTMyrPjyoXkuWVzxtZQLzRtOQ,167
|
106
107
|
RinUI/windows/window/Window.qml,sha256=90YjjRoaul9qK4FxNy73zTaPuUmLvk_RjcPlBEa7DNI,3189
|
107
|
-
rinui-0.1.
|
108
|
-
rinui-0.1.
|
109
|
-
rinui-0.1.
|
110
|
-
rinui-0.1.
|
111
|
-
rinui-0.1.
|
112
|
-
rinui-0.1.
|
113
|
-
rinui-0.1.
|
114
|
-
rinui-0.1.
|
108
|
+
rinui-0.1.4.1.data/data/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
|
109
|
+
rinui-0.1.4.1.data/data/README.md,sha256=8ZcR55RYV2slRAQbhoYhqDTPOLXmewkFSvuA_cE6zD0,3044
|
110
|
+
rinui-0.1.4.1.dist-info/licenses/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
|
111
|
+
rinui-0.1.4.1.dist-info/METADATA,sha256=YmwxS5tHeWcDsCsZxZlH2vYgo3vyXCZSw3-9yvbpBx0,3577
|
112
|
+
rinui-0.1.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
113
|
+
rinui-0.1.4.1.dist-info/entry_points.txt,sha256=taxuZYCggoQa2LPubwcurQYRjBRC4cNYOjWaqOYZVxw,54
|
114
|
+
rinui-0.1.4.1.dist-info/top_level.txt,sha256=vKKjXBXEw5OFRIzTxZWUC5ZOj0CK5e3atbymBB4eJ6w,6
|
115
|
+
rinui-0.1.4.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|