imageView: Use custom slide widget and IndexSet

Use IndexSet to allow direct access by Path and also allow
an arbitrary ordering that was not possible with Vec. Also
add monitoring of file changes in the directory.

Use a custom LpSlidingView instead of AdwCarousel because
Carousel was never designed for this job and suffered of
bugs. LpSlidingView does not support swiping gestures yet
since they currently don't work yet anyways #24.

Use a new algorithm to fill the LpSlidingView that is
stateless and covers all potential changes in the directory.
This not only fixes bugs but would also work with changed
sorting orders.

This also adds build time template XML validation since it
was useful for the refactoring #46.

Closes #9, #11, #30, #33, #42
This commit is contained in:
Sophie Herold 2023-01-23 01:10:15 +01:00 • committed by Christopher Davis
parent 73764810eb
commit f2357513da
21 changed files with 1010 additions and 553 deletions

View file

@ -76,13 +76,13 @@ mod imp {
let application = self.instance();
for file in files {
let win = LpWindow::new(&*application);
win.set_image_from_file(file, true);
win.set_image_from_path(&file.path().unwrap());
// show window when image size is known
let watch = win
.imp()
.image_view
.property_expression("current-page-strict")
.property_expression("current-page")
.chain_property::<LpImagePage>("image")
.chain_property::<LpImage>("image-size")
.watch(
@ -97,7 +97,7 @@ mod imp {
let watch = win
.imp()
.image_view
.property_expression("current-page-strict")
.property_expression("current-page")
.chain_property::<LpImagePage>("error")
.watch(
glib::Object::NONE,