mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
window geometry: check x, y values (#700)
* window geometry: check x, y values * window geometry: negative w, h are not allowed
This commit is contained in:
parent
194cea5acb
commit
c29c6f5927
@ -94,6 +94,8 @@ class saveposwindow(QMainWindow):
|
|||||||
d = QApplication.primaryScreen()
|
d = QApplication.primaryScreen()
|
||||||
self.dic, self.key = dic, key
|
self.dic, self.key = dic, key
|
||||||
if self.dic:
|
if self.dic:
|
||||||
|
dic[key][2] = max(0, min(dic[key][2], d.size().width()))
|
||||||
|
dic[key][3] = max(0, min(dic[key][3], d.size().height()))
|
||||||
dic[key][0] = min(max(dic[key][0], 0), d.size().width() - dic[key][2])
|
dic[key][0] = min(max(dic[key][0], 0), d.size().width() - dic[key][2])
|
||||||
dic[key][1] = min(max(dic[key][1], 0), d.size().height() - dic[key][3])
|
dic[key][1] = min(max(dic[key][1], 0), d.size().height() - dic[key][3])
|
||||||
self.setGeometry(*dic[key])
|
self.setGeometry(*dic[key])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user