Fix unwanted seperator size change, and increase granularity of dim/transparent sliders

This commit is contained in:
Stephen Boddy 2015-11-29 19:33:52 +01:00
parent 80b157ee33
commit 7f071e0d7e
2 changed files with 16 additions and 8 deletions

View File

@ -861,10 +861,12 @@
</child> </child>
<child> <child>
<object class="GtkHScale" id="inactive_color_offset"> <object class="GtkHScale" id="inactive_color_offset">
<property name="width_request">100</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="adjustment">adjustment7</property> <property name="adjustment">adjustment7</property>
<property name="round_digits">1</property> <property name="round_digits">2</property>
<property name="digits">2</property>
<property name="value_pos">left</property> <property name="value_pos">left</property>
<signal name="change-value" handler="on_inactive_color_offset_change_value" swapped="no"/> <signal name="change-value" handler="on_inactive_color_offset_change_value" swapped="no"/>
</object> </object>
@ -2839,7 +2841,8 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="adjustment">background_darkness_scale</property> <property name="adjustment">background_darkness_scale</property>
<property name="round_digits">1</property> <property name="round_digits">2</property>
<property name="digits">2</property>
<property name="value_pos">bottom</property> <property name="value_pos">bottom</property>
<signal name="change-value" handler="on_darken_background_scale_change_value" swapped="no"/> <signal name="change-value" handler="on_darken_background_scale_change_value" swapped="no"/>
</object> </object>

View File

@ -826,9 +826,12 @@ class PrefsEditor:
self.config['scrollbar_position'] = value self.config['scrollbar_position'] = value
self.config.save() 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""" """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() self.config.save()
def on_palette_combobox_changed(self, widget): def on_palette_combobox_changed(self, widget):
@ -980,16 +983,18 @@ class PrefsEditor:
self.config['title_transmit_fg_color'] = color2hex(widget) self.config['title_transmit_fg_color'] = color2hex(widget)
self.config.save() 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""" """Inactive color offset setting changed"""
value = widget.get_value() # This one is rounded according to the UI.
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
self.config['inactive_color_offset'] = round(value, 2) self.config['inactive_color_offset'] = value
self.config.save() 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""" """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: if value > 5:
value = 5 value = 5
self.config['handle_size'] = value self.config['handle_size'] = value