Merge pull request #451 from kocho1984/close_tab_on_middle_button

Closing tab on middle mouse button press
This commit is contained in:
Matt Rose 2021-06-24 10:40:19 -04:00 committed by GitHub
commit 24f1503234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -568,6 +568,8 @@ class TabLabel(Gtk.HBox):
self.terminator = Terminator()
self.config = Config()
self.connect("button-press-event", self.on_button_pressed)
self.label = EditableLabel(title)
self.update_angle()
@ -650,4 +652,8 @@ class TabLabel(Gtk.HBox):
"""The close button has been clicked. Destroy the tab"""
self.emit('close-clicked', self)
def on_button_pressed(self, _widget, event):
if event.button == 2:
self.on_close(_widget)
# vim: set expandtab ts=4 sw=4: