mouseperspective: enable the "commit" button if any profile is dirty

..not only the active one.
This fixes the "commit" button not getting active when another profile
is disabled outside of Piper (e.g. ratbagctl).
This commit is contained in:
Yaroslav Chvanov
2023-03-18 21:23:18 +03:00
parent b7ba399c94
commit e5aae89fc7

View File

@@ -198,11 +198,10 @@ class MousePerspective(Gtk.Overlay):
def _on_profile_notify_dirty(
self, profile: RatbagdProfile, pspec: Optional[GObject.ParamSpec]
) -> None:
if profile is not self._profile:
return
device_dirty = any(p.dirty for p in self._device.profiles)
style_context = self.button_commit.get_style_context()
if profile.dirty:
if device_dirty:
style_context.add_class("suggested-action")
self.button_commit.set_sensitive(True)
else: