diff --git a/terminatorlib/config.py b/terminatorlib/config.py index d161d560..987d648c 100644 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -235,6 +235,7 @@ 'use_system_font' : True, 'use_theme_colors' : False, 'bold_is_bright' : False, + 'line_height' : 1.0, 'encoding' : 'UTF-8', 'active_encodings' : ['UTF-8', 'ISO-8859-1'], 'focus_on_close' : 'auto', diff --git a/terminatorlib/preferences.glade b/terminatorlib/preferences.glade index d24f4f50..b4ceaa4b 100644 --- a/terminatorlib/preferences.glade +++ b/terminatorlib/preferences.glade @@ -313,6 +313,13 @@ 1 2 + + 1.0 + 2.0 + 1.0 + 0.1 + 0.2 + 100 1 @@ -904,6 +911,53 @@ 1 + + + True + False + Line Height: + 0 + + + 0 + 4 + + + + + 100 + True + True + baseline + True + adjustment_lineheight + 1 + 1 + False + bottom + + + + 2 + 4 + + + + + True + False + 1.0 + right + 5 + 5 + 1 + 1 + + + 1 + 4 + + 100 diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index cddc09f3..101c357a 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -240,6 +240,13 @@ def set_values(self): widget.set_value(float(termsepsize)) widget = guiget('handlesize_value_label') widget.set_text(str(termsepsize)) + # Line Height + lineheightsize = self.config['line_height'] + lineheightsize = round(float(lineheightsize),1) + widget = guiget('lineheight') + widget.set_value(lineheightsize) + widget = guiget('lineheight_value_label') + widget.set_text(str(lineheightsize)) # Window geometry hints geomhint = self.config['geometry_hinting'] widget = guiget('wingeomcheck') @@ -1100,6 +1107,18 @@ def on_handlesize_value_changed(self, widget): label_widget = guiget('handlesize_value_label') label_widget.set_text(str(value)) + def on_lineheight_value_changed(self, widget): + """Handles line height changed""" + value = widget.get_value() + value = round(float(value), 1) + if value > 2.0: + value = 2.0 + self.config['line_height'] = value + self.config.save() + guiget = self.builder.get_object + label_widget = guiget('lineheight_value_label') + label_widget.set_text(str(value)) + def on_focuscombo_changed(self, widget): """Focus type changed""" selected = widget.get_active() diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index f806c50c..4a2bd506 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -694,6 +694,8 @@ def reconfigure(self, _widget=None): except: pass self.vte.set_allow_bold(self.config['allow_bold']) + if hasattr(self.vte,'set_cell_height_scale'): + self.vte.set_cell_height_scale(self.config['line_height']) if hasattr(self.vte, 'set_bold_is_bright'): self.vte.set_bold_is_bright(self.config['bold_is_bright']) @@ -813,6 +815,7 @@ def reconfigure(self, _widget=None): elif self.config['scrollbar_position'] == 'right': self.terminalbox.reorder_child(self.vte, 0) + self.vte.set_rewrap_on_resize(self.config['rewrap_on_resize']) self.titlebar.update()