Skip to content

Commit

Permalink
center when the application window is off-center
Browse files Browse the repository at this point in the history
  • Loading branch information
Allie Crevier committed Feb 24, 2020
1 parent 0386dda commit 640b3d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2291,9 +2291,11 @@ def center_dialog(self):
return
application_window_size = active_window.geometry()
dialog_size = self.geometry()
x = application_window_size.x()
y = application_window_size.y()
x_center = (application_window_size.width() - dialog_size.width()) / 2
y_center = (application_window_size.height() - dialog_size.height()) / 2
self.move(x_center, y_center)
self.move(x + x_center, y + y_center)


class PrintDialog(FramelessDialog):
Expand Down

0 comments on commit 640b3d9

Please sign in to comment.