mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Various minor fixes
This commit is contained in:
@@ -21,18 +21,20 @@ struct OpenVideosView: View {
|
||||
.frame(minWidth: 600, maxWidth: 800, minHeight: 350, maxHeight: 500)
|
||||
#else
|
||||
NavigationView {
|
||||
openVideos
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button(action: { presentationMode.wrappedValue.dismiss() }) {
|
||||
Label("Close", systemImage: "xmark")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut(.cancelAction)
|
||||
#endif
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
openVideos
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button(action: { presentationMode.wrappedValue.dismiss() }) {
|
||||
Label("Close", systemImage: "xmark")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut(.cancelAction)
|
||||
#endif
|
||||
}
|
||||
.navigationTitle("Open Videos")
|
||||
}
|
||||
.navigationTitle("Open Videos")
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
|
@@ -226,12 +226,13 @@ struct VideoContextMenuView: View {
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
private var removeDocumentButton: some View {
|
||||
Button {
|
||||
@ViewBuilder private var removeDocumentButton: some View {
|
||||
let action = {
|
||||
if let url = video.localStream?.localURL {
|
||||
NavigationModel.shared.presentAlert(
|
||||
Alert(
|
||||
title: Text("Are you sure you want to remove this document?"),
|
||||
message: Text(String(format: "\"%@\" will be irreversibly removed from this device.", video.displayTitle)),
|
||||
primaryButton: .destructive(Text("Remove")) {
|
||||
do {
|
||||
try DocumentsModel.shared.removeDocument(url)
|
||||
@@ -243,9 +244,14 @@ struct VideoContextMenuView: View {
|
||||
)
|
||||
)
|
||||
}
|
||||
} label: {
|
||||
Label("Remove...", systemImage: "trash.fill")
|
||||
.foregroundColor(Color("AppRedColor"))
|
||||
}
|
||||
let label = Label("Remove...", systemImage: "trash.fill")
|
||||
.foregroundColor(Color("AppRedColor"))
|
||||
|
||||
if #available(iOS 15, macOS 12, *) {
|
||||
Button(role: .destructive, action: action) { label }
|
||||
} else {
|
||||
Button(action: action) { label }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user