Add option to toggle the rewrap on resize

This commit is contained in:
Stephen Boddy 2015-11-28 20:14:14 +01:00
parent 73ba77ee5e
commit b5b74e8071
5 changed files with 31 additions and 0 deletions

View File

@ -465,6 +465,10 @@ Default value: \fBUTF-8\fR
.B copy_on_selection \fR(boolean) .B copy_on_selection \fR(boolean)
If set to True, text selections will be automatically copied to the clipboard, in addition to being made the Primary selection. If set to True, text selections will be automatically copied to the clipboard, in addition to being made the Primary selection.
Default value: \fBFalse\fR Default value: \fBFalse\fR
.TP
.B rewrap_on_resize \fR(boolean)
If True, the terminal contents are rewrapped when the terminal's width changes. Warning: This might be slow if you have a huge scrollback buffer.
Default value: \fBTrue\fR
.SH layouts .SH layouts

View File

@ -240,6 +240,7 @@ DEFAULTS = {
'force_no_bell' : False, 'force_no_bell' : False,
'cycle_term_tab' : True, 'cycle_term_tab' : True,
'copy_on_selection' : False, 'copy_on_selection' : False,
'rewrap_on_resize' : True,
'split_to_group' : False, 'split_to_group' : False,
'autoclean_groups' : True, 'autoclean_groups' : True,
'http_proxy' : '', 'http_proxy' : '',

View File

@ -1603,6 +1603,22 @@
<property name="position">4</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="rewrap_on_resize_checkbutton">
<property name="label" translatable="yes">Rewrap on resize</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_rewrap_on_resize_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

View File

@ -421,6 +421,9 @@ class PrefsEditor:
# Copy on selection # Copy on selection
widget = guiget('copy_on_selection') widget = guiget('copy_on_selection')
widget.set_active(self.config['copy_on_selection']) widget.set_active(self.config['copy_on_selection'])
# Rewrap on resize
widget = guiget('rewrap_on_resize_checkbutton')
widget.set_active(self.config['rewrap_on_resize'])
# Cursor shape # Cursor shape
widget = guiget('cursor_shape_combobox') widget = guiget('cursor_shape_combobox')
if self.config['cursor_shape'] == 'underline': if self.config['cursor_shape'] == 'underline':
@ -696,6 +699,11 @@ class PrefsEditor:
self.config['copy_on_selection'] = widget.get_active() self.config['copy_on_selection'] = widget.get_active()
self.config.save() self.config.save()
def on_rewrap_on_resize_toggled(self, widget):
"""Rewrap on resize setting changed"""
self.config['rewrap_on_resize'] = widget.get_active()
self.config.save()
def on_cursor_blink_toggled(self, widget): def on_cursor_blink_toggled(self, widget):
"""Cursor blink setting changed""" """Cursor blink setting changed"""
self.config['cursor_blink'] = widget.get_active() self.config['cursor_blink'] = widget.get_active()

View File

@ -770,6 +770,8 @@ class Terminal(Gtk.VBox):
elif self.config['scrollbar_position'] == 'right': elif self.config['scrollbar_position'] == 'right':
self.reorder_child(self.vte, 0) self.reorder_child(self.vte, 0)
self.vte.set_rewrap_on_resize(self.config['rewrap_on_resize'])
self.titlebar.update() self.titlebar.update()
self.vte.queue_draw() self.vte.queue_draw()