feat(wallpaper-store): enhance previews, EXIF handling, and shuffle
Android Release / Build signed release APK (push) Successful in 34m17s
Android Release / Build signed release APK (push) Successful in 34m17s
These changes add image previews and robust image handling across platforms. Android, desktop, and TS UI now share imagePreviews data and a persistent shuffle queue, improving ordering and previews. EXIF orientation is applied when decoding images and rendering crops. Manifest and rendering paths were adjusted for portrait mode. - Introduce imagePreviews in models and UI to show per-image crop data. - Implement EXIF orientation handling and enhanced cropping. - Improve shuffle with persistent queue and seen-tracking.
This commit is contained in:
@@ -15,6 +15,20 @@ pub struct Wallpaper<R: Runtime>(AppHandle<R>);
|
||||
|
||||
impl<R: Runtime> Wallpaper<R> {
|
||||
fn demo() -> WallpaperState {
|
||||
let image_previews = ["alpine", "waterfall", "coast"]
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(index, name)| GalleryImage {
|
||||
id: format!("demo-{index}"),
|
||||
url: format!("/wallpapers/{name}.png"),
|
||||
selected: index == 0,
|
||||
crop_mode: "cover".into(),
|
||||
crop_zoom: 1.0,
|
||||
crop_position_x: 0.5,
|
||||
crop_position_y: 0.5,
|
||||
crop_rotation: 0,
|
||||
})
|
||||
.collect();
|
||||
WallpaperState {
|
||||
image_count: 3,
|
||||
enabled: true,
|
||||
@@ -31,6 +45,7 @@ impl<R: Runtime> Wallpaper<R> {
|
||||
"/wallpapers/waterfall.png".into(),
|
||||
"/wallpapers/coast.png".into(),
|
||||
],
|
||||
image_previews,
|
||||
}
|
||||
}
|
||||
pub fn get_state(&self) -> crate::Result<WallpaperState> {
|
||||
|
||||
@@ -14,6 +14,8 @@ pub struct WallpaperState {
|
||||
pub current_id: Option<String>,
|
||||
pub image_ids: Vec<String>,
|
||||
pub image_urls: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub image_previews: Vec<GalleryImage>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user