Added data icon to app list

Added an icon to the app list that only appears of that app has user data on the system
This commit is contained in:
heliguy
2023-09-01 01:10:09 -04:00
parent 7b8778c818
commit bb3a4547f0
3 changed files with 10 additions and 0 deletions

View File

@@ -11,5 +11,6 @@
<file preprocess="xml-stripblanks">folder-visiting-symbolic.svg</file>
<file preprocess="xml-stripblanks">info-symbolic.svg</file>
<file preprocess="xml-stripblanks">check-plain-symbolic.svg</file>
<file preprocess="xml-stripblanks">paper-filled-symbolic.svg</file>
</gresource>
</gresources>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 5 1 c -1.660156 0 -3 1.339844 -3 3 v 9 c 0 1.660156 1.339844 3 3 3 h 6 c 1.660156 0 3 -1.339844 3 -3 v -6 c 0 -0.90625 -0.359375 -1.773438 -1 -2.414062 l -2.585938 -2.585938 c -0.640624 -0.640625 -1.507812 -1 -2.414062 -1 z m 3 2 l 4 4 h -4 z m 0 0"/></svg>

After

Width:  |  Height:  |  Size: 395 B

View File

@@ -508,6 +508,13 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
if not self.show_runtimes:
flatpak_row.set_visible(False)
if os.path.exists(f"{self.user_data_path}{app_id}"):
has_data_icon = Gtk.Image.new_from_icon_name("paper-filled-symbolic")
has_data_icon.set_tooltip_text("This App Has User Data")
has_data_icon.set_opacity(0.5)
has_data_icon.set_margin_end(10)
flatpak_row.add_suffix(has_data_icon)
trash_button = Gtk.Button(icon_name="user-trash-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_(f"Uninstall {app_name}"))
trash_button.add_css_class("flat")
trash_button.connect("clicked", self.uninstall_flatpak, index)