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.
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PKG-INFO +16 -12
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/PKG-INFO +16 -12
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/SOURCES.txt +2 -2
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/README.md +15 -11
- PySide2-Frameless-Window-0.0.3/qframelesswindow/__init__.py +73 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/linux/__init__.py +2 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/mac/__init__.py +5 -3
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/titlebar/__init__.py +11 -1
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/titlebar/title_bar_buttons.py +1 -1
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/windows/__init__.py +4 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/setup.py +1 -1
- PySide2-Frameless-Window-0.0.1/qframelesswindow/__init__.py +0 -33
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/LICENSE +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/dependency_links.txt +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/requires.txt +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/PySide2_Frameless_Window.egg-info/top_level.txt +0 -0
- {PySide2-Frameless-Window-0.0.1/qframelesswindow/rc → PySide2-Frameless-Window-0.0.3/qframelesswindow/_rc}/__init__.py +0 -0
- {PySide2-Frameless-Window-0.0.1/qframelesswindow/rc → PySide2-Frameless-Window-0.0.3/qframelesswindow/_rc}/resource.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/linux/window_effect.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/mac/window_effect.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/__init__.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/linux_utils.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/mac_utils.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/win32_utils.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/windows/c_structures.py +0 -0
- {PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/windows/window_effect.py +0 -0
- {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.
|
|
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/
|
|
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
|
-
|
|
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
|
-

|
|
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,
|
|
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
|
-

|
|
100
101
|
* Acrylic frameless window
|
|
101
|
-

|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
* [**
|
|
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://
|
|
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.
|
|
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/
|
|
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
|
-
|
|
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
|
-

|
|
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,
|
|
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
|
-

|
|
100
101
|
* Acrylic frameless window
|
|
101
|
-

|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
* [**
|
|
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://
|
|
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/
|
|
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
|
-
|
|
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
|
-

|
|
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,
|
|
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
|
-

|
|
85
86
|
* Acrylic frameless window
|
|
86
|
-

|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
* [**
|
|
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://
|
|
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()
|
{PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/mac/__init__.py
RENAMED
|
@@ -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.
|
|
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
|
|
85
|
-
super().
|
|
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 """
|
|
@@ -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)
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{PySide2-Frameless-Window-0.0.1 → PySide2-Frameless-Window-0.0.3}/qframelesswindow/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|