RinUI 0.1.4.1__py3-none-any.whl → 0.1.5.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  from .core import *
2
2
 
3
- __version__ = "0.1.4.1"
3
+ __version__ = "0.1.5.1"
4
4
  __author__ = "RinLit"
@@ -107,7 +107,7 @@ SpinBox {
107
107
  // 恢复滚轮调整数值
108
108
  WheelHandler {
109
109
  id: wheelHandler
110
- target: spin
110
+ target: root
111
111
  onWheel: (event) => {
112
112
  if (!root.focus) {
113
113
  return; // 如果没有焦点,则不处理滚轮事件
RinUI/core/launcher.py CHANGED
@@ -1,4 +1,3 @@
1
- import os
2
1
  import sys
3
2
  from typing import Union
4
3
 
@@ -54,9 +53,9 @@ class RinUIWindow:
54
53
 
55
54
  if qml_path is None:
56
55
  raise ValueError("QML path must be provided to load the window.")
57
- self.qml_path = qml_path
56
+ self.qml_path = Path(qml_path)
58
57
 
59
- if os.path.exists(RINUI_PATH):
58
+ if self.qml_path.exists():
60
59
  self.engine.addImportPath(RINUI_PATH)
61
60
  else:
62
61
  raise FileNotFoundError(f"Cannot find RinUI module: {RINUI_PATH}")
@@ -106,6 +105,7 @@ class RinUIWindow:
106
105
  :return:
107
106
  """
108
107
  app_instance = QApplication.instance()
108
+ path = Path(path).as_posix()
109
109
  if app_instance:
110
110
  app_instance.setWindowIcon(QIcon(path)) # 设置应用程序图标
111
111
  self.root_window.setProperty('icon', QUrl.fromLocalFile(path))
RinUI/core/window.py CHANGED
@@ -1,10 +1,12 @@
1
1
  import platform
2
+ from typing import Optional
2
3
 
3
4
  from PySide6.QtCore import QAbstractNativeEventFilter, QByteArray, QObject, Slot
4
5
  import ctypes
5
6
  from ctypes import wintypes
6
7
 
7
8
  import win32con
9
+ from PySide6.QtQuick import QQuickWindow
8
10
  from win32gui import ReleaseCapture, GetWindowPlacement, ShowWindow
9
11
  from win32con import SW_MAXIMIZE, SW_RESTORE
10
12
  from win32api import SendMessage
@@ -111,13 +113,25 @@ class WinEventManager(QObject):
111
113
 
112
114
 
113
115
  class WinEventFilter(QAbstractNativeEventFilter):
114
- def __init__(self, window):
116
+ def __init__(self, window: QQuickWindow):
115
117
  super().__init__()
116
118
  self.window = window
117
- self.hwnd = int(window.winId())
118
- self.resize_border = 8 # resize 边框宽度
119
+ self.hwnd: Optional[int] = None
120
+ self.resize_border = 8
119
121
 
122
+ if not self.window.isVisible():
123
+ self.window.visibleChanged.connect(self._on_visible_changed)
124
+ else:
125
+ self._init_window_handle()
126
+
127
+ def _on_visible_changed(self, visible: bool):
128
+ if visible and self.hwnd is None:
129
+ self._init_window_handle()
130
+
131
+ def _init_window_handle(self):
132
+ self.hwnd = int(self.window.winId())
120
133
  self.set_window_styles()
134
+ print(f"Window handle set: {self.hwnd}")
121
135
 
122
136
  def set_window_styles(self):
123
137
  """设置必要的窗口样式以启用原生窗口行为"""
@@ -18,7 +18,7 @@ ApplicationWindow {
18
18
  color: "transparent"
19
19
 
20
20
  // 自定义属性
21
- property var icon: "../assets/img/default_app_icon.png" // 图标
21
+ property var icon: undefined // 图标
22
22
  property alias titleEnabled: titleBar.titleEnabled
23
23
  property int titleBarHeight: Theme.currentTheme.appearance.dialogTitleBarHeight
24
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RinUI
3
- Version: 0.1.4.1
3
+ Version: 0.1.5.1
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
@@ -1,4 +1,4 @@
1
- RinUI/__init__.py,sha256=d9IqpbSfnP6x6uXkS5V5liug1uHaNhct-nbJQXNhEAA,67
1
+ RinUI/__init__.py,sha256=GSLJRklPDTp2IWAkG_7YNn3tTmOWUVAsAj0TROxW5Wc,67
2
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
@@ -65,17 +65,17 @@ RinUI/components/StatusAndInfo/ProgressBar.qml,sha256=4q2LKNHNFYChl81Hwhwm_9GcYc
65
65
  RinUI/components/StatusAndInfo/ProgressRing.qml,sha256=aeWl1v3hom-iI2MNkO_FfFkJaJy23Lo49oiL6bwclaM,5088
66
66
  RinUI/components/StatusAndInfo/Toast.qml,sha256=XWZPgFBJnqoWoS6H9W3ycC9JTU1CTzehqVIm2KXhD6Y,6815
67
67
  RinUI/components/StatusAndInfo/ToolTip.qml,sha256=f6S9rG_0GsHQl8BB1m4Niik35s7LngelAasLfFkdR7s,2664
68
- RinUI/components/Text/SpinBox.qml,sha256=rY17yJ3a0ckkl6pX00qVIQQYLmoO-GLtcSZh-WKtPZs,4616
68
+ RinUI/components/Text/SpinBox.qml,sha256=lLJ8J5KPAi42ZK1bM5JUnME8njDsdzTSz_W-Tpp2L8A,4616
69
69
  RinUI/components/Text/Text.qml,sha256=SWJBJtAWkq9XldrX6_BWfCXGRcLQLBNofkRO5NG8q2Q,1714
70
70
  RinUI/components/Text/TextArea.qml,sha256=guhwcFBSEyZkTRT2V0ER3S03xW9WOkH_4U2Oor2I9PY,3706
71
71
  RinUI/components/Text/TextField.qml,sha256=BXuJ16AUQaSh-Og7jaYSNEu9r1PcyG7FQ95DaGciJZs,3556
72
72
  RinUI/components/Text/TextInput.qml,sha256=gyTJmrYi5yuc-j5dDRSbu5PCxiuQo2xNBm6jWL9ezYk,1611
73
73
  RinUI/core/__init__.py,sha256=xNbsFDXuObMebyn0Xsxieenh0fsAEjULqBd9qd8suTY,283
74
74
  RinUI/core/config.py,sha256=h5tbQurVtpnfB10OMTWEZstzsF93zDOPDmbP9NRgvJk,3683
75
- RinUI/core/launcher.py,sha256=ZWBGQP0DT2oWZXvqRK9cW7eRmImZe8L1B1-0ONgaGnc,5812
75
+ RinUI/core/launcher.py,sha256=oWRsnfH2vNjwFKPiZJ-YTC1eSp4MUnATL-ChEKNzg2U,5841
76
76
  RinUI/core/theme.py,sha256=r47QltFKy_s-B1neVAjYIx_jOxxtsdJEMP-u-YJ8mpA,9832
77
77
  RinUI/core/translator.py,sha256=5GK7Iy7-2iMicF8hQr79CwU9UWvCwE-8vGd8QkhJ1h8,1037
78
- RinUI/core/window.py,sha256=KIu3qpN_RKcMc-8o6qxYAWecDVNBtjxCjqUN04RaI6I,7161
78
+ RinUI/core/window.py,sha256=9nLjdPmFRp8Yx-qvz1_Cbi6u7JwWJZ5pDH1yFyA1etQ,7649
79
79
  RinUI/hooks/__init__.py,sha256=7sQJlly1ZbiZTzZUkCV2hI_gY-DAxWP_0kLyhZQ2Tm8,74
80
80
  RinUI/hooks/hook-RinUI.py,sha256=VvQui-b3YNuxvhqjRJqLPKdtnWQ6Ev8G9DEgzGNUUUI,116
81
81
  RinUI/languages/en_US.qm,sha256=mVm1ELFdGJN4SK0TAH4wRZ0umTxn5WS62_wY-TVpXIU,16
@@ -99,17 +99,17 @@ RinUI/utils/qmldir,sha256=W2UTrZ5VPdRO64FZ3Pw-_8B2UPj7A_eHsGrLPvWtiZY,189
99
99
  RinUI/windows/CtrlBtn.qml,sha256=8wQH3PWYmZ_e6A0_CIdmYa7uIrU6O6MZCG_RR4S4fkg,3152
100
100
  RinUI/windows/FluentPage.qml,sha256=J7mXTOyMahdWA8U13rSjesJVsvxklZFQyqwVMiJarT8,2748
101
101
  RinUI/windows/FluentWindow.qml,sha256=CUx9H5crOKtPSCnA6_AUst4PcLEbhSjDRrSuWH8novA,969
102
- RinUI/windows/FluentWindowBase.qml,sha256=rUUHO1lIjIIvrHjKHwSIEn8WOG2kY45mJQQT_KrGZDM,4335
102
+ RinUI/windows/FluentWindowBase.qml,sha256=QV0WwRTL997c2Q8TNvsl8fNXLfkZabQvh0O0kT9NxhI,4308
103
103
  RinUI/windows/TitleBar.qml,sha256=QjnSb27Db2e8o2QniuJUMT0QI6awMbavVNex70Wsy2s,3591
104
104
  RinUI/windows/WindowManager.qml,sha256=f-Il6FCPf3_o6edj5BbscK2XxQd3mmUVnZPZuOO88kc,1037
105
105
  RinUI/windows/qmldir,sha256=oxyWR7Q8dWCrwwCwGNyf3l60qe6s4-beiZWWMAEkKcM,252
106
106
  RinUI/windows/window/ApplicationWindow.qml,sha256=qRaM8IY0TJxfq1j1DogTMyrPjyoXkuWVzxtZQLzRtOQ,167
107
107
  RinUI/windows/window/Window.qml,sha256=90YjjRoaul9qK4FxNy73zTaPuUmLvk_RjcPlBEa7DNI,3189
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,,
108
+ rinui-0.1.5.1.data/data/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
109
+ rinui-0.1.5.1.data/data/README.md,sha256=8ZcR55RYV2slRAQbhoYhqDTPOLXmewkFSvuA_cE6zD0,3044
110
+ rinui-0.1.5.1.dist-info/licenses/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
111
+ rinui-0.1.5.1.dist-info/METADATA,sha256=nQrnatWMZMHFBk427BhBBo5fadWyACzw2Z5b_JVNwPM,3577
112
+ rinui-0.1.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
+ rinui-0.1.5.1.dist-info/entry_points.txt,sha256=taxuZYCggoQa2LPubwcurQYRjBRC4cNYOjWaqOYZVxw,54
114
+ rinui-0.1.5.1.dist-info/top_level.txt,sha256=vKKjXBXEw5OFRIzTxZWUC5ZOj0CK5e3atbymBB4eJ6w,6
115
+ rinui-0.1.5.1.dist-info/RECORD,,
File without changes