Skip to content

Commit

Permalink
Fixes #145 - WSL2 window center
Browse files Browse the repository at this point in the history
  • Loading branch information
razman786 committed Jul 14, 2022
1 parent 4576c4c commit 55ca81a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TigGUI/Images/Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
QWidget)
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDockWidget, QLabel, QPlainTextEdit
from PyQt5.QtWidgets import QDockWidget, QLabel, QPlainTextEdit, QStyle

from TigGUI.Images import FITS_ExtensionList
from TigGUI.Images import SkyImage
Expand Down Expand Up @@ -202,6 +202,8 @@ def loadImage(self, filename=None, duplicate=True, to_top=True, model=None):
QApplication.flush()
try:
image = SkyImage.FITSImagePlotItem(str(filename))
centre = QStyle.alignedRect(Qt.LeftToRight, Qt.AlignHCenter, self.mainwin.size(), QApplication.desktop().availableGeometry())
self.mainwin.setGeometry(centre)
except KeyboardInterrupt:
raise
except Exception:
Expand Down

0 comments on commit 55ca81a

Please sign in to comment.