diff options
-rw-r--r-- | TODO.md | 15 | ||||
-rwxr-xr-x | browser.py | 11 |
2 files changed, 19 insertions, 7 deletions
@@ -1,13 +1,14 @@ - [x] open non-gemini links externally and display differently - [ ] keyboard navigation - - vim-style - - scroll - - highlight and follow links - - forward and back - - url bar - - [ ] search in page - - [ ] work with search pages + - [x] scroll + - [ ] highlight and follow links + - [x] forward and back + - [ ] url bar + - [ ] search in page - [x] stdlib url parsing in gemini module - [x] nice typography - [x] html templates - [ ] deal with non utf8 charsets + - [ ] handle all response codes + - [ ] errors (4x, 5x) + - [ ] search @@ -87,6 +87,17 @@ class GBrowser(QtWidgets.QMainWindow): self.setWindowTitle('Gemini Browser') self.show() + # Shortcuts + down_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_J), self) + down_event = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Down, QtCore.Qt.NoModifier) + down_shortcut.activated.connect(lambda: QtWidgets.QApplication.sendEvent(self._browser.focusProxy(), down_event)) + up_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_K), self) + up_event = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Up, QtCore.Qt.NoModifier) + up_shortcut.activated.connect(lambda: QtWidgets.QApplication.sendEvent(self._browser.focusProxy(), up_event)) + back_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_H), self, self._browser.back) + forward_shortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_L), self, self._browser.forward) + reload_shortcut = QtGui.QShortcut(QtGui.QKeySequence("Shift+R"), self, self._browser.reload) + def set_status_url(self, url): if url: self.statusBar().showMessage(url) |