software: use different fallback symbol

This commit is contained in:
Peter Eisenmann
2022-09-30 11:22:04 +02:00
parent 6ea3b1a430
commit f81b9d341e
2 changed files with 7 additions and 4 deletions

View File

@@ -20,7 +20,8 @@ class SoftwarePage(Gtk.Box, Page):
Gtk.Box.__init__(self, **kwargs)
self.software_list.bind_model(
self.software_model,
lambda pkg: SelectionRow(pkg.name, pkg.description, pkg.icon_path, pkg.suggested, pkg))
lambda pkg: SelectionRow(pkg.name, pkg.description, pkg.icon_path,
pkg.suggested, pkg, 'application-x-executable-symbolic'))
def _setup_software(self):
suggestions = get_software_suggestions()

View File

@@ -70,13 +70,15 @@ class SelectionRow(Adw.ActionRow):
icon = Gtk.Template.Child()
switch = Gtk.Template.Child()
def __init__(self, title, description, icon_path, default_state, info, **kwargs):
def __init__(self, title, description, icon_path, default_state, info,
fallback_icon, **kwargs):
super().__init__(**kwargs)
self.set_title(title)
self.set_subtitle(description)
self.switch.set_state(default_state)
if icon_path == None:
self.icon.set_visible(False)
if not icon_path:
self.icon.set_from_icon_name(fallback_icon)
self.icon.set_icon_size(Gtk.IconSize.LARGE)
else:
self.icon.set_from_file(icon_path)