From 2ed9f5d0342a07e4eeab96139a1434d1fd204ffa Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Fri, 13 Dec 2024 11:01:46 +0100 Subject: [PATCH] Use nicer icons (#2426) --- deltachat-ios/Controller/FilesViewController.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/deltachat-ios/Controller/FilesViewController.swift b/deltachat-ios/Controller/FilesViewController.swift index 37090e67f..d9626b4a9 100644 --- a/deltachat-ios/Controller/FilesViewController.swift +++ b/deltachat-ios/Controller/FilesViewController.swift @@ -242,7 +242,7 @@ extension FilesViewController: UITableViewDelegate, UITableViewDataSource { children.append( UIAction.menuAction( localizationKey: "remove_from_homescreen", - systemImageName: "square.and.arrow.up", + systemImageName: "rectangle.on.rectangle.slash", indexPath: indexPath, action: { _ in self.removeFromHomescreen(messageId: messageId) @@ -252,7 +252,7 @@ extension FilesViewController: UITableViewDelegate, UITableViewDataSource { children.append( UIAction.menuAction( localizationKey: "add_to_home_screen", - systemImageName: "square.and.arrow.up", + systemImageName: "plus.rectangle.on.rectangle", indexPath: indexPath, action: { _ in self.addToHomescreen(messageId: messageId) @@ -325,26 +325,24 @@ extension FilesViewController { } } + @available(iOS 15, *) func addToHomescreen(messageId: Int) { let entry = WidgetEntry(accountId: dcContext.id, messageId: messageId) var entries = dcContext.shownWidgets() entries.insert(entry, at: entries.startIndex) dcContext.storeShownWidgets(entries) - if #available(iOS 15.0, *) { - WidgetCenter.shared.reloadTimelines(ofKind: "DcWebxdcWidget") - } + WidgetCenter.shared.reloadTimelines(ofKind: "DcWebxdcWidget") } + @available(iOS 15, *) func removeFromHomescreen(messageId: Int) { let entry = WidgetEntry(accountId: dcContext.id, messageId: messageId) var entries = dcContext.shownWidgets() entries.removeAll { $0 == entry } dcContext.storeShownWidgets(entries) - if #available(iOS 15.0, *) { - WidgetCenter.shared.reloadTimelines(ofKind: "DcWebxdcWidget") - } + WidgetCenter.shared.reloadTimelines(ofKind: "DcWebxdcWidget") } }