Close client tab with mouse middle click

This commit is contained in:
Hulala
2024-05-11 11:19:38 +02:00
parent cfc0cba290
commit 1f74c18430
4 changed files with 15 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Close tab with mouse middle click
* Support language suffix in CSV import
Version 7.2.0 - 2024-04-29
+5
View File
@@ -438,6 +438,11 @@
}).on('show.bs.tab', function() {
Sao.set_url(tab.get_url(), tab.name_long.split(' / ').pop());
Sao.Tab.set_view_type(tab.current_view_type);
}).on('mousedown', function(evt) {
if (evt.which === 2) {
evt.preventDefault();
tab.close();
}
})
.append(jQuery('<button/>', {
'class': 'close',
+1
View File
@@ -1,3 +1,4 @@
* Close tab with mouse middle click
* Support language suffix in CSV import
Version 7.2.0 - 2024-04-29
+8 -1
View File
@@ -864,7 +864,14 @@ class Main(Gtk.Application):
halign=Gtk.Align.START)
self.tooltips.set_tip(label, page.name)
self.tooltips.enable()
hbox.pack_start(label, expand=True, fill=True, padding=0)
def remove_book_middle_click(widget, event):
if event.button == 2:
return self._sig_remove_book(widget, page.widget)
eventbox = Gtk.EventBox()
eventbox.connect('button-press-event', remove_book_middle_click)
eventbox.add(label)
hbox.pack_start(eventbox, expand=True, fill=True, padding=0)
button = Gtk.Button()
button.set_relief(Gtk.ReliefStyle.NONE)