diff options
-rwxr-xr-x | browser.py | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -77,15 +77,16 @@ class GBrowser(QtWidgets.QMainWindow): def __init__(self): QtWidgets.QMainWindow.__init__(self) - self.initUI() + self.init_ui() - def initUI(self): + def init_ui(self): self.statusBar().showMessage('Ready') back = QtWidgets.QPushButton("back") forward = QtWidgets.QPushButton("forward") address = GUrlBar() toolbar = QtWidgets.QToolBar() + toolbar.setObjectName('navigationToolbar') toolbar.addWidget(back) toolbar.addWidget(forward) toolbar.addWidget(address) @@ -102,10 +103,18 @@ class GBrowser(QtWidgets.QMainWindow): browser.setSource(QtCore.QUrl('gemini://gemini.circumlunar.space/')) - self.setGeometry(10, 10, 1024, 750) + settings = QtCore.QSettings("xcolour.net", "GeminiBrowser") + self.restoreGeometry(settings.value("geometry")) + self.restoreState(settings.value("windowState")) self.setWindowTitle('Gemini Browser') self.show() + def closeEvent(self, event): + settings = QtCore.QSettings("xcolour.net", "GeminiBrowser") + settings.setValue("geometry", self.saveGeometry()) + settings.setValue("windowState", self.saveState()) + super().closeEvent(event) + app = QtWidgets.QApplication(sys.argv) ex = GBrowser() sys.exit(app.exec_()) |