mirror of
https://github.com/torproject/torbrowser-launcher.git
synced 2024-11-23 09:29:42 +00:00
Center the window
This commit is contained in:
parent
b8453e35e5
commit
7cc2611edc
@ -70,8 +70,9 @@ def main():
|
||||
common = Common(tor_browser_launcher_version)
|
||||
app = Application()
|
||||
|
||||
# Open the GUI
|
||||
# Open the window
|
||||
gui = None
|
||||
|
||||
if settings:
|
||||
# Settings mode
|
||||
gui = Settings(common, app)
|
||||
@ -79,6 +80,15 @@ def main():
|
||||
# Launcher mode
|
||||
gui = Launcher(common, app, url_list)
|
||||
|
||||
# Center the window
|
||||
desktop = app.desktop()
|
||||
window_size = gui.size()
|
||||
gui.move(
|
||||
(desktop.width() - window_size.width()) / 2,
|
||||
(desktop.height() - window_size.height()) / 2
|
||||
)
|
||||
gui.show()
|
||||
|
||||
# Allow ctrl-c to work
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
|
||||
|
@ -146,7 +146,6 @@ class Launcher(QtWidgets.QMainWindow):
|
||||
central_widget = QtWidgets.QWidget()
|
||||
central_widget.setLayout(layout)
|
||||
self.setCentralWidget(central_widget)
|
||||
self.show()
|
||||
|
||||
self.update()
|
||||
|
||||
|
@ -151,7 +151,6 @@ class Settings(QtWidgets.QMainWindow):
|
||||
central_widget = QtWidgets.QWidget()
|
||||
central_widget.setLayout(layout)
|
||||
self.setCentralWidget(central_widget)
|
||||
self.show()
|
||||
|
||||
# Install
|
||||
def install(self):
|
||||
|
Loading…
Reference in New Issue
Block a user