Merge pull request #2972 from j-f1/read-unread

Update swipe actions on macOS to match iOS
This commit is contained in:
Maurice Parker 2021-04-07 03:47:27 -05:00 committed by GitHub
commit b1a0b649a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 6 deletions

View File

@ -292,19 +292,41 @@ struct AppAssets {
}()
static var swipeMarkReadImage: RSImage = {
return RSImage(named: "swipeMarkRead")!
if #available(OSX 11.0, *) {
return RSImage(systemSymbolName: "circle", accessibilityDescription: "Mark Read")!
.withSymbolConfiguration(.init(scale: .large))!
} else {
// TODO: remove swipeMarkRead asset when dropping support for macOS 10.15
return RSImage(named: "swipeMarkRead")!
}
}()
static var swipeMarkUnreadImage: RSImage = {
return RSImage(named: "swipeMarkUnread")!
if #available(OSX 11.0, *) {
return RSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: "Mark Unread")!
.withSymbolConfiguration(.init(scale: .large))!
} else {
// TODO: remove swipeMarkUnread asset when dropping support for macOS 10.15
return RSImage(named: "swipeMarkUnread")!
}
}()
static var swipeMarkStarredImage: RSImage = {
return RSImage(named: "swipeMarkStarred")!
if #available(OSX 11.0, *) {
return RSImage(systemSymbolName: "star.fill", accessibilityDescription: "Star")!
.withSymbolConfiguration(.init(scale: .large))!
} else {
return RSImage(named: "swipeMarkStarred")!
}
}()
static var swipeMarkUnstarredImage: RSImage = {
return RSImage(named: "swipeMarkUnstarred")!
if #available(OSX 11.0, *) {
return RSImage(systemSymbolName: "star", accessibilityDescription: "Unstar")!
.withSymbolConfiguration(.init(scale: .large))!
} else {
return RSImage(named: "swipeMarkUnstarred")!
}
}()
static var starColor: NSColor = {

View File

@ -941,7 +941,7 @@ extension TimelineViewController: NSTableViewDelegate {
switch edge {
case .leading:
let action = NSTableViewRowAction(style: .regular, title: "") { (action, row) in
let action = NSTableViewRowAction(style: .regular, title: article.status.read ? "Unread" : "Read") { (action, row) in
self.toggleArticleRead(article);
tableView.rowActionsVisible = false
}
@ -949,7 +949,7 @@ extension TimelineViewController: NSTableViewDelegate {
return [action]
case .trailing:
let action = NSTableViewRowAction(style: .regular, title: "") { (action, row) in
let action = NSTableViewRowAction(style: .regular, title: article.status.starred ? "Unstar" : "Star") { (action, row) in
self.toggleArticleStarred(article);
tableView.rowActionsVisible = false
}