Skip to content

Commit

Permalink
fix: use Gtk.ToggleButton.toggled for setting unit, fixes #179 (#194)
Browse files Browse the repository at this point in the history
Co-authored-by: Drew VanDine <avandine23@gmail.com>
  • Loading branch information
Phqen1x and Phqen1x authored Jan 11, 2025
1 parent 929f358 commit 0ec1d98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/windowPreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, application, **kwargs):
self.metric_check_btn = Gtk.CheckButton.new()
self.metric_unit.add_prefix(self.metric_check_btn)
self.metric_unit.set_activatable_widget(self.metric_check_btn)
self.metric_unit.connect("activated", self._change_unit,'metric')
self.metric_check_btn.connect("toggled", self._change_unit,'metric')
self.measurement_group.add(self.metric_unit)

self.imperial_unit = Adw.ActionRow.new()
Expand All @@ -98,7 +98,7 @@ def __init__(self, application, **kwargs):
self.imperial_unit.add_prefix(self.imperial_check_btn)
self.imperial_check_btn.set_group(self.metric_check_btn)
self.imperial_unit.set_activatable_widget(self.imperial_check_btn)
self.imperial_unit.connect("activated", self._change_unit,'imperial')
self.imperial_check_btn.connect("toggled", self._change_unit,'imperial')
self.measurement_group.add(self.imperial_unit)
GLib.idle_add(self.metric_unit.activate) if settings.unit == 'metric' else GLib.idle_add(self.imperial_unit.activate)

Expand Down

0 comments on commit 0ec1d98

Please sign in to comment.