diff --git a/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift b/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift index 9432e7f8..d9ea66ae 100644 --- a/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift +++ b/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift @@ -66,7 +66,7 @@ struct PushNotificationsView: View { subscription.isReblogNotificationEnabled = newValue updateSubscription() })) { - Label("settings.push.boosts", systemImage: "arrow.left.arrow.right.circle") + Label("settings.push.boosts", image: "Rocket") } Toggle(isOn: .init(get: { subscription.isPollNotificationEnabled diff --git a/IceCubesApp/App/Tabs/Tabs.swift b/IceCubesApp/App/Tabs/Tabs.swift index de0275af..0b675324 100644 --- a/IceCubesApp/App/Tabs/Tabs.swift +++ b/IceCubesApp/App/Tabs/Tabs.swift @@ -3,6 +3,7 @@ import Explore import Foundation import Status import SwiftUI +import DesignSystem enum Tab: Int, Identifiable, Hashable { case timeline, notifications, mentions, explore, messages, settings, other diff --git a/IceCubesApp/Assets.xcassets/Rocket.Fill.symbolset/Contents.json b/IceCubesApp/Assets.xcassets/Rocket.Fill.symbolset/Contents.json new file mode 100644 index 00000000..0be2345c --- /dev/null +++ b/IceCubesApp/Assets.xcassets/Rocket.Fill.symbolset/Contents.json @@ -0,0 +1,15 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "symbol-rendering-intent" : "template" + }, + "symbols" : [ + { + "filename" : "rocket.fill.svg", + "idiom" : "universal" + } + ] +} diff --git a/IceCubesApp/Assets.xcassets/Rocket.Fill.symbolset/rocket.fill.svg b/IceCubesApp/Assets.xcassets/Rocket.Fill.symbolset/rocket.fill.svg new file mode 100644 index 00000000..e4d59071 --- /dev/null +++ b/IceCubesApp/Assets.xcassets/Rocket.Fill.symbolset/rocket.fill.svg @@ -0,0 +1,387 @@ + + + + + + + + + + + Weight/Scale Variations + Ultralight + Thin + Light + Regular + Medium + Semibold + Bold + Heavy + Black + + + + + + + + + + + Design Variations + Symbols are supported in up to nine weights and three scales. + For optimal layout with text and other symbols, vertically align + symbols with the adjacent text. + + + + + + Margins + Leading and trailing margins on the left and right side of each symbol + can be adjusted by modifying the x-location of the margin guidelines. + Modifications are automatically applied proportionally to all + scales and weights. + + + + Exporting + Symbols should be outlined when exporting to ensure the + design is preserved when submitting to Xcode. + Template v.4.0 + Requires Xcode 14 or greater + Generated from circle + Typeset at 100 points + Small + Medium + Large + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IceCubesApp/Assets.xcassets/Rocket.symbolset/Contents.json b/IceCubesApp/Assets.xcassets/Rocket.symbolset/Contents.json new file mode 100644 index 00000000..caacc842 --- /dev/null +++ b/IceCubesApp/Assets.xcassets/Rocket.symbolset/Contents.json @@ -0,0 +1,15 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "symbol-rendering-intent" : "template" + }, + "symbols" : [ + { + "filename" : "rocket.svg", + "idiom" : "universal" + } + ] +} diff --git a/IceCubesApp/Assets.xcassets/Rocket.symbolset/rocket.svg b/IceCubesApp/Assets.xcassets/Rocket.symbolset/rocket.svg new file mode 100644 index 00000000..c9fcf5e4 --- /dev/null +++ b/IceCubesApp/Assets.xcassets/Rocket.symbolset/rocket.svg @@ -0,0 +1,402 @@ + + + + + + + + + + + Weight/Scale Variations + Ultralight + Thin + Light + Regular + Medium + Semibold + Bold + Heavy + Black + + + + + + + + + + + Design Variations + Symbols are supported in up to nine weights and three scales. + For optimal layout with text and other symbols, vertically align + symbols with the adjacent text. + + + + + + Margins + Leading and trailing margins on the left and right side of each symbol + can be adjusted by modifying the x-location of the margin guidelines. + Modifications are automatically applied proportionally to all + scales and weights. + + + + Exporting + Symbols should be outlined when exporting to ensure the + design is preserved when submitting to Xcode. + Template v.4.0 + Requires Xcode 14 or greater + Generated from circle + Typeset at 100 points + Small + Medium + Large + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Packages/Account/Sources/Account/AccountDetailContextMenu.swift b/Packages/Account/Sources/Account/AccountDetailContextMenu.swift index efbd5eca..70fd6811 100644 --- a/Packages/Account/Sources/Account/AccountDetailContextMenu.swift +++ b/Packages/Account/Sources/Account/AccountDetailContextMenu.swift @@ -128,7 +128,7 @@ public struct AccountDetailContextMenu: View { } } } label: { - Label("account.action.reboosts-hide", systemImage: "arrow.left.arrow.right.circle.fill") + Label("account.action.reboosts-hide", image: "Rocket.Fill") } } else { Button { @@ -142,7 +142,7 @@ public struct AccountDetailContextMenu: View { } } } label: { - Label("account.action.reboosts-show", systemImage: "arrow.left.arrow.right.circle") + Label("account.action.reboosts-show", image: "Rocket") } } } diff --git a/Packages/Account/Sources/Account/Follow/FollowButton.swift b/Packages/Account/Sources/Account/Follow/FollowButton.swift index 9da0e249..ebcf680a 100644 --- a/Packages/Account/Sources/Account/Follow/FollowButton.swift +++ b/Packages/Account/Sources/Account/Follow/FollowButton.swift @@ -115,7 +115,7 @@ public struct FollowButton: View { await viewModel.toggleReboosts() } } label: { - Image(systemName: viewModel.relationship.showingReblogs ? "arrow.left.arrow.right.circle.fill" : "arrow.left.arrow.right.circle") + Image(viewModel.relationship.showingReblogs ? "Rocket.Fill" : "Rocket") } } } diff --git a/Packages/DesignSystem/Sources/DesignSystem/SFSymbols.swift b/Packages/DesignSystem/Sources/DesignSystem/SFSymbols.swift new file mode 100644 index 00000000..3e3f1050 --- /dev/null +++ b/Packages/DesignSystem/Sources/DesignSystem/SFSymbols.swift @@ -0,0 +1,21 @@ + + +import Foundation +import SwiftUI + +// Functions to cope with extending SF symbols +// images named in lower case are Apple's symbols +// images inamed in CamelCase are custom + +extension Label where Title == Text, Icon == Image { + + public init (_ title: LocalizedStringKey, imageNamed: String) { + if imageNamed.lowercased() == imageNamed { + self.init(title, systemImage: imageNamed) + } + else { + self.init(title, image: imageNamed) + } + } +} + diff --git a/Packages/Env/Sources/Env/StatusAction.swift b/Packages/Env/Sources/Env/StatusAction.swift index 0d851af2..bf8a54ed 100644 --- a/Packages/Env/Sources/Env/StatusAction.swift +++ b/Packages/Env/Sources/Env/StatusAction.swift @@ -38,10 +38,10 @@ public enum StatusAction: String, CaseIterable, Identifiable { return "quote.bubble" case .boost: if privateBoost { - return isReblogged ? "arrow.left.arrow.right.circle.fill" : "lock.rotation" + return isReblogged ? "Rocket.Fill" : "lock.rotation" } - return isReblogged ? "arrow.left.arrow.right.circle.fill" : "arrow.left.arrow.right.circle" + return isReblogged ? "Rocket.Fill" : "Rocket" case .favorite: return isFavorited ? "star.fill" : "star" case .bookmark: diff --git a/Packages/Notifications/Sources/Notifications/NotificationTypeExt.swift b/Packages/Notifications/Sources/Notifications/NotificationTypeExt.swift index 256d4d33..7f970257 100644 --- a/Packages/Notifications/Sources/Notifications/NotificationTypeExt.swift +++ b/Packages/Notifications/Sources/Notifications/NotificationTypeExt.swift @@ -55,7 +55,7 @@ extension Models.Notification.NotificationType { case .mention: return "at" case .reblog: - return "arrow.left.arrow.right.circle.fill" + return "Rocket.Fill" case .follow, .follow_request: return "person.fill.badge.plus" case .favourite: diff --git a/Packages/Status/Sources/Status/Row/Subviews/StatusRowActionsView.swift b/Packages/Status/Sources/Status/Row/Subviews/StatusRowActionsView.swift index 1350c8bf..c32ed4f9 100644 --- a/Packages/Status/Sources/Status/Row/Subviews/StatusRowActionsView.swift +++ b/Packages/Status/Sources/Status/Row/Subviews/StatusRowActionsView.swift @@ -28,22 +28,25 @@ struct StatusRowActionsView: View { [.respond, .boost, .favorite, .bookmark, .share] } - func iconName(dataController: StatusDataController, privateBoost: Bool = false) -> String { + func image(dataController: StatusDataController, privateBoost: Bool = false) -> Image { switch self { case .respond: - return "arrowshape.turn.up.left" + return Image(systemName: "arrowshape.turn.up.left") case .boost: if privateBoost { - return dataController.isReblogged ? "arrow.left.arrow.right.circle.fill" : "lock.rotation" + if dataController.isReblogged { + return Image("Rocket.Fill") + } else { + return Image(systemName: "lock.rotation") + } } - - return dataController.isReblogged ? "arrow.left.arrow.right.circle.fill" : "arrow.left.arrow.right.circle" + return Image(dataController.isReblogged ? "Rocket.Fill" : "Rocket") case .favorite: - return dataController.isFavorited ? "star.fill" : "star" + return Image(systemName: dataController.isFavorited ? "star.fill" : "star") case .bookmark: - return dataController.isBookmarked ? "bookmark.fill" : "bookmark" + return Image(systemName: dataController.isBookmarked ? "bookmark.fill" : "bookmark") case .share: - return "square.and.arrow.up" + return Image(systemName: "square.and.arrow.up") } } @@ -97,7 +100,7 @@ struct StatusRowActionsView: View { ShareLink(item: url, subject: Text(viewModel.status.reblog?.account.safeDisplayName ?? viewModel.status.account.safeDisplayName), message: Text(viewModel.status.reblog?.content.asRawText ?? viewModel.status.content.asRawText)) { - Image(systemName: action.iconName(dataController: statusDataController)) + action.image(dataController: statusDataController) } .buttonStyle(.statusAction()) } @@ -118,7 +121,7 @@ struct StatusRowActionsView: View { Button { handleAction(action: action) } label: { - Image(systemName: action.iconName(dataController: statusDataController, privateBoost: privateBoost())) + action.image(dataController: statusDataController, privateBoost: privateBoost()) } .buttonStyle( .statusAction( @@ -138,6 +141,7 @@ struct StatusRowActionsView: View { } } } + private func handleAction(action: Action) { Task { diff --git a/Packages/Status/Sources/Status/Row/Subviews/StatusRowContextMenu.swift b/Packages/Status/Sources/Status/Row/Subviews/StatusRowContextMenu.swift index 5e7953fd..5876d409 100644 --- a/Packages/Status/Sources/Status/Row/Subviews/StatusRowContextMenu.swift +++ b/Packages/Status/Sources/Status/Row/Subviews/StatusRowContextMenu.swift @@ -24,9 +24,9 @@ struct StatusRowContextMenu: View { } if self.statusDataController.isReblogged { - return Label("status.action.unboost", systemImage: "arrow.left.arrow.right.circle") + return Label("status.action.unboost", image: "Rocket") } - return Label("status.action.boost", systemImage: "arrow.left.arrow.right.circle") + return Label("status.action.boost", image: "Rocket") } var body: some View { diff --git a/Packages/Status/Sources/Status/Row/Subviews/StatusRowReblogView.swift b/Packages/Status/Sources/Status/Row/Subviews/StatusRowReblogView.swift index 95ac5d83..841764c8 100644 --- a/Packages/Status/Sources/Status/Row/Subviews/StatusRowReblogView.swift +++ b/Packages/Status/Sources/Status/Row/Subviews/StatusRowReblogView.swift @@ -7,7 +7,7 @@ struct StatusRowReblogView: View { var body: some View { if viewModel.status.reblog != nil { HStack(spacing: 2) { - Image(systemName: "arrow.left.arrow.right.circle.fill") + Image("Rocket.Fill") AvatarView(url: viewModel.status.account.avatar, size: .boost) EmojiTextApp(.init(stringValue: viewModel.status.account.safeDisplayName), emojis: viewModel.status.account.emojis) Text("status.row.was-boosted") diff --git a/Packages/Status/Sources/Status/Row/Subviews/StatusRowSwipeView.swift b/Packages/Status/Sources/Status/Row/Subviews/StatusRowSwipeView.swift index 57f3f7e1..21dfc484 100644 --- a/Packages/Status/Sources/Status/Row/Subviews/StatusRowSwipeView.swift +++ b/Packages/Status/Sources/Status/Row/Subviews/StatusRowSwipeView.swift @@ -108,7 +108,7 @@ struct StatusRowSwipeView: View { isFavorited: statusDataController.isFavorited, isBookmarked: statusDataController.isBookmarked, privateBoost: privateBoost), - systemImage: action.iconName(isReblogged: statusDataController.isReblogged, + imageNamed: action.iconName(isReblogged: statusDataController.isReblogged, isFavorited: statusDataController.isFavorited, isBookmarked: statusDataController.isBookmarked, privateBoost: privateBoost)) @@ -119,7 +119,7 @@ struct StatusRowSwipeView: View { isFavorited: statusDataController.isFavorited, isBookmarked: statusDataController.isBookmarked, privateBoost: privateBoost), - systemImage: action.iconName(isReblogged: statusDataController.isReblogged, + imageNamed: action.iconName(isReblogged: statusDataController.isReblogged, isFavorited: statusDataController.isFavorited, isBookmarked: statusDataController.isBookmarked, privateBoost: privateBoost))