Skip to content

Commit

Permalink
Merge pull request #14 from angristan/fix-dark-mode-cycle
Browse files Browse the repository at this point in the history
Fix ResourceType cycle buttons for dark mode on macOS 11+
  • Loading branch information
hmarr authored Aug 12, 2021
2 parents d3f7595 + 7982835 commit 3e74f20
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions Vitals/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,17 @@ struct ContentView: View {
// Extra rectangle to increase the size of the click target
Rectangle().frame(width: 14, height: 16, alignment: .center).opacity(0.0)

Image("chevron-left")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
if #available(macOS 11.0, *) {
Image(systemName: "chevron.left")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
} else {
Image("chevron-left")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
}
}
}.buttonStyle(BorderlessButtonStyle())
.frame(width: 14, height: 16, alignment: .center)
Expand All @@ -135,10 +142,17 @@ struct ContentView: View {
// Extra rectangle to increase the size of the click target
Rectangle().frame(width: 14, height: 16, alignment: .center).opacity(0.0)

Image("chevron-right")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
if #available(macOS 11.0, *) {
Image(systemName: "chevron.right")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
} else {
Image("chevron-right")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
}
}
}.buttonStyle(BorderlessButtonStyle())
.frame(width: 14, height: 16, alignment: .center)
Expand Down

0 comments on commit 3e74f20

Please sign in to comment.