From 7f071e0d7e3004092a0ff085f46d09f49eb027ba Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Sun, 29 Nov 2015 19:33:52 +0100 Subject: [PATCH] Fix unwanted seperator size change, and increase granularity of dim/transparent sliders --- terminatorlib/preferences.glade | 7 +++++-- terminatorlib/prefseditor.py | 17 +++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/terminatorlib/preferences.glade b/terminatorlib/preferences.glade index 9d04d2d2..8159eabb 100644 --- a/terminatorlib/preferences.glade +++ b/terminatorlib/preferences.glade @@ -861,10 +861,12 @@ + 100 True True adjustment7 - 1 + 2 + 2 left @@ -2839,7 +2841,8 @@ True True background_darkness_scale - 1 + 2 + 2 bottom diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 0924e005..02de5775 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -826,9 +826,12 @@ class PrefsEditor: self.config['scrollbar_position'] = value self.config.save() - def on_darken_background_scale_change_value(self, widget, scroll, value): + def on_darken_background_scale_change_value(self, widget, scroll, _value_not_rounded): """Background darkness setting changed""" - self.config['background_darkness'] = round(value, 2) + value = widget.get_value() # This one is rounded according to the UI. + if value > 1.0: + value = 1.0 + self.config['background_darkness'] = value self.config.save() def on_palette_combobox_changed(self, widget): @@ -980,16 +983,18 @@ class PrefsEditor: self.config['title_transmit_fg_color'] = color2hex(widget) self.config.save() - def on_inactive_color_offset_change_value(self, widget, scroll, value): + def on_inactive_color_offset_change_value(self, widget, scroll, _value_not_rounded): """Inactive color offset setting changed""" + value = widget.get_value() # This one is rounded according to the UI. if value > 1.0: value = 1.0 - self.config['inactive_color_offset'] = round(value, 2) + self.config['inactive_color_offset'] = value self.config.save() - def on_handlesize_change_value(self, widget, scroll, value): + def on_handlesize_change_value(self, widget, scroll, _value_not_rounded): """Handle size changed""" - value = int(value) + value = widget.get_value() # This one is rounded according to the UI. + value = int(value) # Cast to int. if value > 5: value = 5 self.config['handle_size'] = value