diff --git a/src/properties_window.py b/src/properties_window.py index d6249d5..de233ba 100644 --- a/src/properties_window.py +++ b/src/properties_window.py @@ -80,10 +80,19 @@ def show_properties_window(widget, index, window): properties_list.add_css_class("boxed-list") path = str(window.user_data_path) + window.host_flatpaks[index][2] - + + def size_thread(path): + size = f"{path}\n~{my_utils.getSizeWithFormat(path)}" + user_data_row.set_subtitle(size) + + def calc_size(path): + task = Gio.Task.new(None, None, None) + task.run_in_thread(lambda _task, _obj, _data, _cancellable: size_thread(path)) + if os.path.exists(path): user_data_row.set_title("User Data") - user_data_row.set_subtitle(f"{path}\n~{my_utils.getSizeWithFormat(path)}") + # user_data_row.set_subtitle(f"{path}\n~{my_utils.getSizeWithFormat(path)}") + calc_size(path) open_button = Gtk.Button(icon_name="document-open-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("Open Data Folder")) open_button.add_css_class("flat")