Move the resizing call after the mainWindow.show(), to get the whole geometry
of the window (with the decoration added by Windows after the show()). The
problem with this design is that the added geometry is assymetric between the
top and the bottom, so just removing half of that does not result in a center
document.
Right now, I added a ad-hoc factor of 3./4, but there is probably a better way.
Forgot to merge that a while back!
Move the resizing call after the
mainWindow.show()
, to get the whole geometry of the window (with the decoration added by Windows after theshow()
). The problem with this design is that the added geometry is assymetric between the top and the bottom, so just removing half of that does not result in a center document.Right now, I added a ad-hoc factor of 3./4, but there is probably a better way.