RinUI 0.1.2__py3-none-any.whl → 0.1.3__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/core/__init__.py +1 -0
- RinUI/core/launcher.py +20 -8
- RinUI/core/theme.py +0 -31
- RinUI/core/window.py +214 -0
- RinUI/themes/theme.qml +0 -9
- RinUI/windows/CtrlBtn.qml +1 -5
- RinUI/windows/FluentWindowBase.qml +4 -11
- RinUI/windows/TitleBar.qml +2 -6
- RinUI/windows/WindowManager.qml +29 -0
- RinUI/windows/qmldir +3 -1
- RinUI/windows/window/ApplicationWindow.qml +0 -1
- RinUI/windows/window/Window.qml +3 -13
- {rinui-0.1.2.dist-info → rinui-0.1.3.dist-info}/METADATA +3 -3
- {rinui-0.1.2.dist-info → rinui-0.1.3.dist-info}/RECORD +21 -19
- {rinui-0.1.2.data → rinui-0.1.3.data}/data/LICENSE +0 -0
- {rinui-0.1.2.data → rinui-0.1.3.data}/data/README.md +0 -0
- {rinui-0.1.2.dist-info → rinui-0.1.3.dist-info}/WHEEL +0 -0
- {rinui-0.1.2.dist-info → rinui-0.1.3.dist-info}/entry_points.txt +0 -0
- {rinui-0.1.2.dist-info → rinui-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {rinui-0.1.2.dist-info → rinui-0.1.3.dist-info}/top_level.txt +0 -0
RinUI/__init__.py
CHANGED
RinUI/core/__init__.py
CHANGED
RinUI/core/launcher.py
CHANGED
@@ -9,6 +9,7 @@ from PySide6.QtQml import QQmlApplicationEngine
|
|
9
9
|
from pathlib import Path
|
10
10
|
|
11
11
|
from .theme import ThemeManager
|
12
|
+
from .window import WinEventFilter, WinEventManager
|
12
13
|
from .config import BackdropEffect, is_windows, Theme, RINUI_PATH, RinConfig
|
13
14
|
|
14
15
|
|
@@ -22,7 +23,15 @@ class RinUIWindow:
|
|
22
23
|
super().__init__()
|
23
24
|
if hasattr(self, "_initialized") and self._initialized:
|
24
25
|
return
|
26
|
+
|
27
|
+
self.root_window = None
|
28
|
+
self.engine = QQmlApplicationEngine()
|
29
|
+
self.theme_manager = ThemeManager()
|
30
|
+
self.win_event_filter = None
|
31
|
+
self.win_event_manager = WinEventManager()
|
32
|
+
self.qml_path = qml_path
|
25
33
|
self._initialized = True
|
34
|
+
|
26
35
|
print("✨ RinUIWindow Initializing")
|
27
36
|
|
28
37
|
# 退出清理
|
@@ -30,11 +39,6 @@ class RinUIWindow:
|
|
30
39
|
if not app_instance:
|
31
40
|
raise RuntimeError("QApplication must be created before RinUIWindow.")
|
32
41
|
|
33
|
-
self.engine = QQmlApplicationEngine()
|
34
|
-
self.theme_manager = ThemeManager()
|
35
|
-
self.qml_path = qml_path
|
36
|
-
self.autoSetWindowsEffect = True
|
37
|
-
|
38
42
|
app_instance.aboutToQuit.connect(self.theme_manager.clean_up)
|
39
43
|
|
40
44
|
if qml_path is not None:
|
@@ -49,8 +53,9 @@ class RinUIWindow:
|
|
49
53
|
# RInUI 模块
|
50
54
|
print(f"UI Module Path: {RINUI_PATH}")
|
51
55
|
|
52
|
-
if qml_path is
|
53
|
-
|
56
|
+
if qml_path is None:
|
57
|
+
raise ValueError("QML path must be provided to load the window.")
|
58
|
+
self.qml_path = qml_path
|
54
59
|
|
55
60
|
if os.path.exists(RINUI_PATH):
|
56
61
|
self.engine.addImportPath(RINUI_PATH)
|
@@ -71,7 +76,14 @@ class RinUIWindow:
|
|
71
76
|
self.root_window = self.engine.rootObjects()[0]
|
72
77
|
|
73
78
|
self.theme_manager.set_window(self.root_window)
|
74
|
-
|
79
|
+
|
80
|
+
# 窗口句柄管理
|
81
|
+
self.win_event_filter = WinEventFilter(self.root_window)
|
82
|
+
|
83
|
+
app_instance = QApplication.instance()
|
84
|
+
app_instance.installNativeEventFilter(self.win_event_filter)
|
85
|
+
self.engine.rootContext().setContextProperty("WinEventManager", self.win_event_manager)
|
86
|
+
self._apply_windows_effects()
|
75
87
|
|
76
88
|
self._print_startup_info()
|
77
89
|
|
RinUI/core/theme.py
CHANGED
@@ -292,10 +292,6 @@ class ThemeManager(QObject):
|
|
292
292
|
"""获取当前主题名称"""
|
293
293
|
return self.current_theme
|
294
294
|
|
295
|
-
@Slot(str)
|
296
|
-
def receive(self, message):
|
297
|
-
print(message)
|
298
|
-
|
299
295
|
@Slot(result=str)
|
300
296
|
def get_backdrop_effect(self):
|
301
297
|
"""获取当前背景效果"""
|
@@ -311,30 +307,3 @@ class ThemeManager(QObject):
|
|
311
307
|
def get_theme_color(self):
|
312
308
|
"""获取当前主题颜色"""
|
313
309
|
return RinConfig["theme_color"]
|
314
|
-
|
315
|
-
@Slot(QObject, result=int)
|
316
|
-
def getWindowId(self, window):
|
317
|
-
"""获取窗口的句柄"""
|
318
|
-
print(f"GetWindowId: {window.winId()}")
|
319
|
-
return int(window.winId())
|
320
|
-
|
321
|
-
@Slot(int)
|
322
|
-
def dragWindowEvent(self, hwnd):
|
323
|
-
""" 在Windows 用原生方法拖动"""
|
324
|
-
if not is_windows() or hwnd not in self.windows:
|
325
|
-
print(
|
326
|
-
f"Use Qt method to drag window on: {platform.system()}"
|
327
|
-
if not is_windows() else f"Invalid window handle: {hwnd}"
|
328
|
-
)
|
329
|
-
return
|
330
|
-
|
331
|
-
import win32con
|
332
|
-
from win32gui import ReleaseCapture
|
333
|
-
from win32api import SendMessage
|
334
|
-
|
335
|
-
ReleaseCapture()
|
336
|
-
SendMessage(
|
337
|
-
hwnd,
|
338
|
-
win32con.WM_SYSCOMMAND,
|
339
|
-
win32con.SC_MOVE | win32con.HTCAPTION, 0
|
340
|
-
)
|
RinUI/core/window.py
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
import platform
|
2
|
+
|
3
|
+
from PySide6.QtCore import QAbstractNativeEventFilter, QByteArray, QObject, Slot
|
4
|
+
import ctypes
|
5
|
+
from ctypes import wintypes
|
6
|
+
|
7
|
+
import win32con
|
8
|
+
from win32gui import ReleaseCapture, GetWindowPlacement, ShowWindow
|
9
|
+
from win32con import SW_MAXIMIZE, SW_RESTORE
|
10
|
+
from win32api import SendMessage
|
11
|
+
|
12
|
+
from RinUI.core.config import is_windows
|
13
|
+
|
14
|
+
# 定义 Windows 类型
|
15
|
+
ULONG_PTR = ctypes.c_ulong if ctypes.sizeof(ctypes.c_void_p) == 4 else ctypes.c_ulonglong
|
16
|
+
LONG = ctypes.c_long
|
17
|
+
|
18
|
+
|
19
|
+
# 自定义结构体 MONITORINFO
|
20
|
+
class MONITORINFO(ctypes.Structure):
|
21
|
+
_fields_ = [
|
22
|
+
('cbSize', wintypes.DWORD),
|
23
|
+
('rcMonitor', wintypes.RECT),
|
24
|
+
('rcWork', wintypes.RECT),
|
25
|
+
('dwFlags', wintypes.DWORD)
|
26
|
+
]
|
27
|
+
|
28
|
+
|
29
|
+
class MSG(ctypes.Structure):
|
30
|
+
_fields_ = [
|
31
|
+
("hwnd", ctypes.c_void_p),
|
32
|
+
("message", wintypes.UINT),
|
33
|
+
("wParam", wintypes.WPARAM),
|
34
|
+
("lParam", wintypes.LPARAM),
|
35
|
+
("time", wintypes.DWORD),
|
36
|
+
("pt", wintypes.POINT),
|
37
|
+
]
|
38
|
+
|
39
|
+
|
40
|
+
user32 = ctypes.windll.user32
|
41
|
+
|
42
|
+
# 定义必要的 Windows 常量
|
43
|
+
WM_NCCALCSIZE = 0x0083
|
44
|
+
WM_NCHITTEST = 0x0084
|
45
|
+
WM_SYSCOMMAND = 0x0112
|
46
|
+
WM_GETMINMAXINFO = 0x0024
|
47
|
+
|
48
|
+
WS_CAPTION = 0x00C00000
|
49
|
+
WS_THICKFRAME = 0x00040000
|
50
|
+
|
51
|
+
SC_MINIMIZE = 0xF020
|
52
|
+
SC_MAXIMIZE = 0xF030
|
53
|
+
SC_RESTORE = 0xF120
|
54
|
+
|
55
|
+
|
56
|
+
class MINMAXINFO(ctypes.Structure):
|
57
|
+
_fields_ = [
|
58
|
+
("ptReserved", wintypes.POINT),
|
59
|
+
("ptMaxSize", wintypes.POINT),
|
60
|
+
("ptMaxPosition", wintypes.POINT),
|
61
|
+
("ptMinTrackSize", wintypes.POINT),
|
62
|
+
("ptMaxTrackSize", wintypes.POINT),
|
63
|
+
]
|
64
|
+
|
65
|
+
|
66
|
+
class WinEventManager(QObject):
|
67
|
+
@Slot(QObject, result=int)
|
68
|
+
def getWindowId(self, window):
|
69
|
+
"""获取窗口的句柄"""
|
70
|
+
print(f"GetWindowId: {window.winId()}")
|
71
|
+
return int(window.winId())
|
72
|
+
|
73
|
+
@Slot(int)
|
74
|
+
def dragWindowEvent(self, hwnd: int):
|
75
|
+
""" 在Windows 用原生方法拖动"""
|
76
|
+
if not is_windows() or type(hwnd) is not int or hwnd == 0:
|
77
|
+
print(
|
78
|
+
f"Use Qt method to drag window on: {platform.system()}"
|
79
|
+
if not is_windows() else f"Invalid window handle: {hwnd}"
|
80
|
+
)
|
81
|
+
return
|
82
|
+
|
83
|
+
ReleaseCapture()
|
84
|
+
SendMessage(
|
85
|
+
hwnd,
|
86
|
+
win32con.WM_SYSCOMMAND,
|
87
|
+
win32con.SC_MOVE | win32con.HTCAPTION, 0
|
88
|
+
)
|
89
|
+
|
90
|
+
@Slot(int)
|
91
|
+
def maximizeWindow(self, hwnd):
|
92
|
+
"""在Windows上最大化或还原窗口"""
|
93
|
+
if not is_windows() or type(hwnd) is not int or hwnd == 0:
|
94
|
+
print(
|
95
|
+
f"Use Qt method to drag window on: {platform.system()}"
|
96
|
+
if not is_windows() else f"Invalid window handle: {hwnd}"
|
97
|
+
)
|
98
|
+
return
|
99
|
+
|
100
|
+
try:
|
101
|
+
placement = GetWindowPlacement(hwnd)
|
102
|
+
current_state = placement[1]
|
103
|
+
|
104
|
+
if current_state == SW_MAXIMIZE:
|
105
|
+
ShowWindow(hwnd, SW_RESTORE)
|
106
|
+
else:
|
107
|
+
ShowWindow(hwnd, SW_MAXIMIZE)
|
108
|
+
|
109
|
+
except Exception as e:
|
110
|
+
print(f"Error toggling window state: {e}")
|
111
|
+
|
112
|
+
|
113
|
+
class WinEventFilter(QAbstractNativeEventFilter):
|
114
|
+
def __init__(self, window):
|
115
|
+
super().__init__()
|
116
|
+
self.window = window
|
117
|
+
self.hwnd = int(window.winId())
|
118
|
+
self.resize_border = 8 # resize 边框宽度
|
119
|
+
|
120
|
+
self.set_window_styles()
|
121
|
+
|
122
|
+
def set_window_styles(self):
|
123
|
+
"""设置必要的窗口样式以启用原生窗口行为"""
|
124
|
+
style = user32.GetWindowLongPtrW(self.hwnd, -16) # GWL_STYLE
|
125
|
+
|
126
|
+
style |= WS_CAPTION | WS_THICKFRAME
|
127
|
+
user32.SetWindowLongPtrW(self.hwnd, -16, style) # GWL_STYLE
|
128
|
+
|
129
|
+
# 重绘
|
130
|
+
user32.SetWindowPos(self.hwnd, 0, 0, 0, 0, 0,
|
131
|
+
0x0002 | 0x0001 | 0x0040) # SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED
|
132
|
+
|
133
|
+
def nativeEventFilter(self, eventType: QByteArray, message):
|
134
|
+
if eventType != b"windows_generic_MSG":
|
135
|
+
return False, 0
|
136
|
+
|
137
|
+
try:
|
138
|
+
message_addr = int(message)
|
139
|
+
except:
|
140
|
+
buf = memoryview(message)
|
141
|
+
message_addr = ctypes.addressof(ctypes.c_char.from_buffer(buf))
|
142
|
+
|
143
|
+
# 直接使用内存地址访问 MSG 字段
|
144
|
+
hwnd = ctypes.c_void_p.from_address(message_addr).value
|
145
|
+
message_id = wintypes.UINT.from_address(message_addr + ctypes.sizeof(ctypes.c_void_p)).value
|
146
|
+
wParam = wintypes.WPARAM.from_address(message_addr + 2 * ctypes.sizeof(ctypes.c_void_p)).value
|
147
|
+
lParam = wintypes.LPARAM.from_address(message_addr + 3 * ctypes.sizeof(ctypes.c_void_p)).value
|
148
|
+
|
149
|
+
if message_id == WM_NCHITTEST:
|
150
|
+
x = ctypes.c_short(lParam & 0xFFFF).value
|
151
|
+
y = ctypes.c_short((lParam >> 16) & 0xFFFF).value
|
152
|
+
|
153
|
+
rect = wintypes.RECT()
|
154
|
+
user32.GetWindowRect(self.hwnd, ctypes.byref(rect))
|
155
|
+
left, top, right, bottom = rect.left, rect.top, rect.right, rect.bottom
|
156
|
+
border = self.resize_border
|
157
|
+
|
158
|
+
if left <= x < left + border:
|
159
|
+
if top <= y < top + border:
|
160
|
+
return True, 13 # HTTOPLEFT
|
161
|
+
elif bottom - border <= y < bottom:
|
162
|
+
return True, 16 # HTBOTTOMLEFT
|
163
|
+
else:
|
164
|
+
return True, 10 # HTLEFT
|
165
|
+
elif right - border <= x < right:
|
166
|
+
if top <= y < top + border:
|
167
|
+
return True, 14 # HTTOPRIGHT
|
168
|
+
elif bottom - border <= y < bottom:
|
169
|
+
return True, 17 # HTBOTTOMRIGHT
|
170
|
+
else:
|
171
|
+
return True, 11 # HTRIGHT
|
172
|
+
elif top <= y < top + border:
|
173
|
+
return True, 12 # HTTOP
|
174
|
+
elif bottom - border <= y < bottom:
|
175
|
+
return True, 15 # HTBOTTOM
|
176
|
+
|
177
|
+
# 其他区域不处理
|
178
|
+
return False, 0
|
179
|
+
|
180
|
+
# 移除标题栏
|
181
|
+
elif message_id == WM_NCCALCSIZE and wParam:
|
182
|
+
return True, 0
|
183
|
+
|
184
|
+
# 支持动画
|
185
|
+
elif message_id == WM_SYSCOMMAND:
|
186
|
+
return False, 0
|
187
|
+
|
188
|
+
# 处理 WM_GETMINMAXINFO 消息以支持 Snap 功能
|
189
|
+
elif message_id == WM_GETMINMAXINFO:
|
190
|
+
# 获取屏幕工作区大小
|
191
|
+
monitor = user32.MonitorFromWindow(self.hwnd, 2) # MONITOR_DEFAULTTONEAREST
|
192
|
+
|
193
|
+
# 使用自定义的 MONITORINFO 结构
|
194
|
+
monitor_info = MONITORINFO()
|
195
|
+
monitor_info.cbSize = ctypes.sizeof(MONITORINFO)
|
196
|
+
monitor_info.dwFlags = 0
|
197
|
+
user32.GetMonitorInfoW(monitor, ctypes.byref(monitor_info))
|
198
|
+
|
199
|
+
# 获取 MINMAXINFO 结构
|
200
|
+
minmax_info = MINMAXINFO.from_address(lParam)
|
201
|
+
|
202
|
+
# 设置最大化位置和大小
|
203
|
+
minmax_info.ptMaxPosition.x = monitor_info.rcWork.left - monitor_info.rcMonitor.left
|
204
|
+
minmax_info.ptMaxPosition.y = monitor_info.rcWork.top - monitor_info.rcMonitor.top
|
205
|
+
minmax_info.ptMaxSize.x = monitor_info.rcWork.right - monitor_info.rcWork.left
|
206
|
+
minmax_info.ptMaxSize.y = monitor_info.rcWork.bottom - monitor_info.rcWork.top
|
207
|
+
|
208
|
+
# 设置最小跟踪大小
|
209
|
+
minmax_info.ptMinTrackSize.x = 200 # 最小宽度
|
210
|
+
minmax_info.ptMinTrackSize.y = 150 # 最小高度
|
211
|
+
|
212
|
+
return True, 0
|
213
|
+
|
214
|
+
return False, 0
|
RinUI/themes/theme.qml
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
pragma Singleton
|
2
2
|
import QtQuick 2.15
|
3
|
-
// import "../themes"
|
4
3
|
|
5
4
|
Item {
|
6
5
|
id: themeManager
|
@@ -44,14 +43,6 @@ Item {
|
|
44
43
|
ThemeManager.apply_backdrop_effect(effect)
|
45
44
|
}
|
46
45
|
|
47
|
-
function sendDragWindowEvent(window) {
|
48
|
-
if (!_isThemeMgrInitialized()) {
|
49
|
-
console.error("ThemeManager is not defined.")
|
50
|
-
return -1
|
51
|
-
}
|
52
|
-
ThemeManager.dragWindowEvent(ThemeManager.getWindowId(window))
|
53
|
-
}
|
54
|
-
|
55
46
|
function getBackdropEffect() {
|
56
47
|
if (!_isThemeMgrInitialized()) {
|
57
48
|
console.error("ThemeManager is not defined.")
|
RinUI/windows/CtrlBtn.qml
CHANGED
@@ -22,11 +22,7 @@ Base {
|
|
22
22
|
//关闭 最大化 最小化按钮
|
23
23
|
function toggleControl(mode) {
|
24
24
|
if (mode === 0) {
|
25
|
-
|
26
|
-
window.showNormal();
|
27
|
-
} else {
|
28
|
-
window.showMaximized();
|
29
|
-
}
|
25
|
+
WindowManager.maximizeWindow(window);
|
30
26
|
} else if (mode===1) {
|
31
27
|
window.showMinimized();
|
32
28
|
} else if (mode===2) {
|
@@ -14,15 +14,13 @@ ApplicationWindow {
|
|
14
14
|
minimumHeight: 300
|
15
15
|
property int hwnd: 0
|
16
16
|
|
17
|
-
flags:
|
18
|
-
|
19
|
-
color: frameless ? "transparent" : Theme.currentTheme.colors.backgroundColor
|
17
|
+
flags: Qt.FramelessWindowHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowMaximizeButtonHint | Qt.WindowCloseButtonHint
|
18
|
+
color: "transparent"
|
20
19
|
|
21
20
|
// 自定义属性
|
22
21
|
property var icon: "../assets/img/default_app_icon.png" // 图标
|
23
22
|
property alias titleEnabled: titleBar.titleEnabled
|
24
23
|
property int titleBarHeight: Theme.currentTheme.appearance.dialogTitleBarHeight
|
25
|
-
property bool frameless: true // 是否无边框
|
26
24
|
|
27
25
|
|
28
26
|
// 直接添加子项
|
@@ -34,7 +32,7 @@ ApplicationWindow {
|
|
34
32
|
onVisibilityChanged: {
|
35
33
|
if (baseWindow.visibility === Window.Maximized) {
|
36
34
|
background.radius = 0
|
37
|
-
background.border.width =
|
35
|
+
background.border.width = 1
|
38
36
|
} else {
|
39
37
|
background.radius = Theme.currentTheme.appearance.windowRadius
|
40
38
|
background.border.width = 1
|
@@ -52,7 +50,7 @@ ApplicationWindow {
|
|
52
50
|
|
53
51
|
// 顶部边距
|
54
52
|
Item {
|
55
|
-
Layout.preferredHeight:
|
53
|
+
Layout.preferredHeight: titleBar.height
|
56
54
|
Layout.fillWidth: true
|
57
55
|
}
|
58
56
|
|
@@ -78,7 +76,6 @@ ApplicationWindow {
|
|
78
76
|
title: baseWindow.title
|
79
77
|
Layout.fillWidth: true
|
80
78
|
height: baseWindow.titleBarHeight
|
81
|
-
visible: frameless
|
82
79
|
}
|
83
80
|
|
84
81
|
|
@@ -93,7 +90,6 @@ ApplicationWindow {
|
|
93
90
|
radius: Theme.currentTheme.appearance.windowRadius
|
94
91
|
z: -1
|
95
92
|
clip: true
|
96
|
-
visible: frameless
|
97
93
|
|
98
94
|
// Shadow {}
|
99
95
|
|
@@ -123,9 +119,6 @@ ApplicationWindow {
|
|
123
119
|
hoverEnabled: baseWindow.visibility !== Window.Maximized
|
124
120
|
z: -1
|
125
121
|
cursorShape: {
|
126
|
-
if (!baseWindow.frameless) {
|
127
|
-
return
|
128
|
-
}
|
129
122
|
const p = Qt.point(mouseX, mouseY)
|
130
123
|
const b = Utils.windowDragArea
|
131
124
|
if (p.x < b && p.y < b) return Qt.SizeFDiagCursor
|
RinUI/windows/TitleBar.qml
CHANGED
@@ -35,11 +35,7 @@ Item {
|
|
35
35
|
|
36
36
|
property var window: null
|
37
37
|
function toggleMaximized() {
|
38
|
-
|
39
|
-
window.showNormal();
|
40
|
-
} else {
|
41
|
-
window.showMaximized();
|
42
|
-
}
|
38
|
+
WindowManager.maximizeWindow(window)
|
43
39
|
}
|
44
40
|
|
45
41
|
Rectangle{
|
@@ -61,7 +57,7 @@ Item {
|
|
61
57
|
if (!(Qt.platform.os !== "windows" || Qt.platform.os !== "winrt") && !Theme._isThemeMgrInitialized()) {
|
62
58
|
return // 在win环境使用原生方法拖拽
|
63
59
|
}
|
64
|
-
|
60
|
+
WindowManager.sendDragWindowEvent(window)
|
65
61
|
}
|
66
62
|
onDoubleClicked: toggleMaximized()
|
67
63
|
onPositionChanged: (mouse) => {
|
@@ -0,0 +1,29 @@
|
|
1
|
+
pragma Singleton
|
2
|
+
import QtQuick 2.15
|
3
|
+
|
4
|
+
Item {
|
5
|
+
function _isWinMgrInitialized() {
|
6
|
+
return typeof WinEventManager!== "undefined"
|
7
|
+
}
|
8
|
+
|
9
|
+
function sendDragWindowEvent(window) {
|
10
|
+
if (!_isWinMgrInitialized()) {
|
11
|
+
console.error("ThemeManager is not defined.")
|
12
|
+
return -1
|
13
|
+
}
|
14
|
+
WinEventManager.dragWindowEvent(WinEventManager.getWindowId(window))
|
15
|
+
}
|
16
|
+
|
17
|
+
function maximizeWindow(window) {
|
18
|
+
if (!_isWinMgrInitialized()) {
|
19
|
+
console.error("ThemeManager is not defined.")
|
20
|
+
return -1
|
21
|
+
}
|
22
|
+
if ((Qt.platform.os !== "windows" || Qt.platform.os !== "winrt") && _isWinMgrInitialized()) {
|
23
|
+
WinEventManager.maximizeWindow(WinEventManager.getWindowId(window))
|
24
|
+
return // 在win环境使用原生方法拖拽
|
25
|
+
}
|
26
|
+
|
27
|
+
window.showMaximized()
|
28
|
+
}
|
29
|
+
}
|
RinUI/windows/qmldir
CHANGED
RinUI/windows/window/Window.qml
CHANGED
@@ -7,12 +7,10 @@ import "../../utils"
|
|
7
7
|
|
8
8
|
Window {
|
9
9
|
id: baseWindow
|
10
|
-
flags:
|
11
|
-
: Qt.Window
|
10
|
+
flags: Qt.FramelessWindowHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowMaximizeButtonHint | Qt.WindowCloseButtonHint
|
12
11
|
|
13
|
-
color:
|
14
|
-
property
|
15
|
-
default property alias content: baseWindow.data
|
12
|
+
color: "transparent"
|
13
|
+
default property alias content: contentArea.data
|
16
14
|
property int titleBarHeight: Theme.currentTheme.appearance.dialogTitleBarHeight
|
17
15
|
|
18
16
|
// 布局
|
@@ -27,7 +25,6 @@ Window {
|
|
27
25
|
Item {
|
28
26
|
Layout.preferredHeight: titleBar.height
|
29
27
|
Layout.fillWidth: true
|
30
|
-
visible: frameless
|
31
28
|
}
|
32
29
|
|
33
30
|
// 主体内容区域
|
@@ -52,7 +49,6 @@ Window {
|
|
52
49
|
title: baseWindow.title
|
53
50
|
Layout.fillWidth: true
|
54
51
|
height: baseWindow.titleBarHeight
|
55
|
-
visible: frameless
|
56
52
|
}
|
57
53
|
|
58
54
|
Rectangle {
|
@@ -62,9 +58,6 @@ Window {
|
|
62
58
|
border.color: Theme.currentTheme.colors.windowBorderColor
|
63
59
|
z: -1
|
64
60
|
clip: true
|
65
|
-
visible: frameless
|
66
|
-
|
67
|
-
// Shadow {}
|
68
61
|
|
69
62
|
Behavior on color {
|
70
63
|
ColorAnimation {
|
@@ -85,9 +78,6 @@ Window {
|
|
85
78
|
hoverEnabled: baseWindow.visibility !== Window.Maximized
|
86
79
|
z: -1
|
87
80
|
cursorShape: {
|
88
|
-
if (!frameless) {
|
89
|
-
return
|
90
|
-
}
|
91
81
|
const p = Qt.point(mouseX, mouseY)
|
92
82
|
const b = Utils.windowDragArea
|
93
83
|
if (p.x < b && p.y < b) return Qt.SizeFDiagCursor
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: RinUI
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
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
|
@@ -9,9 +9,9 @@ Classifier: Operating System :: OS Independent
|
|
9
9
|
Requires-Python: >=3.12
|
10
10
|
Description-Content-Type: text/markdown
|
11
11
|
License-File: LICENSE
|
12
|
-
Requires-Dist: PySide6
|
12
|
+
Requires-Dist: PySide6
|
13
13
|
Requires-Dist: darkdetect~=0.8.0
|
14
|
-
Requires-Dist: pywin32
|
14
|
+
Requires-Dist: pywin32; sys_platform == "win32"
|
15
15
|
Dynamic: license-file
|
16
16
|
|
17
17
|
<div align="center">
|
@@ -1,4 +1,4 @@
|
|
1
|
-
RinUI/__init__.py,sha256=
|
1
|
+
RinUI/__init__.py,sha256=XFdGWitmk8854o9fDDbtjxkAyReNgMgl7S3Iue7ssYc,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
|
@@ -69,11 +69,12 @@ RinUI/components/Text/Text.qml,sha256=SWJBJtAWkq9XldrX6_BWfCXGRcLQLBNofkRO5NG8q2
|
|
69
69
|
RinUI/components/Text/TextArea.qml,sha256=guhwcFBSEyZkTRT2V0ER3S03xW9WOkH_4U2Oor2I9PY,3706
|
70
70
|
RinUI/components/Text/TextField.qml,sha256=BXuJ16AUQaSh-Og7jaYSNEu9r1PcyG7FQ95DaGciJZs,3556
|
71
71
|
RinUI/components/Text/TextInput.qml,sha256=gyTJmrYi5yuc-j5dDRSbu5PCxiuQo2xNBm6jWL9ezYk,1611
|
72
|
-
RinUI/core/__init__.py,sha256=
|
72
|
+
RinUI/core/__init__.py,sha256=bjBBPyYGLXPggeyz-7lN_KgsziFKAlyw0Y_m5S4_lUU,248
|
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=kFHlhHPU6hf7F15DDUfZ9_hiacovJLOn-3xKWNj2CfI,5517
|
75
|
+
RinUI/core/theme.py,sha256=r47QltFKy_s-B1neVAjYIx_jOxxtsdJEMP-u-YJ8mpA,9832
|
76
76
|
RinUI/core/translator.py,sha256=5GK7Iy7-2iMicF8hQr79CwU9UWvCwE-8vGd8QkhJ1h8,1037
|
77
|
+
RinUI/core/window.py,sha256=KIu3qpN_RKcMc-8o6qxYAWecDVNBtjxCjqUN04RaI6I,7161
|
77
78
|
RinUI/hooks/__init__.py,sha256=7sQJlly1ZbiZTzZUkCV2hI_gY-DAxWP_0kLyhZQ2Tm8,74
|
78
79
|
RinUI/hooks/hook-RinUI.py,sha256=VvQui-b3YNuxvhqjRJqLPKdtnWQ6Ev8G9DEgzGNUUUI,116
|
79
80
|
RinUI/languages/en_US.qm,sha256=mVm1ELFdGJN4SK0TAH4wRZ0umTxn5WS62_wY-TVpXIU,16
|
@@ -85,7 +86,7 @@ RinUI/themes/Colors.qml,sha256=IZ3Ojdw4vGV3-1aDhMxy5wE0Q8TkBMzc2iLFm7Qr9FQ,1000
|
|
85
86
|
RinUI/themes/dark.qml,sha256=qAn7MDh18K-44f4gPIRiA1l_T_PWoBxhhzh0Z6igC0w,5793
|
86
87
|
RinUI/themes/light.qml,sha256=L1Qy1yotvF3GemfhQxxTt1keyMdsjOoK9COP6NyVQHE,5741
|
87
88
|
RinUI/themes/qmldir,sha256=7SbN6C8cqEW6VvPb-eYg9AlppfkehmekbciYNHRoNSA,184
|
88
|
-
RinUI/themes/theme.qml,sha256=
|
89
|
+
RinUI/themes/theme.qml,sha256=NRHnyGOW9o1se9xOq-_7YwOeLcgEyRRJl6wpbWnUrV8,3991
|
89
90
|
RinUI/themes/utils.qml,sha256=wJfvrsBTYZWi3uJmS-LFIJmsGWzxuT1lTvA7ufiG6Qg,1735
|
90
91
|
RinUI/utils/Animation.qml,sha256=hRzsJU_5G78JArYLvVtxTmRxX2VAuMgeWdAHzqyuYWQ,134
|
91
92
|
RinUI/utils/FloatLayer.qml,sha256=D0rkYxK6_09OjrNuLHDXhdsb4xbUq5l2IiuLHCsLGhE,3471
|
@@ -94,19 +95,20 @@ RinUI/utils/Position.qml,sha256=QuD_cYdU7ku3L1zxFX8e0ZKDvOOW7xbilP2_ebr7WB8,256
|
|
94
95
|
RinUI/utils/Severity.qml,sha256=fN3YQ_88kNGB-Z57pzcDrz15r-JPMLPJfNUVqKkYbas,155
|
95
96
|
RinUI/utils/Typography.qml,sha256=EJIlEymSWH4lWyRIrdWD9UZaExgGld81YQF1diaKKq8,232
|
96
97
|
RinUI/utils/qmldir,sha256=W2UTrZ5VPdRO64FZ3Pw-_8B2UPj7A_eHsGrLPvWtiZY,189
|
97
|
-
RinUI/windows/CtrlBtn.qml,sha256=
|
98
|
+
RinUI/windows/CtrlBtn.qml,sha256=8wQH3PWYmZ_e6A0_CIdmYa7uIrU6O6MZCG_RR4S4fkg,3152
|
98
99
|
RinUI/windows/FluentPage.qml,sha256=J7mXTOyMahdWA8U13rSjesJVsvxklZFQyqwVMiJarT8,2748
|
99
100
|
RinUI/windows/FluentWindow.qml,sha256=fR7JsLa-0QqrKFCh4kh6ZhQL7LoIRSPChKuoiYCeGLs,905
|
100
|
-
RinUI/windows/FluentWindowBase.qml,sha256=
|
101
|
-
RinUI/windows/TitleBar.qml,sha256=
|
102
|
-
RinUI/windows/
|
103
|
-
RinUI/windows/
|
104
|
-
RinUI/windows/window/
|
105
|
-
|
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.
|
101
|
+
RinUI/windows/FluentWindowBase.qml,sha256=rUUHO1lIjIIvrHjKHwSIEn8WOG2kY45mJQQT_KrGZDM,4335
|
102
|
+
RinUI/windows/TitleBar.qml,sha256=zzGfAo2p_SIFXarCuVG_zWhrraRBjIx9MS3cc_wV710,3645
|
103
|
+
RinUI/windows/WindowManager.qml,sha256=5XFddF38KP-TWhMVesqzQElr3ySrBWVIVuuiBgqi3A4,857
|
104
|
+
RinUI/windows/qmldir,sha256=oxyWR7Q8dWCrwwCwGNyf3l60qe6s4-beiZWWMAEkKcM,252
|
105
|
+
RinUI/windows/window/ApplicationWindow.qml,sha256=qRaM8IY0TJxfq1j1DogTMyrPjyoXkuWVzxtZQLzRtOQ,167
|
106
|
+
RinUI/windows/window/Window.qml,sha256=90YjjRoaul9qK4FxNy73zTaPuUmLvk_RjcPlBEa7DNI,3189
|
107
|
+
rinui-0.1.3.data/data/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
|
108
|
+
rinui-0.1.3.data/data/README.md,sha256=8ZcR55RYV2slRAQbhoYhqDTPOLXmewkFSvuA_cE6zD0,3044
|
109
|
+
rinui-0.1.3.dist-info/licenses/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
|
110
|
+
rinui-0.1.3.dist-info/METADATA,sha256=fV54AG1RI4v95j4OV5hzi3VtKFRZat2gJ1SqvFuIbRY,3576
|
111
|
+
rinui-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
112
|
+
rinui-0.1.3.dist-info/entry_points.txt,sha256=taxuZYCggoQa2LPubwcurQYRjBRC4cNYOjWaqOYZVxw,54
|
113
|
+
rinui-0.1.3.dist-info/top_level.txt,sha256=vKKjXBXEw5OFRIzTxZWUC5ZOj0CK5e3atbymBB4eJ6w,6
|
114
|
+
rinui-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|