from exiftool import ExifToolHelper # type: ignore
import gi # type: ignore
gi.require_version('Gtk', '4.0')
+gi.require_version('Gdk', '4.0')
+gi.require_version('GdkPixbuf', '2.0')
gi.require_version('Gio', '2.0')
# pylint: disable=wrong-import-position
-from gi.repository import Gtk, Gio, GObject # type: ignore # noqa: E402
+from gi.repository import Gdk, GdkPixbuf, Gtk, Gio, GObject # type: ignore # noqa: E402
# pylint: disable=no-name-in-module
from stable.gen_params import (GenParams, # noqa: E402
GEN_PARAMS, GEN_PARAMS_STR) # noqa: E402
add_button('reload', lambda _: self.reload_dir(), box_files_selection)
self.box_sort_order = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
box_files_selection.append(self.box_sort_order)
+
+ # self.fbox = Gtk.FlowBox(orientation=Gtk.Orientation.VERTICAL)
+ # self.fbox.set_max_children_per_line(3)
+ # self.fbox.set_selection_mode(Gtk.SelectionMode.NONE)
+
self.viewer = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.viewer.append(box_files_selection)
+ # self.viewer.append(self.fbox)
self.viewer.append(self.metadata)
self.viewer.append(self.label_nothing_to_show)
self.dir_box.props.visible = not self.dir_box.props.visible
def sort(self):
+ # self.fbox.remove_all()
self.list_store.remove_all()
for key in self.sort_order:
self.unsorted_files.sort(key=attrgetter(key))
self.selection.set_selected(pos)
return
self.update_selected()
+ # for file_item in self.unsorted_files:
+ # pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(file_item.full_path, 128, 128, True)
+ # img = Gtk.Image()
+ # img.set_from_pixbuf(pixbuf)
+ # box = Gtk.Box()
+ # box.img = img
+ # self.fbox.append(box)
def update_selected(self, *_args):
if isinstance(self.selection.props.selected_item, ImgItem):