PySide2-Frameless-Window 0.0.1__tar.gz → 0.0.3__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. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PKG-INFO +16 -12
  2. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/PKG-INFO +16 -12
  3. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/SOURCES.txt +2 -2
  4. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/README.md +15 -11
  5. PySide2-Frameless-Window-0.0.3/qframelesswindow/__init__.py +73 -0
  6. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/linux/__init__.py +2 -0
  7. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/mac/__init__.py +5 -3
  8. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/titlebar/__init__.py +11 -1
  9. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/titlebar/title_bar_buttons.py +1 -1
  10. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/windows/__init__.py +4 -0
  11. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/setup.py +1 -1
  12. PySide2-Frameless-Window-0.0.1/qframelesswindow/__init__.py +0 -33
  13. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/LICENSE +0 -0
  14. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/dependency_links.txt +0 -0
  15. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/requires.txt +0 -0
  16. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/top_level.txt +0 -0
  17. {PySide2-Frameless-Window-0.0.1/qframelesswindow/rc → PySide2-Frameless-Window-0.0.3/qframelesswindow/_rc}/__init__.py +0 -0
  18. {PySide2-Frameless-Window-0.0.1/qframelesswindow/rc → PySide2-Frameless-Window-0.0.3/qframelesswindow/_rc}/resource.py +0 -0
  19. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/linux/window_effect.py +0 -0
  20. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/mac/window_effect.py +0 -0
  21. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/__init__.py +0 -0
  22. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/linux_utils.py +0 -0
  23. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/mac_utils.py +0 -0
  24. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/win32_utils.py +0 -0
  25. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/windows/c_structures.py +0 -0
  26. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/windows/window_effect.py +0 -0
  27. {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySide2-Frameless-Window
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: A cross-platform frameless window based on pyside2, support Win32, Linux and macOS.
5
5
  Home-page: https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/Pyside2
6
6
  Author: zhiyiYo
@@ -14,10 +14,10 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
 
16
16
  <p align="center">
17
- <img width="15%" align="center" src="https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/logo.png" alt="logo">
17
+ <img width="15%" align="center" src="https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/logo.png" alt="logo">
18
18
  </p>
19
19
  <h1 align="center">
20
- PyQt-Frameless-Window
20
+ PySide2-Frameless-Window
21
21
  </h1>
22
22
  <p align="center">
23
23
  A cross-platform frameless window based on PySide2
@@ -37,14 +37,15 @@ License-File: LICENSE
37
37
  </a>
38
38
  </p>
39
39
 
40
- ![Cover](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/cover.jpg)
40
+ ![Cover](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/cover.jpg)
41
41
 
42
42
 
43
43
  ## Features
44
44
  * Move
45
45
  * Stretching
46
- * Window animation
47
46
  * Window shadow
47
+ * Window animation
48
+ * Win11 snap layout
48
49
  * Win10 acrylic blur
49
50
  * Win11 mica blur
50
51
  * Win7 Aero blur
@@ -92,37 +93,40 @@ if __name__ == '__main__':
92
93
  demo.show()
93
94
  sys.exit(app.exec_())
94
95
  ```
95
- For more complex requirements, you can refer to the [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py).
96
+ For more complex requirements, see [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py) and [main_window.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/main_window.py).
96
97
 
97
98
  ## Examples
98
99
  * Normal frameless window
99
- ![Normal Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/normal_frameless_window.gif)
100
+ ![Normal Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/normal_frameless_window.gif)
100
101
  * Acrylic frameless window
101
- ![Acrylic Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/acrylic_window.jpg)
102
+ ![Acrylic Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/acrylic_window.jpg)
102
103
 
103
104
 
105
+ ## Document
106
+ Want to know more about PySide2-Frameless-Window? Please read the [help document](https://pyqt-frameless-window.readthedocs.io/) 👈
104
107
 
105
108
  ## Notes
106
109
  1. `FramelessWindow` provides a default custom title bar. If you don't like it, just rewrite it as [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py) does.
107
110
 
108
111
  2. Moving the acrylic window on Win10 may get stuck. At present, there is no good solution. Maybe you can disable the acrylic effect when moving the window, but I haven't done this in the source code.
112
+ 3. Snap layout is not enabled by default. See [#56](https://github.com/zhiyiYo/PyQt-Frameless-Window/issues/56) to learn how to enable it.
109
113
 
110
- 3. If you encounter this problem on Windows:
114
+ 4. If you encounter this problem on Windows:
111
115
  > ImportError: DLL load failed while importing win32api
112
116
 
113
117
  see my answer on [stackoverflow](https://stackoverflow.com/questions/58612306/how-to-fix-importerror-dll-load-failed-while-importing-win32api/72488468#72488468) or my [blog](https://www.cnblogs.com/zhiyiYo/p/16340429.html) for the solution.
114
118
 
115
- 4. If you are using PyQt5, PyQt6 or PySide6, you can download the code in [PyQt5](https://github.com/zhiyiYo/PyQt-Frameless-Window) or [PyQt6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PyQt6) or [PySide6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PySide6) branch.
119
+ 5. If you are using PyQt5, PyQt6 or PySide6, you can download the code in [PyQt5](https://github.com/zhiyiYo/PyQt-Frameless-Window) or [PyQt6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PyQt6) or [PySide6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PySide6) branch.
116
120
 
117
121
  ## See Also
118
122
  Here are some projects that use PyQt-Frameless-Window:
119
123
  * [**zhiyiYo/Groove**: A cross-platform music player based on PyQt5](https://github.com/zhiyiYo/Groove)
120
124
  * [**zhiyiYo/Alpha-Gobang-Zero**: A gobang robot based on reinforcement learning](https://github.com/zhiyiYo/Alpha-Gobang-Zero)
121
- * [**tonquer/picacg-qt**: PicACG PC Client ](https://github.com/tonquer/picacg-qt)
125
+ * [**zhiyiYo/PyQt-Fluent-Widgets**: A fluent design widgets library based on PyQt5](https://github.com/zhiyiYo/PyQt-Fluent-Widgets)
122
126
 
123
127
  ## Reference
124
128
  * [**wangwenx190/framelesshelper**: Frameless windows for Qt Widgets and Qt Quick applications. Support Win32, X11, Wayland and macOS](https://github.com/wangwenx190/framelesshelper)
125
- * [**libxcb**: Basic Graphics Programming With The XCB Library](https://github.com/zhaiyuhan/HAODA)
129
+ * [**libxcb**: Basic Graphics Programming With The XCB Library](https://www.x.org/releases/X11R7.5/doc/libxcb/tutorial)
126
130
 
127
131
  ## License
128
132
  ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySide2-Frameless-Window
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: A cross-platform frameless window based on pyside2, support Win32, Linux and macOS.
5
5
  Home-page: https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/Pyside2
6
6
  Author: zhiyiYo
@@ -14,10 +14,10 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
 
16
16
  <p align="center">
17
- <img width="15%" align="center" src="https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/logo.png" alt="logo">
17
+ <img width="15%" align="center" src="https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/logo.png" alt="logo">
18
18
  </p>
19
19
  <h1 align="center">
20
- PyQt-Frameless-Window
20
+ PySide2-Frameless-Window
21
21
  </h1>
22
22
  <p align="center">
23
23
  A cross-platform frameless window based on PySide2
@@ -37,14 +37,15 @@ License-File: LICENSE
37
37
  </a>
38
38
  </p>
39
39
 
40
- ![Cover](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/cover.jpg)
40
+ ![Cover](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/cover.jpg)
41
41
 
42
42
 
43
43
  ## Features
44
44
  * Move
45
45
  * Stretching
46
- * Window animation
47
46
  * Window shadow
47
+ * Window animation
48
+ * Win11 snap layout
48
49
  * Win10 acrylic blur
49
50
  * Win11 mica blur
50
51
  * Win7 Aero blur
@@ -92,37 +93,40 @@ if __name__ == '__main__':
92
93
  demo.show()
93
94
  sys.exit(app.exec_())
94
95
  ```
95
- For more complex requirements, you can refer to the [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py).
96
+ For more complex requirements, see [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py) and [main_window.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/main_window.py).
96
97
 
97
98
  ## Examples
98
99
  * Normal frameless window
99
- ![Normal Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/normal_frameless_window.gif)
100
+ ![Normal Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/normal_frameless_window.gif)
100
101
  * Acrylic frameless window
101
- ![Acrylic Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/acrylic_window.jpg)
102
+ ![Acrylic Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/acrylic_window.jpg)
102
103
 
103
104
 
105
+ ## Document
106
+ Want to know more about PySide2-Frameless-Window? Please read the [help document](https://pyqt-frameless-window.readthedocs.io/) 👈
104
107
 
105
108
  ## Notes
106
109
  1. `FramelessWindow` provides a default custom title bar. If you don't like it, just rewrite it as [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py) does.
107
110
 
108
111
  2. Moving the acrylic window on Win10 may get stuck. At present, there is no good solution. Maybe you can disable the acrylic effect when moving the window, but I haven't done this in the source code.
112
+ 3. Snap layout is not enabled by default. See [#56](https://github.com/zhiyiYo/PyQt-Frameless-Window/issues/56) to learn how to enable it.
109
113
 
110
- 3. If you encounter this problem on Windows:
114
+ 4. If you encounter this problem on Windows:
111
115
  > ImportError: DLL load failed while importing win32api
112
116
 
113
117
  see my answer on [stackoverflow](https://stackoverflow.com/questions/58612306/how-to-fix-importerror-dll-load-failed-while-importing-win32api/72488468#72488468) or my [blog](https://www.cnblogs.com/zhiyiYo/p/16340429.html) for the solution.
114
118
 
115
- 4. If you are using PyQt5, PyQt6 or PySide6, you can download the code in [PyQt5](https://github.com/zhiyiYo/PyQt-Frameless-Window) or [PyQt6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PyQt6) or [PySide6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PySide6) branch.
119
+ 5. If you are using PyQt5, PyQt6 or PySide6, you can download the code in [PyQt5](https://github.com/zhiyiYo/PyQt-Frameless-Window) or [PyQt6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PyQt6) or [PySide6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PySide6) branch.
116
120
 
117
121
  ## See Also
118
122
  Here are some projects that use PyQt-Frameless-Window:
119
123
  * [**zhiyiYo/Groove**: A cross-platform music player based on PyQt5](https://github.com/zhiyiYo/Groove)
120
124
  * [**zhiyiYo/Alpha-Gobang-Zero**: A gobang robot based on reinforcement learning](https://github.com/zhiyiYo/Alpha-Gobang-Zero)
121
- * [**tonquer/picacg-qt**: PicACG PC Client ](https://github.com/tonquer/picacg-qt)
125
+ * [**zhiyiYo/PyQt-Fluent-Widgets**: A fluent design widgets library based on PyQt5](https://github.com/zhiyiYo/PyQt-Fluent-Widgets)
122
126
 
123
127
  ## Reference
124
128
  * [**wangwenx190/framelesshelper**: Frameless windows for Qt Widgets and Qt Quick applications. Support Win32, X11, Wayland and macOS](https://github.com/wangwenx190/framelesshelper)
125
- * [**libxcb**: Basic Graphics Programming With The XCB Library](https://github.com/zhaiyuhan/HAODA)
129
+ * [**libxcb**: Basic Graphics Programming With The XCB Library](https://www.x.org/releases/X11R7.5/doc/libxcb/tutorial)
126
130
 
127
131
  ## License
128
132
  ```
@@ -7,12 +7,12 @@ PySide2_Frameless_Window.egg-info/dependency_links.txt
7
7
  PySide2_Frameless_Window.egg-info/requires.txt
8
8
  PySide2_Frameless_Window.egg-info/top_level.txt
9
9
  qframelesswindow/__init__.py
10
+ qframelesswindow/_rc/__init__.py
11
+ qframelesswindow/_rc/resource.py
10
12
  qframelesswindow/linux/__init__.py
11
13
  qframelesswindow/linux/window_effect.py
12
14
  qframelesswindow/mac/__init__.py
13
15
  qframelesswindow/mac/window_effect.py
14
- qframelesswindow/rc/__init__.py
15
- qframelesswindow/rc/resource.py
16
16
  qframelesswindow/titlebar/__init__.py
17
17
  qframelesswindow/titlebar/title_bar_buttons.py
18
18
  qframelesswindow/utils/__init__.py
@@ -1,8 +1,8 @@
1
1
  <p align="center">
2
- <img width="15%" align="center" src="https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/logo.png" alt="logo">
2
+ <img width="15%" align="center" src="https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/logo.png" alt="logo">
3
3
  </p>
4
4
  <h1 align="center">
5
- PyQt-Frameless-Window
5
+ PySide2-Frameless-Window
6
6
  </h1>
7
7
  <p align="center">
8
8
  A cross-platform frameless window based on PySide2
@@ -22,14 +22,15 @@
22
22
  </a>
23
23
  </p>
24
24
 
25
- ![Cover](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/cover.jpg)
25
+ ![Cover](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/cover.jpg)
26
26
 
27
27
 
28
28
  ## Features
29
29
  * Move
30
30
  * Stretching
31
- * Window animation
32
31
  * Window shadow
32
+ * Window animation
33
+ * Win11 snap layout
33
34
  * Win10 acrylic blur
34
35
  * Win11 mica blur
35
36
  * Win7 Aero blur
@@ -77,37 +78,40 @@ if __name__ == '__main__':
77
78
  demo.show()
78
79
  sys.exit(app.exec_())
79
80
  ```
80
- For more complex requirements, you can refer to the [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py).
81
+ For more complex requirements, see [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py) and [main_window.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/main_window.py).
81
82
 
82
83
  ## Examples
83
84
  * Normal frameless window
84
- ![Normal Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/normal_frameless_window.gif)
85
+ ![Normal Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/normal_frameless_window.gif)
85
86
  * Acrylic frameless window
86
- ![Acrylic Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/Pyside2/screenshot/acrylic_window.jpg)
87
+ ![Acrylic Frameless Window](https://raw.githubusercontent.com/zhiyiYo/PyQt-Frameless-Window/PyQt6/screenshot/acrylic_window.jpg)
87
88
 
88
89
 
90
+ ## Document
91
+ Want to know more about PySide2-Frameless-Window? Please read the [help document](https://pyqt-frameless-window.readthedocs.io/) 👈
89
92
 
90
93
  ## Notes
91
94
  1. `FramelessWindow` provides a default custom title bar. If you don't like it, just rewrite it as [demo.py](https://github.com/zhiyiYo/PyQt-Frameless-Window/blob/Pyside2/examples/demo.py) does.
92
95
 
93
96
  2. Moving the acrylic window on Win10 may get stuck. At present, there is no good solution. Maybe you can disable the acrylic effect when moving the window, but I haven't done this in the source code.
97
+ 3. Snap layout is not enabled by default. See [#56](https://github.com/zhiyiYo/PyQt-Frameless-Window/issues/56) to learn how to enable it.
94
98
 
95
- 3. If you encounter this problem on Windows:
99
+ 4. If you encounter this problem on Windows:
96
100
  > ImportError: DLL load failed while importing win32api
97
101
 
98
102
  see my answer on [stackoverflow](https://stackoverflow.com/questions/58612306/how-to-fix-importerror-dll-load-failed-while-importing-win32api/72488468#72488468) or my [blog](https://www.cnblogs.com/zhiyiYo/p/16340429.html) for the solution.
99
103
 
100
- 4. If you are using PyQt5, PyQt6 or PySide6, you can download the code in [PyQt5](https://github.com/zhiyiYo/PyQt-Frameless-Window) or [PyQt6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PyQt6) or [PySide6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PySide6) branch.
104
+ 5. If you are using PyQt5, PyQt6 or PySide6, you can download the code in [PyQt5](https://github.com/zhiyiYo/PyQt-Frameless-Window) or [PyQt6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PyQt6) or [PySide6](https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/PySide6) branch.
101
105
 
102
106
  ## See Also
103
107
  Here are some projects that use PyQt-Frameless-Window:
104
108
  * [**zhiyiYo/Groove**: A cross-platform music player based on PyQt5](https://github.com/zhiyiYo/Groove)
105
109
  * [**zhiyiYo/Alpha-Gobang-Zero**: A gobang robot based on reinforcement learning](https://github.com/zhiyiYo/Alpha-Gobang-Zero)
106
- * [**tonquer/picacg-qt**: PicACG PC Client ](https://github.com/tonquer/picacg-qt)
110
+ * [**zhiyiYo/PyQt-Fluent-Widgets**: A fluent design widgets library based on PyQt5](https://github.com/zhiyiYo/PyQt-Fluent-Widgets)
107
111
 
108
112
  ## Reference
109
113
  * [**wangwenx190/framelesshelper**: Frameless windows for Qt Widgets and Qt Quick applications. Support Win32, X11, Wayland and macOS](https://github.com/wangwenx190/framelesshelper)
110
- * [**libxcb**: Basic Graphics Programming With The XCB Library](https://github.com/zhaiyuhan/HAODA)
114
+ * [**libxcb**: Basic Graphics Programming With The XCB Library](https://www.x.org/releases/X11R7.5/doc/libxcb/tutorial)
111
115
 
112
116
  ## License
113
117
  ```
@@ -0,0 +1,73 @@
1
+ """
2
+ PySide2-Frameless-Window
3
+ ========================
4
+ A cross-platform frameless window based on pyside2, support Win32, Linux and macOS.
5
+
6
+ Documentation is available in the docstrings and
7
+ online at https://pyqt-frameless-window.readthedocs.io.
8
+
9
+ Examples are available at https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/Pyside2/examples.
10
+
11
+ :copyright: (c) 2021 by zhiyiYo.
12
+ :license: MIT, see LICENSE for more details.
13
+ """
14
+
15
+ __version__ = "0.0.3"
16
+
17
+ import sys
18
+
19
+ from PySide2.QtWidgets import QDialog, QMainWindow
20
+
21
+ from .titlebar import TitleBar, TitleBarButton, SvgTitleBarButton, StandardTitleBar
22
+
23
+ if sys.platform == "win32":
24
+ from .windows import AcrylicWindow as AcrylicWindowBase
25
+ from .windows import WindowsFramelessWindow as FramelessWindowBase
26
+ from .windows import WindowsWindowEffect as WindowEffect
27
+ elif sys.platform == "darwin":
28
+ from .mac import AcrylicWindow as AcrylicWindowBase
29
+ from .mac import MacFramelessWindow as FramelessWindowBase
30
+ from .mac import MacWindowEffect as WindowEffect
31
+ else:
32
+ from .linux import LinuxFramelessWindow as FramelessWindowBase
33
+ from .linux import LinuxWindowEffect as WindowEffect
34
+
35
+ AcrylicWindowBase = FramelessWindowBase
36
+
37
+
38
+ class FramelessWindow(FramelessWindowBase):
39
+ """ Frameless window """
40
+
41
+ def __init__(self, parent=None):
42
+ super().__init__(parent=parent)
43
+ self._initFrameless()
44
+
45
+
46
+ class FramelessDialog(QDialog, FramelessWindowBase):
47
+ """ Frameless dialog """
48
+
49
+ def __init__(self, parent=None):
50
+ super().__init__(parent=parent)
51
+ self._initFrameless()
52
+ self.titleBar.minBtn.hide()
53
+ self.titleBar.maxBtn.hide()
54
+ self.titleBar.setDoubleClickEnabled(False)
55
+
56
+ def resizeEvent(self, e):
57
+ self.titleBar.resize(self.width(), self.titleBar.height())
58
+
59
+
60
+ class FramelessMainWindow(QMainWindow, FramelessWindowBase):
61
+ """ Frameless main window """
62
+
63
+ def __init__(self, parent=None):
64
+ super().__init__(parent=parent)
65
+ self._initFrameless()
66
+
67
+
68
+ class AcrylicWindow(AcrylicWindowBase):
69
+ """ Acrylic window """
70
+
71
+ def __init__(self, parent=None):
72
+ super().__init__(parent=parent)
73
+ self._initFrameless()
@@ -14,6 +14,8 @@ class LinuxFramelessWindow(QWidget):
14
14
 
15
15
  def __init__(self, parent=None):
16
16
  super().__init__(parent=parent)
17
+
18
+ def _initFrameless(self):
17
19
  self.windowEffect = LinuxWindowEffect(self)
18
20
  self.titleBar = TitleBar(self)
19
21
  self._isResizeEnabled = True
@@ -13,6 +13,8 @@ class MacFramelessWindow(QWidget):
13
13
 
14
14
  def __init__(self, parent=None):
15
15
  super().__init__(parent=parent)
16
+
17
+ def _initFrameless(self):
16
18
  self.windowEffect = MacWindowEffect(self)
17
19
  # must enable acrylic effect before creating title bar
18
20
  if isinstance(self, AcrylicWindow):
@@ -53,7 +55,7 @@ class MacFramelessWindow(QWidget):
53
55
 
54
56
  def paintEvent(self, e):
55
57
  super().paintEvent(e)
56
- self.__nsWindow.setTitlebarAppearsTransparent_(True)
58
+ self.__hideSystemTitleBar()
57
59
 
58
60
  def changeEvent(self, event):
59
61
  super().changeEvent(event)
@@ -81,8 +83,8 @@ class MacFramelessWindow(QWidget):
81
83
  class AcrylicWindow(MacFramelessWindow):
82
84
  """ A frameless window with acrylic effect """
83
85
 
84
- def __init__(self, parent=None):
85
- super().__init__(parent)
86
+ def _initFrameless(self):
87
+ super()._initFrameless()
86
88
  self.setAttribute(Qt.WA_TranslucentBackground)
87
89
  self.windowEffect.setAcrylicEffect(self.winId())
88
90
  self.setStyleSheet("background: transparent")
@@ -19,6 +19,7 @@ class TitleBar(QWidget):
19
19
  self.closeBtn = CloseButton(parent=self)
20
20
  self.maxBtn = MaximizeButton(parent=self)
21
21
  self.hBoxLayout = QHBoxLayout(self)
22
+ self._isDoubleClickEnabled = True
22
23
 
23
24
  self.resize(200, 32)
24
25
  self.setFixedHeight(32)
@@ -49,7 +50,7 @@ class TitleBar(QWidget):
49
50
 
50
51
  def mouseDoubleClickEvent(self, event):
51
52
  """ Toggles the maximization state of the window """
52
- if event.button() != Qt.LeftButton:
53
+ if event.button() != Qt.LeftButton or not self._isDoubleClickEnabled:
53
54
  return
54
55
 
55
56
  self.__toggleMaxState()
@@ -90,6 +91,15 @@ class TitleBar(QWidget):
90
91
  """ whether the position is draggable """
91
92
  return self._isDragRegion(pos) and not self._hasButtonPressed()
92
93
 
94
+ def setDoubleClickEnabled(self, isEnabled):
95
+ """ whether to switch window maximization status when double clicked
96
+ Parameters
97
+ ----------
98
+ isEnabled: bool
99
+ whether to enable double click
100
+ """
101
+ self._isDoubleClickEnabled = isEnabled
102
+
93
103
 
94
104
  class StandardTitleBar(TitleBar):
95
105
  """ Title bar with icon and title """
@@ -7,7 +7,7 @@ from PySide2.QtWidgets import QAbstractButton
7
7
  from PySide2.QtSvg import QSvgRenderer
8
8
  from PySide2.QtXml import QDomDocument
9
9
 
10
- from ..rc import resource
10
+ from .._rc import resource
11
11
 
12
12
 
13
13
  class TitleBarButtonState(Enum):
@@ -24,6 +24,8 @@ class WindowsFramelessWindow(QWidget):
24
24
 
25
25
  def __init__(self, parent=None):
26
26
  super().__init__(parent=parent)
27
+
28
+ def _initFrameless(self):
27
29
  self.windowEffect = WindowsWindowEffect(self)
28
30
  self.titleBar = TitleBar(self)
29
31
  self._isResizeEnabled = True
@@ -145,6 +147,8 @@ class AcrylicWindow(WindowsFramelessWindow):
145
147
  super().__init__(parent=parent)
146
148
  self.__closedByKey = False
147
149
 
150
+ def _initFrameless(self):
151
+ super()._initFrameless()
148
152
  QtWin.enableBlurBehindWindow(self)
149
153
  self.setWindowFlags(Qt.FramelessWindowHint |
150
154
  Qt.WindowMinMaxButtonsHint)
@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
6
6
 
7
7
  setuptools.setup(
8
8
  name="PySide2-Frameless-Window",
9
- version="0.0.1",
9
+ version="0.0.3",
10
10
  keywords="pyside2 frameless",
11
11
  author="zhiyiYo",
12
12
  author_email="shokokawaii@outlook.com",
@@ -1,33 +0,0 @@
1
- """
2
- PySide2-Frameless-Window
3
- ========================
4
- A cross-platform frameless window based on pyside2, support Win32, Linux and macOS.
5
-
6
- Documentation is available in the docstrings and
7
- online at https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/Pyside2.
8
-
9
- Examples are available at https://github.com/zhiyiYo/PyQt-Frameless-Window/tree/Pyside2/examples.
10
-
11
- :copyright: (c) 2021 by zhiyiYo.
12
- :license: MIT, see LICENSE for more details.
13
- """
14
-
15
- __version__ = "0.0.1"
16
-
17
- import sys
18
-
19
- from .titlebar import TitleBar, TitleBarButton, SvgTitleBarButton, StandardTitleBar
20
-
21
- if sys.platform == "win32":
22
- from .windows import AcrylicWindow
23
- from .windows import WindowsFramelessWindow as FramelessWindow
24
- from .windows import WindowsWindowEffect as WindowEffect
25
- elif sys.platform == "darwin":
26
- from .mac import AcrylicWindow
27
- from .mac import MacFramelessWindow as FramelessWindow
28
- from .mac import MacWindowEffect as WindowEffect
29
- else:
30
- from .linux import LinuxFramelessWindow as FramelessWindow
31
- from .linux import LinuxWindowEffect as WindowEffect
32
-
33
- AcrylicWindow = FramelessWindow