diff --git a/src/all_photos.rs b/src/all_photos.rs index 9662a4f8..21b087c8 100644 --- a/src/all_photos.rs +++ b/src/all_photos.rs @@ -54,7 +54,7 @@ impl RelmGridItem for PicturePreview { .set_filename(self.picture.square_preview_path.clone()); } - fn unbind(&mut self, widgets: &mut Self::Widgets, root: &mut Self::Root) { + fn unbind(&mut self, widgets: &mut Self::Widgets, _root: &mut Self::Root) { widgets.picture.set_filename(None::<&path::Path>); } } @@ -77,6 +77,7 @@ impl SimpleComponent for AllPhotos { set_margin_all: 0, gtk::ScrolledWindow { + //set_propagate_natural_height: true, //set_has_frame: true, set_vexpand: true, diff --git a/src/app.rs b/src/app.rs index 6150bcee..fa627020 100644 --- a/src/app.rs +++ b/src/app.rs @@ -139,7 +139,10 @@ impl SimpleComponent for App { let cache_dir = glib::user_cache_dir().join("photo-romantic"); let _ = std::fs::create_dir_all(&cache_dir); - let pic_base_dir = path::Path::new("/var/home/david/Pictures"); + // TODO use XDG_PICTURES_DIR as the default, but let users override in preferences. + let pic_base_dir = glib::user_special_dir(glib::enums::UserDirectory::Pictures) + .expect("Expect XDG_PICTURES_DIR"); + let repo = { let db_path = data_dir.join("pictures.sqlite"); photos_core::Repository::open(&pic_base_dir, &db_path).unwrap()