RinUI 0.1.3.2__py3-none-any.whl → 0.1.4__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.3"
3
+ __version__ = "0.1.4"
4
4
  __author__ = "RinLit"
@@ -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
- Theme.currentTheme.colors.primaryColor
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
@@ -1,7 +1,7 @@
1
1
  import QtQuick 2.15
2
2
  import QtQuick.Controls 2.15
3
3
  import QtQuick.Controls.Basic 2.15 as QQC
4
- import Qt5Compat.GraphicalEffects 1.0
4
+ import Qt5Compat.GraphicalEffects
5
5
  import "../../themes"
6
6
  import "../../components"
7
7
 
RinUI/components/qmldir CHANGED
@@ -41,6 +41,7 @@ Expander 1.0 Layout/Expander.qml
41
41
  # Status & Info
42
42
  InfoBar 1.0 StatusAndInfo/InfoBar.qml
43
43
  ProgressBar 1.0 StatusAndInfo/ProgressBar.qml
44
+ ProgressRing 1.0 StatusAndInfo/ProgressRing.qml
44
45
  ToolTip 1.0 StatusAndInfo/ToolTip.qml
45
46
 
46
47
  # Text
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
- from .window import WinEventFilter, WinEventManager
5
+
6
+
7
+ if is_windows():
8
+ from .window import WinEventFilter, WinEventManager
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 .window import WinEventFilter, WinEventManager
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 = WinEventManager()
30
+ self.win_event_manager = None
32
31
  self.qml_path = qml_path
33
32
  self._initialized = True
34
33
 
@@ -78,15 +77,28 @@ 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
- self._print_startup_info()
89
-
90
102
  def setIcon(self, path: str) -> None:
91
103
  """
92
104
  Sets the icon for the application.
@@ -105,7 +117,7 @@ class RinUIWindow:
105
117
  Apply Windows effects to the window.
106
118
  :return:
107
119
  """
108
- if sys.platform == "win32":
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
@@ -54,8 +54,8 @@ Item {
54
54
  onPressed: {
55
55
  clickPos = Qt.point(mouseX, mouseY)
56
56
 
57
- if (!(Qt.platform.os !== "windows" || Qt.platform.os !== "winrt") && !Theme._isThemeMgrInitialized()) {
58
- return // 在win环境使用原生方法拖拽
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 ((Qt.platform.os !== "windows" || Qt.platform.os !== "winrt") && Theme._isThemeMgrInitialized()) {
68
+ if (Qt.platform.os !== "windows" && WindowManager._isWinMgrInitialized()) {
69
+ log("Windows only")
69
70
  return // 在win环境使用原生方法拖拽
70
71
  }
71
72
 
@@ -8,7 +8,7 @@ Item {
8
8
 
9
9
  function sendDragWindowEvent(window) {
10
10
  if (!_isWinMgrInitialized()) {
11
- console.error("ThemeManager is not defined.")
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.error("ThemeManager is not defined.")
20
- return -1
19
+ console.warn("WindowManager is not defined.")
21
20
  }
22
- if ((Qt.platform.os !== "windows" || Qt.platform.os !== "winrt") && _isWinMgrInitialized()) {
21
+ if (Qt.platform.os === "windows") {
23
22
  WinEventManager.maximizeWindow(WinEventManager.getWindowId(window))
24
23
  return // 在win环境使用原生方法拖拽
25
24
  }
26
25
 
27
- window.showMaximized()
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RinUI
3
- Version: 0.1.3.2
3
+ Version: 0.1.4
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,5 +1,5 @@
1
- RinUI/__init__.py,sha256=XFdGWitmk8854o9fDDbtjxkAyReNgMgl7S3Iue7ssYc,65
2
- RinUI/qmldir,sha256=fwUoGC3efxNnNJmFU6inBDH6Tx9s3-OI4b3-a-25o0U,3829
1
+ RinUI/__init__.py,sha256=yCaTH5sNCPm7JPelkdcDfFsUwhkV2QZDj1at9f_s29I,65
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=KiTLgqw5x2LehrUxVfaFZUkD0Al2n2dPjD30gA_6fWk,2255
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=GgV0rPLB1JCpwuSD2LOj7UX5JKVaCRkEsSC13kYObtY,3389
64
- RinUI/components/StatusAndInfo/ProgressRing.qml,sha256=-QJYPxCA427kMdHpcno0IUTsjPDKfcwQl7wWQEwoJ98,5092
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=bjBBPyYGLXPggeyz-7lN_KgsziFKAlyw0Y_m5S4_lUU,248
73
+ RinUI/core/__init__.py,sha256=xNbsFDXuObMebyn0Xsxieenh0fsAEjULqBd9qd8suTY,283
73
74
  RinUI/core/config.py,sha256=kO0bR1EhZB6Mh0KFa7uyBa0KgYr58DdBsHEP2oSGX7U,3722
74
- RinUI/core/launcher.py,sha256=kFHlhHPU6hf7F15DDUfZ9_hiacovJLOn-3xKWNj2CfI,5517
75
+ RinUI/core/launcher.py,sha256=791vsPwVv7zMRZYaCq-b9ihmYiNl4p859D6WqzCIUWs,5784
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=zzGfAo2p_SIFXarCuVG_zWhrraRBjIx9MS3cc_wV710,3645
103
- RinUI/windows/WindowManager.qml,sha256=5XFddF38KP-TWhMVesqzQElr3ySrBWVIVuuiBgqi3A4,857
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.3.2.data/data/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
108
- rinui-0.1.3.2.data/data/README.md,sha256=8ZcR55RYV2slRAQbhoYhqDTPOLXmewkFSvuA_cE6zD0,3044
109
- rinui-0.1.3.2.dist-info/licenses/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
110
- rinui-0.1.3.2.dist-info/METADATA,sha256=20k38TI3U59A4FsjqtkJ5IeyX9XQBn3jl33b1UgdPeM,3577
111
- rinui-0.1.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
- rinui-0.1.3.2.dist-info/entry_points.txt,sha256=taxuZYCggoQa2LPubwcurQYRjBRC4cNYOjWaqOYZVxw,54
113
- rinui-0.1.3.2.dist-info/top_level.txt,sha256=vKKjXBXEw5OFRIzTxZWUC5ZOj0CK5e3atbymBB4eJ6w,6
114
- rinui-0.1.3.2.dist-info/RECORD,,
108
+ rinui-0.1.4.data/data/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
109
+ rinui-0.1.4.data/data/README.md,sha256=8ZcR55RYV2slRAQbhoYhqDTPOLXmewkFSvuA_cE6zD0,3044
110
+ rinui-0.1.4.dist-info/licenses/LICENSE,sha256=vgoqqpny5vKYu34VDBUWYQKzT7Nn-Xy9y8USmcOCyZQ,1063
111
+ rinui-0.1.4.dist-info/METADATA,sha256=Cui_WmHiz5ssnR8k-cRkIdu2CgY59toLvzg5NGsSgSw,3575
112
+ rinui-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
+ rinui-0.1.4.dist-info/entry_points.txt,sha256=taxuZYCggoQa2LPubwcurQYRjBRC4cNYOjWaqOYZVxw,54
114
+ rinui-0.1.4.dist-info/top_level.txt,sha256=vKKjXBXEw5OFRIzTxZWUC5ZOj0CK5e3atbymBB4eJ6w,6
115
+ rinui-0.1.4.dist-info/RECORD,,
File without changes
File without changes
File without changes