Fix separators in popup menus on newer Gtk/Adwaita
This commit is contained in:
parent
20a11664b6
commit
d5e9265d34
|
@ -453,7 +453,7 @@ class Terminal(Gtk.VBox):
|
||||||
cnx[0].connect(cnx[1], cnx[2], cnx[3])
|
cnx[0].connect(cnx[1], cnx[2], cnx[3])
|
||||||
|
|
||||||
if self.group != None or len(self.terminator.groups) > 0:
|
if self.group != None or len(self.terminator.groups) > 0:
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
if self.group != None:
|
if self.group != None:
|
||||||
item = Gtk.MenuItem(_('Remove group %s') % self.group)
|
item = Gtk.MenuItem(_('Remove group %s') % self.group)
|
||||||
|
@ -476,14 +476,14 @@ class Terminal(Gtk.VBox):
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
if self.group != None:
|
if self.group != None:
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
item = Gtk.MenuItem(_('Close group %s') % self.group)
|
item = Gtk.MenuItem(_('Close group %s') % self.group)
|
||||||
item.connect('activate', lambda x:
|
item.connect('activate', lambda x:
|
||||||
self.terminator.closegroupedterms(self.group))
|
self.terminator.closegroupedterms(self.group))
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
groupitems = []
|
groupitems = []
|
||||||
cnxs = []
|
cnxs = []
|
||||||
|
@ -504,7 +504,7 @@ class Terminal(Gtk.VBox):
|
||||||
for cnx in cnxs:
|
for cnx in cnxs:
|
||||||
cnx[0].connect(cnx[1], cnx[2], cnx[3])
|
cnx[0].connect(cnx[1], cnx[2], cnx[3])
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
item = Gtk.CheckMenuItem.new_with_mnemonic(_('_Split to this group'))
|
item = Gtk.CheckMenuItem.new_with_mnemonic(_('_Split to this group'))
|
||||||
item.set_active(self.config['split_to_group'])
|
item.set_active(self.config['split_to_group'])
|
||||||
|
@ -516,7 +516,7 @@ class Terminal(Gtk.VBox):
|
||||||
item.connect('toggled', lambda x: self.do_autocleangroups_toggle())
|
item.connect('toggled', lambda x: self.do_autocleangroups_toggle())
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
item = Gtk.MenuItem.new_with_mnemonic(_('_Insert terminal number'))
|
item = Gtk.MenuItem.new_with_mnemonic(_('_Insert terminal number'))
|
||||||
item.connect('activate', lambda x: self.emit('enumerate', False))
|
item.connect('activate', lambda x: self.emit('enumerate', False))
|
||||||
|
|
|
@ -97,7 +97,7 @@ class TerminalPopupMenu(object):
|
||||||
lambda x: terminal.clipboard.set_text(terminal.prepare_url(url), len(terminal.prepare_url(url))))
|
lambda x: terminal.clipboard.set_text(terminal.prepare_url(url), len(terminal.prepare_url(url))))
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Copy'))
|
item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Copy'))
|
||||||
item.connect('activate', lambda x: terminal.vte.copy_clipboard())
|
item.connect('activate', lambda x: terminal.vte.copy_clipboard())
|
||||||
|
@ -108,7 +108,7 @@ class TerminalPopupMenu(object):
|
||||||
item.connect('activate', lambda x: terminal.paste_clipboard())
|
item.connect('activate', lambda x: terminal.paste_clipboard())
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
if not terminal.is_zoomed():
|
if not terminal.is_zoomed():
|
||||||
item = Gtk.ImageMenuItem.new_with_mnemonic(_('Split H_orizontally'))
|
item = Gtk.ImageMenuItem.new_with_mnemonic(_('Split H_orizontally'))
|
||||||
|
@ -142,13 +142,13 @@ class TerminalPopupMenu(object):
|
||||||
terminal.emit('tab-new', True, terminal))
|
terminal.emit('tab-new', True, terminal))
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Close'))
|
item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Close'))
|
||||||
item.connect('activate', lambda x: terminal.close())
|
item.connect('activate', lambda x: terminal.close())
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
if not terminal.is_zoomed():
|
if not terminal.is_zoomed():
|
||||||
sensitive = not terminal.get_toplevel() == terminal.get_parent()
|
sensitive = not terminal.get_toplevel() == terminal.get_parent()
|
||||||
|
@ -163,13 +163,13 @@ class TerminalPopupMenu(object):
|
||||||
item.set_sensitive(sensitive)
|
item.set_sensitive(sensitive)
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
else:
|
else:
|
||||||
item = Gtk.MenuItem.new_with_mnemonic(_('_Restore all terminals'))
|
item = Gtk.MenuItem.new_with_mnemonic(_('_Restore all terminals'))
|
||||||
item.connect('activate', terminal.unzoom)
|
item.connect('activate', terminal.unzoom)
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
if self.config['show_titlebar'] == False:
|
if self.config['show_titlebar'] == False:
|
||||||
item = Gtk.MenuItem.new_with_mnemonic(_('Grouping'))
|
item = Gtk.MenuItem.new_with_mnemonic(_('Grouping'))
|
||||||
|
@ -177,7 +177,7 @@ class TerminalPopupMenu(object):
|
||||||
submenu.show_all()
|
submenu.show_all()
|
||||||
item.set_submenu(submenu)
|
item.set_submenu(submenu)
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
item = Gtk.CheckMenuItem.new_with_mnemonic(_('Show _scrollbar'))
|
item = Gtk.CheckMenuItem.new_with_mnemonic(_('Show _scrollbar'))
|
||||||
item.set_active(terminal.scrollbar.get_property('visible'))
|
item.set_active(terminal.scrollbar.get_property('visible'))
|
||||||
|
@ -219,7 +219,7 @@ class TerminalPopupMenu(object):
|
||||||
menuplugin.callback(menuitems, menu, terminal)
|
menuplugin.callback(menuitems, menu, terminal)
|
||||||
|
|
||||||
if len(menuitems) > 0:
|
if len(menuitems) > 0:
|
||||||
menu.append(Gtk.MenuItem())
|
menu.append(Gtk.SeparatorMenuItem())
|
||||||
|
|
||||||
for menuitem in menuitems:
|
for menuitem in menuitems:
|
||||||
menu.append(menuitem)
|
menu.append(menuitem)
|
||||||
|
|
Loading…
Reference in New Issue