mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 08:54:14 +02:00
centralizing gem selector panel
This commit is contained in:
9
bauh/view/qt/qt_utils.py
Normal file
9
bauh/view/qt/qt_utils.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from PyQt5.QtWidgets import QWidget, QApplication
|
||||
|
||||
|
||||
def centralize(widget: QWidget):
|
||||
geo = widget.frameGeometry()
|
||||
screen = QApplication.desktop().screenNumber(QApplication.desktop().cursor().pos())
|
||||
center_point = QApplication.desktop().screenGeometry(screen).center()
|
||||
geo.moveCenter(center_point)
|
||||
widget.move(geo.topLeft())
|
||||
Reference in New Issue
Block a user