From 28c8ff8a3beb5edf763c6a37864a4e6353e8c0b2 Mon Sep 17 00:00:00 2001 From: Clemens Ott Date: Mon, 17 May 2021 20:38:12 +0200 Subject: [PATCH] added save icon to attachments that are not of type image --- Signal-Windows/Controls/Attachment.xaml | 2 ++ Signal-Windows/Controls/Attachment.xaml.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Signal-Windows/Controls/Attachment.xaml b/Signal-Windows/Controls/Attachment.xaml index a764083..8359bd8 100644 --- a/Signal-Windows/Controls/Attachment.xaml +++ b/Signal-Windows/Controls/Attachment.xaml @@ -17,6 +17,8 @@ + diff --git a/Signal-Windows/Controls/Attachment.xaml.cs b/Signal-Windows/Controls/Attachment.xaml.cs index 97246ba..5438acf 100644 --- a/Signal-Windows/Controls/Attachment.xaml.cs +++ b/Signal-Windows/Controls/Attachment.xaml.cs @@ -71,14 +71,20 @@ private void Attachment_DataContextChanged(FrameworkElement sender, DataContextC AttachmentDownloadIcon.Visibility = Visibility.Collapsed; if (IMAGE_TYPES.Contains(Model.ContentType)) { + AttachmentSaveIcon.Visibility = Visibility.Collapsed; var path = ApplicationData.Current.LocalCacheFolder.Path + @"\Attachments\" + Model.Id + ".plain"; ImagePath = new Uri(path); } + else + { + AttachmentSaveIcon.Visibility = Visibility.Visible; + } } else if (Model.Status == SignalAttachmentStatus.Default || Model.Status == SignalAttachmentStatus.Finished || Model.Status == SignalAttachmentStatus.Failed) { AttachmentImage.Visibility = Visibility.Collapsed; AttachmentDownloadIcon.Visibility = Visibility.Visible; + AttachmentSaveIcon.Visibility = Visibility.Collapsed; } } } @@ -87,6 +93,10 @@ private void AttachmentDownloadIcon_Tapped(object sender, TappedRoutedEventArgs { App.Handle.StartAttachmentDownload(Model); } + private async void AttachmentSaveIcon_Tapped(object sender, TappedRoutedEventArgs e) + { + await App.Handle.ExportAttachment(Model); + } private void AttachmentImage_Tapped(object sender, TappedRoutedEventArgs e) {