Browse Source

Qt: add Key_Enter wherever Key_Return is used

patch-4
ThomasV 4 years ago
parent
commit
b7c2820951
  1. 2
      electrum/gui/qt/main_window.py
  2. 2
      electrum/gui/qt/network_dialog.py
  3. 4
      electrum/gui/qt/util.py

2
electrum/gui/qt/main_window.py

@ -119,7 +119,7 @@ class StatusBarButton(QPushButton):
self.func()
def keyPressEvent(self, e):
if e.key() == Qt.Key_Return:
if e.key() in [ Qt.Key_Return, Qt.Key_Enter ]:
self.func()

2
electrum/gui/qt/network_dialog.py

@ -117,7 +117,7 @@ class NodesListWidget(QTreeWidget):
menu.exec_(self.viewport().mapToGlobal(position))
def keyPressEvent(self, event):
if event.key() in [ Qt.Key_F2, Qt.Key_Return ]:
if event.key() in [ Qt.Key_F2, Qt.Key_Return, Qt.Key_Enter ]:
self.on_activated(self.currentItem(), self.currentColumn())
else:
QTreeWidget.keyPressEvent(self, event)

4
electrum/gui/qt/util.py

@ -70,7 +70,7 @@ class EnterButton(QPushButton):
self.clicked.connect(func)
def keyPressEvent(self, e):
if e.key() == Qt.Key_Return:
if e.key() in [ Qt.Key_Return, Qt.Key_Enter ]:
self.func()
@ -581,7 +581,7 @@ class MyTreeView(QTreeView):
def keyPressEvent(self, event):
if self.itemDelegate().opened:
return
if event.key() in [ Qt.Key_F2, Qt.Key_Return ]:
if event.key() in [ Qt.Key_F2, Qt.Key_Return, Qt.Key_Enter ]:
self.on_activated(self.selectionModel().currentIndex())
return
super().keyPressEvent(event)

Loading…
Cancel
Save