From 2f86513daa71686678632e88bac3ed21ba1fdddf Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 7 Dec 2022 22:19:05 -0800 Subject: [PATCH] viewer: add edit exif button --- src/components/Metadata.vue | 15 ++++++++------ src/components/SelectionManager.vue | 4 ++-- src/components/viewer/Viewer.vue | 31 ++++++++++++++++++++++------- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/components/Metadata.vue b/src/components/Metadata.vue index d3f5029e..f06c0b16 100644 --- a/src/components/Metadata.vue +++ b/src/components/Metadata.vue @@ -148,13 +148,16 @@ export default class Metadata extends Mixins(GlobalMixin) { }); } + const title = this.exif?.["Title"]; const desc = this.exif?.["Description"]; - list.push({ - title: this.exif?.["Title"] || this.t("memories", "No title"), - subtitle: [desc || this.t("memories", "No description")], - icon: InfoIcon, - edit: () => globalThis.editExif(globalThis.currentViewerPhoto), - }); + if (title || desc) { + list.push({ + title: title || this.t("memories", "No title"), + subtitle: [desc || this.t("memories", "No description")], + icon: InfoIcon, + edit: () => globalThis.editExif(globalThis.currentViewerPhoto), + }); + } if (this.address) { list.push({ diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 61a38014..002fcfd3 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -79,7 +79,7 @@ import AddToAlbumModal from "./modal/AddToAlbumModal.vue"; import StarIcon from "vue-material-design-icons/Star.vue"; import DownloadIcon from "vue-material-design-icons/Download.vue"; import DeleteIcon from "vue-material-design-icons/TrashCanOutline.vue"; -import EditIcon from "vue-material-design-icons/Pencil.vue"; +import EditFileIcon from "vue-material-design-icons/FileEdit.vue"; import EditClockIcon from "vue-material-design-icons/ClockEdit.vue"; import ArchiveIcon from "vue-material-design-icons/PackageDown.vue"; import UnarchiveIcon from "vue-material-design-icons/PackageUp.vue"; @@ -188,7 +188,7 @@ export default class SelectionManager extends Mixins(GlobalMixin, UserConfig) { }, { name: t("memories", "Edit EXIF Data"), - icon: EditIcon, + icon: EditFileIcon, callback: this.editExifSelection.bind(this), if: () => this.selection.size === 1, }, diff --git a/src/components/viewer/Viewer.vue b/src/components/viewer/Viewer.vue index 43d9f669..0a276e3e 100644 --- a/src/components/viewer/Viewer.vue +++ b/src/components/viewer/Viewer.vue @@ -121,6 +121,17 @@ + + {{ t("memories", "Edit EXIF Data") }} + + @@ -149,25 +160,23 @@