Merge pull request #451 from kocho1984/close_tab_on_middle_button
Closing tab on middle mouse button press
This commit is contained in:
commit
24f1503234
|
@ -568,6 +568,8 @@ class TabLabel(Gtk.HBox):
|
||||||
self.terminator = Terminator()
|
self.terminator = Terminator()
|
||||||
self.config = Config()
|
self.config = Config()
|
||||||
|
|
||||||
|
self.connect("button-press-event", self.on_button_pressed)
|
||||||
|
|
||||||
self.label = EditableLabel(title)
|
self.label = EditableLabel(title)
|
||||||
self.update_angle()
|
self.update_angle()
|
||||||
|
|
||||||
|
@ -650,4 +652,8 @@ class TabLabel(Gtk.HBox):
|
||||||
"""The close button has been clicked. Destroy the tab"""
|
"""The close button has been clicked. Destroy the tab"""
|
||||||
self.emit('close-clicked', self)
|
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:
|
# vim: set expandtab ts=4 sw=4:
|
||||||
|
|
Loading…
Reference in New Issue