mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 05:53:41 +00:00
Add close button to open videos view on Mac
This commit is contained in:
parent
bd08cf02ad
commit
0f8c82bbca
@ -26,12 +26,7 @@ struct OpenVideosView: View {
|
|||||||
}
|
}
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .navigationBarLeading) {
|
ToolbarItem(placement: .navigationBarLeading) {
|
||||||
Button(action: { presentationMode.wrappedValue.dismiss() }) {
|
closeButton
|
||||||
Label("Close", systemImage: "xmark")
|
|
||||||
}
|
|
||||||
#if !os(tvOS)
|
|
||||||
.keyboardShortcut(.cancelAction)
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("Open Videos")
|
.navigationTitle("Open Videos")
|
||||||
@ -42,8 +37,24 @@ struct OpenVideosView: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var closeButton: some View {
|
||||||
|
Button(action: { presentationMode.wrappedValue.dismiss() }) {
|
||||||
|
Label("Close", systemImage: "xmark")
|
||||||
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.labelStyle(.titleOnly)
|
||||||
|
#endif
|
||||||
|
#if !os(tvOS)
|
||||||
|
.keyboardShortcut(.cancelAction)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
var openVideos: some View {
|
var openVideos: some View {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
#if os(macOS)
|
||||||
|
closeButton
|
||||||
|
#endif
|
||||||
|
|
||||||
ZStack(alignment: .topLeading) {
|
ZStack(alignment: .topLeading) {
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
TextField("URL to Open", text: $urlsToOpenText)
|
TextField("URL to Open", text: $urlsToOpenText)
|
||||||
|
Loading…
Reference in New Issue
Block a user