Merge pull request #679 from mattrose/add-readonly
Add Readonly toggle to popup menu
This commit is contained in:
commit
2aff8dbf30
@ -1047,6 +1047,9 @@ class Terminal(Gtk.VBox):
|
||||
menu = TerminalPopupMenu(self)
|
||||
menu.show(widget, event)
|
||||
|
||||
def do_readonly_toggle(self):
|
||||
self.vte.props.input_enabled = not self.vte.props.input_enabled
|
||||
|
||||
def do_scrollbar_toggle(self):
|
||||
"""Show or hide the terminal scrollbar"""
|
||||
self.toggle_widget_visibility(self.scrollbar)
|
||||
|
@ -262,6 +262,11 @@ class TerminalPopupMenu(object):
|
||||
menu.append(item)
|
||||
menu.append(Gtk.SeparatorMenuItem())
|
||||
|
||||
item = self.menu_item(Gtk.CheckMenuItem, 'toggle_readonly', '_read only')
|
||||
item.set_active(not(terminal.vte.get_input_enabled()))
|
||||
item.connect('toggled', lambda x: terminal.do_readonly_toggle())
|
||||
menu.append(item)
|
||||
|
||||
item = self.menu_item(Gtk.CheckMenuItem, 'toggle_scrollbar',
|
||||
'Show _scrollbar')
|
||||
item.set_active(terminal.scrollbar.get_property('visible'))
|
||||
|
Loading…
Reference in New Issue
Block a user