From d5e9265d3461cfa42eaf344b06916499c04c9c8c Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 18 Jan 2017 09:17:15 +0100 Subject: [PATCH] Fix separators in popup menus on newer Gtk/Adwaita --- terminatorlib/terminal.py | 10 +++++----- terminatorlib/terminal_popup_menu.py | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index fa8d7a1b..d3b3ab1b 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -453,7 +453,7 @@ class Terminal(Gtk.VBox): cnx[0].connect(cnx[1], cnx[2], cnx[3]) if self.group != None or len(self.terminator.groups) > 0: - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) if self.group != None: item = Gtk.MenuItem(_('Remove group %s') % self.group) @@ -476,14 +476,14 @@ class Terminal(Gtk.VBox): menu.append(item) if self.group != None: - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) item = Gtk.MenuItem(_('Close group %s') % self.group) item.connect('activate', lambda x: self.terminator.closegroupedterms(self.group)) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) groupitems = [] cnxs = [] @@ -504,7 +504,7 @@ class Terminal(Gtk.VBox): for cnx in cnxs: 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.set_active(self.config['split_to_group']) @@ -516,7 +516,7 @@ class Terminal(Gtk.VBox): item.connect('toggled', lambda x: self.do_autocleangroups_toggle()) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) item = Gtk.MenuItem.new_with_mnemonic(_('_Insert terminal number')) item.connect('activate', lambda x: self.emit('enumerate', False)) diff --git a/terminatorlib/terminal_popup_menu.py b/terminatorlib/terminal_popup_menu.py index 4f159320..5be2dabf 100755 --- a/terminatorlib/terminal_popup_menu.py +++ b/terminatorlib/terminal_popup_menu.py @@ -97,7 +97,7 @@ class TerminalPopupMenu(object): lambda x: terminal.clipboard.set_text(terminal.prepare_url(url), len(terminal.prepare_url(url)))) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Copy')) item.connect('activate', lambda x: terminal.vte.copy_clipboard()) @@ -108,7 +108,7 @@ class TerminalPopupMenu(object): item.connect('activate', lambda x: terminal.paste_clipboard()) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) if not terminal.is_zoomed(): item = Gtk.ImageMenuItem.new_with_mnemonic(_('Split H_orizontally')) @@ -142,13 +142,13 @@ class TerminalPopupMenu(object): terminal.emit('tab-new', True, terminal)) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) item = Gtk.ImageMenuItem.new_with_mnemonic(_('_Close')) item.connect('activate', lambda x: terminal.close()) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) if not terminal.is_zoomed(): sensitive = not terminal.get_toplevel() == terminal.get_parent() @@ -163,13 +163,13 @@ class TerminalPopupMenu(object): item.set_sensitive(sensitive) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) else: item = Gtk.MenuItem.new_with_mnemonic(_('_Restore all terminals')) item.connect('activate', terminal.unzoom) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) if self.config['show_titlebar'] == False: item = Gtk.MenuItem.new_with_mnemonic(_('Grouping')) @@ -177,7 +177,7 @@ class TerminalPopupMenu(object): submenu.show_all() item.set_submenu(submenu) menu.append(item) - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) item = Gtk.CheckMenuItem.new_with_mnemonic(_('Show _scrollbar')) item.set_active(terminal.scrollbar.get_property('visible')) @@ -219,7 +219,7 @@ class TerminalPopupMenu(object): menuplugin.callback(menuitems, menu, terminal) if len(menuitems) > 0: - menu.append(Gtk.MenuItem()) + menu.append(Gtk.SeparatorMenuItem()) for menuitem in menuitems: menu.append(menuitem)