Fix toggle watched status
This commit is contained in:
parent
5894e55c36
commit
f1e35214e2
1 changed files with 2 additions and 3 deletions
|
@ -183,7 +183,7 @@ class MainWindow(Gtk.ApplicationWindow, Watcher):
|
||||||
label = cast(Gtk.Label, box.get_last_child())
|
label = cast(Gtk.Label, box.get_last_child())
|
||||||
item = cast(FileItem, list_item.get_item())
|
item = cast(FileItem, list_item.get_item())
|
||||||
|
|
||||||
def update_icon(*args: object) -> None:
|
def update_icon():
|
||||||
if item.file_type == FileType.DIRECTORY:
|
if item.file_type == FileType.DIRECTORY:
|
||||||
icon.set_from_icon_name("folder-symbolic")
|
icon.set_from_icon_name("folder-symbolic")
|
||||||
icon.set_css_classes(["file-icon"])
|
icon.set_css_classes(["file-icon"])
|
||||||
|
@ -202,8 +202,7 @@ class MainWindow(Gtk.ApplicationWindow, Watcher):
|
||||||
icon.set_css_classes(["file-icon", "in-progress"])
|
icon.set_css_classes(["file-icon", "in-progress"])
|
||||||
|
|
||||||
label.set_text(item.name)
|
label.set_text(item.name)
|
||||||
item.connect("notify::saved-position", update_icon)
|
item.watch(update_icon)
|
||||||
item.connect("notify::saved-duration", update_icon)
|
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
def _on_activate(self, widget: Gtk.ListView, index: int):
|
def _on_activate(self, widget: Gtk.ListView, index: int):
|
||||||
|
|
Loading…
Reference in a new issue