mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
calculate window geometry does not retun tray position but middle of parent screen or active screen
This commit is contained in:
parent
ae3496ceea
commit
a0726d8bcc
1 changed files with 20 additions and 0 deletions
|
|
@ -124,6 +124,26 @@ class Popup2(Popup):
|
|||
fix = self.widgets["show"]
|
||||
fix.setText("Fix")
|
||||
|
||||
def calculate_window_geometry(self):
|
||||
"""Respond to status changes
|
||||
|
||||
On creation, align window with screen bottom right.
|
||||
|
||||
"""
|
||||
parent_widget = self.parent()
|
||||
|
||||
app = QtWidgets.QApplication.instance()
|
||||
if parent_widget:
|
||||
screen = app.desktop().screenNumber(parent_widget)
|
||||
else:
|
||||
screen = app.desktop().screenNumber(app.desktop().cursor().pos())
|
||||
center_point = app.desktop().screenGeometry(screen).center()
|
||||
|
||||
frame_geo = self.frameGeometry()
|
||||
frame_geo.moveCenter(center_point)
|
||||
|
||||
return frame_geo
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def application():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue