From b91bcbf3c52fd25688835c43e23264eae647e397 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Mon, 29 Dec 2025 19:26:31 +0100 Subject: Keep header bar visible when scrolling down books --- src/book_flow.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/book_flow.py') diff --git a/src/book_flow.py b/src/book_flow.py index 7697f29..e3b1165 100644 --- a/src/book_flow.py +++ b/src/book_flow.py @@ -17,10 +17,15 @@ from src.book_transfer import BookTransfer from src.picture_cache import PictureCache import src.book_files as book_files -class BookFlow(Gtk.FlowBox): +class BookFlow(Gtk.ScrolledWindow): + def __init__(self, window, resources, library, ereader, conn, books, progress, genre, msg): - Gtk.FlowBox.__init__(self) + Gtk.ScrolledWindow.__init__(self) + self.set_vexpand(True) + + self._flow_box = Gtk.FlowBox() + self.set_child(self._flow_box) self._window = window self._resources = resources @@ -40,7 +45,7 @@ class BookFlow(Gtk.FlowBox): if book_id: self._picture_cache.invalidate(f'{self._library}/{book_id}/cover-min.png') - self.remove_all() + self._flow_box.remove_all() self._flow_box_children = {} for book_id, data in sorted(books.items(), key=book_sort): if self._is_selected(data, progress, genre): @@ -60,7 +65,7 @@ class BookFlow(Gtk.FlowBox): flow_box_child = Gtk.FlowBoxChild() flow_box_child.set_child(picture) self._flow_box_children[book_id] = flow_box_child - self.append(flow_box_child) + self._flow_box.append(flow_box_child) # Private -- cgit v1.2.3