From 24338890799c4b3435a07406a19f23ae37a9222a Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Thu, 7 May 2020 23:30:23 +0200 Subject: [PATCH] Added checkmarks --- src/window.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/window.py b/src/window.py index 6cb977f..4f374db 100644 --- a/src/window.py +++ b/src/window.py @@ -69,6 +69,8 @@ class ThumbdrivesWindow(Gtk.ApplicationWindow): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=8) icon = Gtk.Image() label = Gtk.Label(path.name.replace(".img", ""), xalign=0) + label.set_margin_top(8) + label.set_margin_bottom(8) box.pack_start(icon, False, False, False) box.pack_start(label, True, True, False) box.filename = str(path) @@ -92,6 +94,31 @@ class ThumbdrivesWindow(Gtk.ApplicationWindow): else: self.headerbar.set_subtitle("Loaded " + os.path.basename(filename)) + for row_wrapper in self.thumbdrive_list: + box = row_wrapper.get_child() + filename = box.filename + icon = None + for widget in box: + if isinstance(widget, Gtk.Image): + icon = widget + if filename == filename: + icon.set_from_icon_name('object-select-symbolic', Gtk.IconSize.BUTTON) + else: + icon.clear() + + for row_wrapper in self.iso_list: + box = row_wrapper.get_child() + filename = box.filename + icon = None + for widget in box: + if isinstance(widget, Gtk.Image): + icon = widget + if filename == filename: + icon.set_from_icon_name('object-select-symbolic', Gtk.IconSize.BUTTON) + else: + icon.clear() + + @Gtk.Template.Callback() def on_image_row_activated(self, listbox, row): box = row.get_child() -- 2.45.2