fromgi.repositoryimportAdw,GtkclassApplicationRow(Adw.ActionRow):def__init__(self,app,is_installed,on_toggle):super().__init__(title=app['name'],subtitle=app['dscr'])self.app=appself.is_installed=is_installedself.checkbox=Gtk.CheckButton()self.checkbox.add_css_class("selection-mode")self.checkbox.set_active(is_installed)self.checkbox.connect("toggled",self.on_checkbox_toggled)self.add_suffix(self.checkbox)self.on_toggle=on_toggle# Callback for when the checkbox is toggleddefon_checkbox_toggled(self,checkbox):self.on_toggle(self.app['name'],checkbox.get_active())self.update_row_css()# Update the row's style when toggleddefis_changed(self):"""Determine if the checkbox state has changed compared to the installed state."""returnself.checkbox.get_active()!=self.is_installeddefupdate_row_css(self):"""Update the CSS classes for the row based on the checkbox state."""forcssin["marked-for-install","marked-for-removal","unchanged"]:self.remove_css_class(css)# Add the appropriate class based on the current checkbox stateifself.is_changed():ifself.checkbox.get_active():self.add_css_class("marked-for-install")print("marked-for-install")else:self.add_css_class("marked-for-removal")print("marked-for-removal")else:# self.add_css_class("unchanged")print("marked-unchanged")