Skip to content

Commit 81d525e

Browse files
committed
fix(popup_icon): custom icon respect its aspect ratio
1 parent b09f3ef commit 81d525e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Shared/Controllers/UserNotificationController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class UserNotificationController: NSObject {
5656
/// Show to the user a control center notification that describe the notification object received.
5757
/// - Parameter notificationObject: the notification object that needs to be show.
5858
func showBanner(_ notificationObject: NotificationObject) {
59-
if let workflow = notificationObject.workflow, (workflow == .resetBanners || workflow == .resetAlerts) {
59+
if let workflow = notificationObject.workflow, workflow == .resetBanners || workflow == .resetAlerts {
6060
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
6161
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
6262
Utils.applicationExit(withReason: .untrackedSuccess)

Shared/Views/Components/Icon.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ struct Icon: View {
2323
if let image = icon {
2424
Image(nsImage: image)
2525
.resizable()
26+
.aspectRatio(contentMode: .fit)
2627
.frame(width: iconSize.width, height: iconSize.height)
2728
} else {
2829
Image("default_icon")
2930
.resizable()
31+
.aspectRatio(contentMode: .fit)
3032
.frame(width: iconSize.width, height: iconSize.height)
3133
}
3234
}

0 commit comments

Comments
 (0)