self.list_store = Gio.ListStore(item_type=FileItem)
self.selection = Gtk.SingleSelection.new(self.list_store)
factory = Gtk.SignalListItemFactory()
+ factory.connect('setup', lambda _, i: i.set_child(Gtk.Label(xalign=0)))
+ factory.connect('bind',
+ lambda _, i: i.props.child.set_text(i.props.item.name))
self.selector = Gtk.ListView(model=self.selection, factory=factory)
- dir_box.append(self.selector)
+ scrolled = Gtk.ScrolledWindow(child=self.selector, vexpand=True,
+ propagate_natural_width=True)
+ dir_box.append(scrolled)
box_outer = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
box_outer.append(dir_box)
self.max_index = 0
self.item = None
self.selection.connect('selection-changed', self.update_selected)
- factory.connect('setup',
- lambda _, i: i.set_child(Gtk.Label()))
- factory.connect('bind',
- lambda _, i: i.props.child.set_text(i.props.item.name))
query_attrs = 'standard::name,standard::content-type,time::*'
enumerator = self.dir.enumerate_children(
query_attrs, Gio.FileQueryInfoFlags.NONE, None)
self.metadata.props.label = '\n'.join([self.item.full_path]
+ params_strs)
pic = Gtk.Picture.new_for_filename(self.item.name)
+ pic.props.halign = Gtk.Align.START
self.viewer.append(pic)
else:
self.metadata.props.label = None