PyQt5-Frameless-Window 0.7.4__tar.gz → 0.8.0__tar.gz

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.
Files changed (27) hide show
  1. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/PKG-INFO +1 -1
  2. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/PyQt5_Frameless_Window.egg-info/PKG-INFO +1 -1
  3. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/__init__.py +1 -1
  4. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/linux/__init__.py +4 -0
  5. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/linux/window_effect.py +20 -1
  6. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/mac/__init__.py +4 -0
  7. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/mac/window_effect.py +20 -1
  8. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/windows/__init__.py +15 -1
  9. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/windows/window_effect.py +24 -0
  10. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/setup.py +1 -1
  11. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/LICENSE +0 -0
  12. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/PyQt5_Frameless_Window.egg-info/SOURCES.txt +0 -0
  13. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/PyQt5_Frameless_Window.egg-info/dependency_links.txt +0 -0
  14. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/PyQt5_Frameless_Window.egg-info/requires.txt +0 -0
  15. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/PyQt5_Frameless_Window.egg-info/top_level.txt +0 -0
  16. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/README.md +0 -0
  17. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/_rc/__init__.py +0 -0
  18. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/_rc/resource.py +0 -0
  19. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/titlebar/__init__.py +0 -0
  20. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/titlebar/title_bar_buttons.py +0 -0
  21. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/utils/__init__.py +0 -0
  22. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/utils/linux_utils.py +0 -0
  23. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/utils/mac_utils.py +0 -0
  24. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/utils/win32_utils.py +0 -0
  25. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/webengine/__init__.py +0 -0
  26. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/qframelesswindow/windows/c_structures.py +0 -0
  27. {pyqt5_frameless_window-0.7.4 → pyqt5_frameless_window-0.8.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyQt5-Frameless-Window
3
- Version: 0.7.4
3
+ Version: 0.8.0
4
4
  Summary: A cross-platform frameless window based on pyqt5, support Win32, X11, Wayland and macOS.
5
5
  Home-page: https://github.com/zhiyiYo/PyQt-Frameless-Window
6
6
  Author: zhiyiYo
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyQt5-Frameless-Window
3
- Version: 0.7.4
3
+ Version: 0.8.0
4
4
  Summary: A cross-platform frameless window based on pyqt5, support Win32, X11, Wayland and macOS.
5
5
  Home-page: https://github.com/zhiyiYo/PyQt-Frameless-Window
6
6
  Author: zhiyiYo
@@ -12,7 +12,7 @@ Examples are available at https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/
12
12
  :license: GPLv3, see LICENSE for more details.
13
13
  """
14
14
 
15
- __version__ = "0.7.4"
15
+ __version__ = "0.8.0"
16
16
  __author__ = "zhiyiYo"
17
17
 
18
18
  import sys
@@ -33,6 +33,10 @@ class LinuxFramelessWindow(QWidget):
33
33
  def updateFrameless(self):
34
34
  self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
35
35
 
36
+ def refreshBackgroundBlurEffect(self):
37
+ """ Refresh background blur effect """
38
+ pass
39
+
36
40
  def setStayOnTop(self, isTop: bool):
37
41
  """ set the stay on top status """
38
42
  if isTop:
@@ -159,8 +159,27 @@ class LinuxWindowEffect:
159
159
 
160
160
  def enableBlurBehindWindow(self, hWnd):
161
161
  """ enable the blur effect behind the whole client
162
+
163
+ Parameters
164
+ ----------
165
+ hWnd: int or `sip.voidptr`
166
+ Window handle
167
+ """
168
+
169
+ def removeWindowAnimation(self, hWnd):
170
+ """ Disables maximize and minimize animation of the window by removing the relevant window styles.
171
+
162
172
  Parameters
163
173
  ----------
164
174
  hWnd: int or `sip.voidptr`
165
175
  Window handle
166
- """
176
+ """
177
+
178
+ def disableBlurBehindWindow(self, hWnd):
179
+ """ disable the blur effect behind the whole client
180
+
181
+ Parameters
182
+ ----------
183
+ hWnd: int or `sip.voidptr`
184
+ Window handle
185
+ """
@@ -167,6 +167,10 @@ class MacFramelessWindow(QWidget):
167
167
  """
168
168
  return QRect(0, 0, 75, size.height())
169
169
 
170
+ def refreshBackgroundBlurEffect(self):
171
+ """ Refresh background blur effect """
172
+ pass
173
+
170
174
 
171
175
  class AcrylicWindow(MacFramelessWindow):
172
176
  """ A frameless window with acrylic effect """
@@ -179,8 +179,27 @@ class MacWindowEffect:
179
179
 
180
180
  def enableBlurBehindWindow(self, hWnd):
181
181
  """ enable the blur effect behind the whole client
182
+
183
+ Parameters
184
+ ----------
185
+ hWnd: int or `sip.voidptr`
186
+ Window handle
187
+ """
188
+
189
+ def removeWindowAnimation(self, hWnd):
190
+ """ Disables maximize and minimize animation of the window by removing the relevant window styles.
191
+
182
192
  Parameters
183
193
  ----------
184
194
  hWnd: int or `sip.voidptr`
185
195
  Window handle
186
- """
196
+ """
197
+
198
+ def disableBlurBehindWindow(self, hWnd):
199
+ """ disable the blur effect behind the whole client
200
+
201
+ Parameters
202
+ ----------
203
+ hWnd: int or `sip.voidptr`
204
+ Window handle
205
+ """
@@ -6,7 +6,7 @@ from ctypes.wintypes import LPRECT, MSG
6
6
  import win32api
7
7
  import win32con
8
8
  import win32gui
9
- from PyQt5.QtCore import Qt, QSize, QRect
9
+ from PyQt5.QtCore import Qt, QSize, QRect, QEvent
10
10
  from PyQt5.QtGui import QCloseEvent, QCursor
11
11
  from PyQt5.QtWidgets import QApplication, QWidget
12
12
 
@@ -53,6 +53,13 @@ class WindowsFramelessWindow(QWidget):
53
53
  if not isinstance(self, AcrylicWindow):
54
54
  self.windowEffect.addShadowEffect(self.winId())
55
55
 
56
+ def refreshBackgroundBlurEffect(self):
57
+ """ Refresh background blur effect """
58
+ self.windowEffect.disableBlurBehindWindow(self.winId())
59
+ self.windowEffect.removeWindowAnimation(self.winId())
60
+ self.windowEffect.enableBlurBehindWindow(self.winId())
61
+ self.windowEffect.addWindowAnimation(self.winId())
62
+
56
63
  def setTitleBar(self, titleBar):
57
64
  """ set custom title bar
58
65
 
@@ -235,6 +242,13 @@ class AcrylicWindow(WindowsFramelessWindow):
235
242
 
236
243
  return super().nativeEvent(eventType, message)
237
244
 
245
+ def event(self, e: QEvent):
246
+ if e.type() == QEvent.Type.WindowStateChange:
247
+ if win_utils.isMaximized(self.winId()):
248
+ self.refreshBackgroundBlurEffect()
249
+
250
+ return super().event(e)
251
+
238
252
  def closeEvent(self, e):
239
253
  if not self.__closedByKey or QApplication.quitOnLastWindowClosed():
240
254
  self.__closedByKey = False
@@ -298,3 +298,27 @@ class WindowsWindowEffect:
298
298
  """
299
299
  blurBehind = DWM_BLURBEHIND(1, True, 0, False)
300
300
  self.DwmEnableBlurBehindWindow(int(hWnd), byref(blurBehind))
301
+
302
+ def removeWindowAnimation(self, hWnd):
303
+ """ Disables maximize and minimize animation of the window by removing the relevant window styles. """
304
+ hWnd = int(hWnd)
305
+ style = win32gui.GetWindowLong(hWnd, win32con.GWL_STYLE)
306
+ style &= ~win32con.WS_MINIMIZEBOX
307
+ style &= ~win32con.WS_MAXIMIZEBOX
308
+ style &= ~win32con.WS_CAPTION
309
+ style &= ~win32con.WS_THICKFRAME
310
+ win32gui.SetWindowLong(hWnd, win32con.GWL_STYLE, style)
311
+ win32gui.SetWindowPos(hWnd, None, 0, 0, 0, 0,
312
+ win32con.SWP_NOMOVE | win32con.SWP_NOSIZE | win32con.SWP_NOZORDER |
313
+ win32con.SWP_FRAMECHANGED)
314
+
315
+ def disableBlurBehindWindow(self, hWnd):
316
+ """ disable the blur effect behind the whole client
317
+
318
+ Parameters
319
+ ----------
320
+ hWnd: int or `sip.voidptr`
321
+ Window handle
322
+ """
323
+ blurBehind = DWM_BLURBEHIND(1, False, 0, False)
324
+ self.DwmEnableBlurBehindWindow(int(hWnd), byref(blurBehind))
@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
6
6
 
7
7
  setuptools.setup(
8
8
  name="PyQt5-Frameless-Window",
9
- version="0.7.4",
9
+ version="0.8.0",
10
10
  keywords="pyqt frameless",
11
11
  author="zhiyiYo",
12
12
  author_email="shokokawaii@outlook.com",