From 218cf4c1fbf7f9225a1647e0bb999438adec6cf5 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 11 May 2013 23:03:46 +0100 Subject: [PATCH] Fix prefs window to not be able to set the inactive colour offset to a value >1.0. Doing so has terrible overflow consequences and ends up making the text very dark, instead of leaving it alone. Closes LP#1177506 --- terminatorlib/prefseditor.py | 2 ++ terminatorlib/terminal.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 3b2814ec..6db410cc 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -923,6 +923,8 @@ class PrefsEditor: def on_inactive_color_offset_change_value(self, widget, scroll, value): """Inactive color offset setting changed""" + if value > 1.0: + value = 1.0 self.config['inactive_color_offset'] = round(value, 2) self.config.save() diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index a153f22f..2a67ed29 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -621,11 +621,17 @@ class Terminal(gtk.VBox): factor = self.config['inactive_color_offset'] self.fgcolor_inactive = self.fgcolor_active.copy() + dbg(("fgcolor_inactive set to: RGB(%s,%s,%s)", getattr(self.fgcolor_inactive, "red"), + getattr(self.fgcolor_inactive, "green"), + getattr(self.fgcolor_inactive, "blue"))) for bit in ['red', 'green', 'blue']: setattr(self.fgcolor_inactive, bit, getattr(self.fgcolor_inactive, bit) * factor) + dbg(("fgcolor_inactive set to: RGB(%s,%s,%s)", getattr(self.fgcolor_inactive, "red"), + getattr(self.fgcolor_inactive, "green"), + getattr(self.fgcolor_inactive, "blue"))) colors = self.config['palette'].split(':') self.palette_active = [] self.palette_inactive = []