"""Update .metadata about individual file, .topbar also on idx/total"""
self.metadata.set_text('')
selected_item = self.gallery.selected_item
+ display_name = '(none)'
if selected_item:
+ display_name = selected_item.full_path
if isinstance(selected_item, ImgItem):
params_strs = [f'{k}: {getattr(selected_item, k.lower())}'
for k in GEN_PARAMS]
total = len([s for s in self.gallery.slots
if isinstance(s.item, (DirItem, ImgItem))])
n_selected = self.gallery.selected_idx + 1
- txt = f' {n_selected} of {total} – <b>{selected_item.full_path}</b>'
+ txt = f' {n_selected} of {total} – <b>{display_name}</b>'
self.topbar.set_text(txt)
self.topbar.set_use_markup(True)