aboutsummaryrefslogtreecommitdiff
path: root/desktop/onionshare/tab_widget.py
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2022-03-28 17:13:59 +1100
committerMiguel Jacq <mig@mig5.net>2022-03-28 17:18:58 +1100
commit594c11cfebe655e944ca874a6ca4a21474e3c950 (patch)
treea1331f3ffc68dea6c4d32cac0e7dc092e047c576 /desktop/onionshare/tab_widget.py
parent52cb5cf71aef4ad05d2345757f8e2a66abc86753 (diff)
downloadonionshare-594c11cfebe655e944ca874a6ca4a21474e3c950.tar.gz
onionshare-594c11cfebe655e944ca874a6ca4a21474e3c950.zip
Add shortcuts for modes and new/close tab. Set accessible string for modes on mode chooser
Diffstat (limited to 'desktop/onionshare/tab_widget.py')
-rw-r--r--desktop/onionshare/tab_widget.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop/onionshare/tab_widget.py b/desktop/onionshare/tab_widget.py
index 3c1a1703..11e22878 100644
--- a/desktop/onionshare/tab_widget.py
+++ b/desktop/onionshare/tab_widget.py
@@ -55,6 +55,7 @@ class TabWidget(QtWidgets.QTabWidget):
# Define the new tab button
self.new_tab_button = QtWidgets.QPushButton("+", parent=self)
+ self.new_tab_button.setShortcut(QtCore.Qt.CTRL + QtCore.Qt.Key_T)
self.new_tab_button.setFlat(True)
self.new_tab_button.setFixedSize(40, 30)
self.new_tab_button.clicked.connect(self.new_tab_clicked)
@@ -195,6 +196,10 @@ class TabWidget(QtWidgets.QTabWidget):
index = self.addTab(tab, strings._("gui_new_tab"))
self.setCurrentIndex(index)
+ sequence = QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_X)
+ close_shortcut = QtWidgets.QShortcut(sequence, tab)
+ close_shortcut.activated.connect(lambda: self.close_tab(index))
+
tab.init(mode_settings)
# Make sure the title is set