From 06278879bc654a25f9fd3b8b8af5d5742d9a5674 Mon Sep 17 00:00:00 2001 From: Ethan Wong Date: Mon, 10 Jan 2022 08:16:42 +0800 Subject: [PATCH 1/3] Fix: bottom inset of TimelineTableView disappeared on macOS Monterey --- Mac/MainWindow/Timeline/TimelineViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 1467649e4..3e04feeb3 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -812,6 +812,12 @@ extension TimelineViewController: NSTableViewDataSource { } return ArticlePasteboardWriter(article: article) } + + func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat { + // Keeping -[NSTableViewDelegate tableView:heightOfRow:] implemented fixes + // an issue that the bottom inset of NSTableView disappears on macOS Monterey. + return tableView.rowHeight + } } // MARK: - NSTableViewDelegate From 08a2b5690e45230e8320be5e8f6fa9da4b8a86cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Fri, 21 Jan 2022 23:53:20 +0100 Subject: [PATCH 2/3] Remove leftover comment unrelated to any key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As it may seem very strange to some people that I'm creating a pull request to fix such a non-issue, here's the explanation: I'm working on a tool that reads Strings files (similar to https://github.com/Flinesoft/BartyCrouch) and my Strings file parser fails in my "real-world project tests" due to this comment. 😅 --- .../Resources/tr.lproj/Sparkle.strings | Bin 9246 -> 9138 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Mac/Resources/org.sparkle-project.InstallerLauncher.xpc/Contents/MacOS/Updater.app/Contents/Resources/tr.lproj/Sparkle.strings b/Mac/Resources/org.sparkle-project.InstallerLauncher.xpc/Contents/MacOS/Updater.app/Contents/Resources/tr.lproj/Sparkle.strings index 4def140e5a928b657fd13fd7aa009ba026f42493..d96bec90e0725dffe45f5721aff135ee44125fe2 100644 GIT binary patch delta 16 XcmbQ|vB`ad5!>WCj*QJL>=Lp7HPraWMb@U)=_O From b11db14017e5a6a7578229f46346b0f9b9882025 Mon Sep 17 00:00:00 2001 From: J-rg Date: Fri, 21 Jan 2022 23:19:28 +0100 Subject: [PATCH 3/3] Fix blurry sidebar symbols (#3268) --- Mac/AppAssets.swift | 12 ++++-------- Mac/MainWindow/IconView.swift | 3 +++ Mac/MainWindow/Sidebar/Cell/SidebarCell.swift | 11 +++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index 74c69df40..85b560fe7 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -159,8 +159,7 @@ struct AppAssets { if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "folder", accessibilityDescription: nil)! let preferredColor = NSColor(named: "AccentColor")! - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) } else { return IconImage(RSImage(named: NSImage.folderName)!) } @@ -255,8 +254,7 @@ struct AppAssets { if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! let preferredColor = NSColor(named: "StarColor")! - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) } else { return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isBackgroundSupressed: true) } @@ -278,8 +276,7 @@ struct AppAssets { if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "sun.max.fill", accessibilityDescription: nil)! let preferredColor = NSColor.orange - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) } else { return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isBackgroundSupressed: true) } @@ -289,8 +286,7 @@ struct AppAssets { if #available(macOS 11.0, *) { let image = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! let preferredColor = NSColor(named: "AccentColor")! - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) } else { return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isBackgroundSupressed: true) } diff --git a/Mac/MainWindow/IconView.swift b/Mac/MainWindow/IconView.swift index 43e4c8444..cc165d9de 100644 --- a/Mac/MainWindow/IconView.swift +++ b/Mac/MainWindow/IconView.swift @@ -14,6 +14,9 @@ final class IconView: NSView { didSet { if iconImage !== oldValue { imageView.image = iconImage?.image + if let tintColor = iconImage?.preferredColor { + imageView.contentTintColor = NSColor(cgColor: tintColor) + } if NSApplication.shared.effectiveAppearance.isDarkMode { if self.iconImage?.isDark ?? false { diff --git a/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift b/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift index ae0e2a12d..52b3804b4 100644 --- a/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift +++ b/Mac/MainWindow/Sidebar/Cell/SidebarCell.swift @@ -143,18 +143,17 @@ private extension SidebarCell { var updatedIconImage = iconImage if let iconImage = iconImage, iconImage.isSymbol { + var tintColor: CGColor if backgroundStyle != .normal { - let image = iconImage.image.tinted(with: .white) - updatedIconImage = IconImage(image, isSymbol: iconImage.isSymbol, isBackgroundSupressed: iconImage.isBackgroundSupressed) + tintColor = NSColor.white.cgColor } else { if let preferredColor = iconImage.preferredColor { - let image = iconImage.image.tinted(with: NSColor(cgColor: preferredColor)!) - updatedIconImage = IconImage(image, isSymbol: iconImage.isSymbol, isBackgroundSupressed: iconImage.isBackgroundSupressed) + tintColor = preferredColor } else { - let image = iconImage.image.tinted(with: .controlAccentColor) - updatedIconImage = IconImage(image, isSymbol: iconImage.isSymbol, isBackgroundSupressed: iconImage.isBackgroundSupressed) + tintColor = NSColor.controlAccentColor.cgColor } } + updatedIconImage = IconImage(iconImage.image, isSymbol: iconImage.isSymbol, isBackgroundSupressed: iconImage.isBackgroundSupressed, preferredColor: tintColor) } if let image = updatedIconImage {