Last active
August 28, 2022 21:18
-
-
Save knightbenax/6a719a8d83d82884e01fa9ca38f16dc7 to your computer and use it in GitHub Desktop.
Touchbar in SwiftUI for macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Home: View { | |
var body: some View { | |
VStack(){ | |
} | |
.focusable() | |
.touchBar{ | |
HStack(spacing: 5){ | |
Button(action: { zoomMinus() }) { | |
Image("minus.magnifyingglass").font(.system(size: 18, weight: .light)) | |
}.padding([.trailing, .leading], 5).buttonStyle(PlainButtonStyle()).tooltip("Zoom Out") | |
Button(action: { zoomReset() }) { | |
Image("1.magnifyingglass").font(.system(size: 18, weight: .light)) | |
}.padding([.trailing, .leading], 5).buttonStyle(PlainButtonStyle()).tooltip("Reset Zoom") | |
Button(action: { zoomPlus() }) { | |
Image("plus.magnifyingglass").font(.system(size: 18, weight: .light)) | |
}.padding([.trailing, .leading], 5).buttonStyle(PlainButtonStyle()).tooltip("Zoom In") | |
Button(action: { hideInfoSideBar() }) { | |
Image("doc.text").font(.system(size: 18, weight: .light)) | |
}.padding([.trailing, .leading], 5).buttonStyle(PlainButtonStyle()).tooltip("Show Image Details") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment