From b1d502e939b55959df01ae2e71c8e71ac008e022 Mon Sep 17 00:00:00 2001 From: Matt Rose Date: Wed, 10 Jun 2020 22:48:43 -0400 Subject: [PATCH 1/2] add line_height config variable --- terminatorlib/config.py | 1 + terminatorlib/terminal.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 6338a8f7..c7563aa6 100644 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -233,6 +233,7 @@ DEFAULTS = { '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/terminal.py b/terminatorlib/terminal.py index dfaf14cf..76fbb298 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -693,6 +693,8 @@ class Terminal(Gtk.VBox): 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']) @@ -812,6 +814,7 @@ class Terminal(Gtk.VBox): 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() From 3d128f0334f80323955ff14231e7373ca204da8f Mon Sep 17 00:00:00 2001 From: Douglas Bacon Date: Sun, 21 Jun 2020 14:35:50 -0400 Subject: [PATCH 2/2] add line-height slider --- terminatorlib/preferences.glade | 54 +++++++++++++++++++++++++++++++++ terminatorlib/prefseditor.py | 19 ++++++++++++ 2 files changed, 73 insertions(+) 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 @@ class PrefsEditor: 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 @@ class PrefsEditor: 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()