File mousam-toggle-unit-settings-button.patch of Package mousam

From 0ec1d98a02c2a10e8520e21e5002709905ac799c Mon Sep 17 00:00:00 2001
From: Phqen1x <Drew@vandine.org>
Date: Sat, 11 Jan 2025 05:28:57 -0500
Subject: [PATCH] fix: use Gtk.ToggleButton.toggled for setting unit, fixes
 #179 (#194)

Co-authored-by: Drew VanDine <avandine23@gmail.com>
---
 src/windowPreferences.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/windowPreferences.py b/src/windowPreferences.py
index efa519a..36abbec 100644
--- a/src/windowPreferences.py
+++ b/src/windowPreferences.py
@@ -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()
@@ -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)
 
openSUSE Build Service is sponsored by