Commit 965139d2 authored by Kai Willadsen's avatar Kai Willadsen

diffmap: Use newer, more pythonic style property access

parent 6c121362
...@@ -78,21 +78,13 @@ class DiffMap(Gtk.DrawingArea): ...@@ -78,21 +78,13 @@ class DiffMap(Gtk.DrawingArea):
self.fill_colors, self.line_colors = get_common_theme() self.fill_colors, self.line_colors = get_common_theme()
def on_scrollbar_style_updated(self, scrollbar): def on_scrollbar_style_updated(self, scrollbar):
value = GObject.Value(int) stepper_size = scrollbar.style_get_property("stepper-size")
scrollbar.style_get_property("stepper-size", value) stepper_spacing = scrollbar.style_get_property("stepper-spacing")
stepper_size = value.get_int()
scrollbar.style_get_property("stepper-spacing", value) has_backward = scrollbar.style_get_property("has-backward-stepper")
stepper_spacing = value.get_int() has_secondary_forward = scrollbar.style_get_property("has-secondary-forward-stepper")
has_secondary_backward = scrollbar.style_get_property("has-secondary-backward-stepper")
bool_value = GObject.Value(bool) has_foreward = scrollbar.style_get_property("has-forward-stepper")
scrollbar.style_get_property("has-backward-stepper", bool_value)
has_backward = bool_value.get_boolean()
scrollbar.style_get_property("has-secondary-forward-stepper", bool_value)
has_secondary_forward = bool_value.get_boolean()
scrollbar.style_get_property("has-secondary-backward-stepper", bool_value)
has_secondary_backward = bool_value.get_boolean()
scrollbar.style_get_property("has-forward-stepper", bool_value)
has_foreward = bool_value.get_boolean()
steppers = [has_backward, has_secondary_forward, has_secondary_backward, has_foreward] steppers = [has_backward, has_secondary_forward, has_secondary_backward, has_foreward]
offset = stepper_size * steppers[0:2].count(True) offset = stepper_size * steppers[0:2].count(True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment