summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbrowser.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/browser.py b/browser.py
index c9bdc55..58b650c 100755
--- a/browser.py
+++ b/browser.py
@@ -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_())