From 739392cf9e34e0a88dffc83ca6e2f434785f9e2b Mon Sep 17 00:00:00 2001 From: Barijaona Ramaholimihaso Date: Sun, 2 Jul 2023 21:18:26 +0300 Subject: [PATCH] Improve drag & drop, copy & paste pasteboard To avoid having default font Times New Roman in Mail.app, I specify style "font-family:sans-serif" in template. Remove markup in type string pasteboard items. --- Vienna/Sources/Main window/ArticleListView.m | 8 +++++--- Vienna/Sources/Main window/UnifiedDisplayView.m | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Vienna/Sources/Main window/ArticleListView.m b/Vienna/Sources/Main window/ArticleListView.m index 1041b3e0ef..24cbedec8e 100644 --- a/Vienna/Sources/Main window/ArticleListView.m +++ b/Vienna/Sources/Main window/ArticleListView.m @@ -1483,7 +1483,8 @@ -(BOOL)copyTableSelection:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *) } // Open the HTML string - [fullHTMLText appendString:@""]; + [fullHTMLText appendString:@"" + ""]; // Get all the articles that are being dragged NSUInteger msgIndex = rowIndexes.firstIndex; @@ -1507,10 +1508,11 @@ -(BOOL)copyTableSelection:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *) [arrayOfArticles addObject:articleDict]; // Plain text - [fullPlainText appendFormat:@"%@\n%@\n\n", msgTitle, msgText]; + [fullPlainText appendFormat:@"%@\n%@\n\n", msgTitle, thisArticle.summary]; // Add HTML version too. - [fullHTMLText appendFormat:@"%@
%@

", msgLink, msgTitle, msgText]; + [fullHTMLText appendFormat:@"
%@
" + "
%@

", msgLink, msgTitle, msgText]; if (count == 1) { [pboard setString:msgLink forType:NSPasteboardTypeURL]; diff --git a/Vienna/Sources/Main window/UnifiedDisplayView.m b/Vienna/Sources/Main window/UnifiedDisplayView.m index f0f3dbab21..c2a63f889a 100644 --- a/Vienna/Sources/Main window/UnifiedDisplayView.m +++ b/Vienna/Sources/Main window/UnifiedDisplayView.m @@ -604,7 +604,8 @@ -(BOOL)copyIndexesSelection:(NSIndexSet*)rowIndexes toPasteboard:(NSPasteboard * } // Open the HTML string - [fullHTMLText appendString:@""]; + [fullHTMLText appendString:@"" + ""]; // Get all the articles that are being dragged NSUInteger msgIndex = rowIndexes.firstIndex; @@ -628,10 +629,11 @@ -(BOOL)copyIndexesSelection:(NSIndexSet*)rowIndexes toPasteboard:(NSPasteboard * [arrayOfArticles addObject:articleDict]; // Plain text - [fullPlainText appendFormat:@"%@\n%@\n\n", msgTitle, msgText]; + [fullPlainText appendFormat:@"%@\n%@\n\n", msgTitle, thisArticle.summary]; // Add HTML version too. - [fullHTMLText appendFormat:@"%@
%@

", msgLink, msgTitle, msgText]; + [fullHTMLText appendFormat:@"
%@
" + "
%@

", msgLink, msgTitle, msgText]; if (count == 1) { [pboard setString:msgLink forType:NSPasteboardTypeURL];