BookTile is the compact widget that displays a single book inside the shelf
grid. Each tile shows the cover art (if available) and a wrapped title label,
and emits a signal when the user clicks it.
Gtk::Picture, loading a Gdk::Texture from the
Book when needed.Gtk::GestureClick) that triggers
signalActivated() for the parent view to handle.BookShelf can pack multiple
tiles per row seamlessly.BookTile : Gtk::Box (vertical)
├── Gtk::Picture m_cover
└── Gtk::Label m_title
Gestures and styling are applied to the box itself so the grid behind it can control selection appearance.
BookTile::setBook(const Book&): updates internal state, refreshes the cover
texture and title.BookTile::rebuild(): helper that (re)loads the cover if missing and updates
the label text.signalActivated(): forward this signal to react when the tile is clicked.BookShelf adds CSS classes (book-tile) and wraps each tile inside a
GridView child. To keep a consistent grid:
set_size_request(m_coverSize + 16, -1) so each tile has
a predictable width for column calculations.Gtk::GestureClick with button 3 or a Gtk::Popover.BookShelf creates BookTile instances inside onFactorySetup(), binds them to
BookObject data during onFactoryBind(), and listens to signalActivated() to
emit its own signalBookActivated().
If other modules need to render books (e.g., a details sidebar), they can reuse
BookTile directly or subclass it with additional controls.