-
Notifications
You must be signed in to change notification settings - Fork 0
/
windowstuff.py
39 lines (29 loc) · 1.3 KB
/
windowstuff.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import globalstuff
from PyQt5.QtCore import QPoint, QRect
def Half(isright=False):
win = globalstuff.mainWindow.mdi.currentSubWindow()
if win:
pos = QPoint(globalstuff.mainWindow.mdi.width() // 2 if isright else 0, 0)
rect = QRect(0, 0, globalstuff.mainWindow.mdi.width() // 2, globalstuff.mainWindow.mdi.height())
win.setGeometry(rect)
win.move(pos)
def TileHorizontal():
pos = QPoint(0, 0)
for window in globalstuff.mainWindow.mdi.subWindowList():
rect = QRect(0, 0, globalstuff.mainWindow.mdi.width() // len(globalstuff.mainWindow.mdi.subWindowList()), globalstuff.mainWindow.mdi.height())
window.setGeometry(rect)
window.move(pos)
pos.setX(pos.x() + window.width())
def TileVertical():
pos = QPoint(0, 0)
for window in globalstuff.mainWindow.mdi.subWindowList():
rect = QRect(0, 0, globalstuff.mainWindow.mdi.width(), globalstuff.mainWindow.mdi.height() // len(globalstuff.mainWindow.mdi.subWindowList()))
window.setGeometry(rect)
window.move(pos)
pos.setY(pos.y() + window.height())
def MinimizeAll():
for window in globalstuff.mainWindow.mdi.subWindowList():
window.showMinimized()
def CloseAll():
for window in globalstuff.mainWindow.mdi.subWindowList():
window.close()