|
|
@ -13,22 +13,21 @@ struct MasterSplitView: View { |
|
|
var body: some View { |
|
|
var body: some View { |
|
|
ZStack { |
|
|
ZStack { |
|
|
NavigationSplitView { |
|
|
NavigationSplitView { |
|
|
ZStack { |
|
|
|
|
|
|
|
|
Group { |
|
|
if model.isTagging { |
|
|
if model.isTagging { |
|
|
ScrollView { |
|
|
ScrollView { |
|
|
LazyVGrid(columns: [GridItem(.adaptive(minimum: 80))]) { |
|
|
LazyVGrid(columns: [GridItem(.adaptive(minimum: 80))]) { |
|
|
ForEach(model.items) { item in |
|
|
|
|
|
Text(item.name).font(.system(size: 16)).bold().padding(EdgeInsets(top: 10, leading: 6, bottom: 10, trailing: 6)) |
|
|
|
|
|
.background( |
|
|
|
|
|
RoundedRectangle(cornerRadius: 8) |
|
|
|
|
|
.fill(Color.gray.opacity(0.2)) |
|
|
|
|
|
|
|
|
ForEach(model.items) { |
|
|
|
|
|
item in |
|
|
|
|
|
Text(item.name).font(.system(size: 16)).bold().padding(EdgeInsets(top: 10, leading: 6, bottom: 10, trailing: 6)).background( |
|
|
|
|
|
RoundedRectangle(cornerRadius: 8).fill(Color.gray.opacity(0.2)) |
|
|
).draggable(item.name) |
|
|
).draggable(item.name) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
List(model.items, selection: $model.selectedItemId) { item in |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
List(model.items, selection: $model.selectedItemId) { |
|
|
|
|
|
item in |
|
|
Text(item.name).font(.title3).bold() |
|
|
Text(item.name).font(.title3).bold() |
|
|
}.id(UUID()) |
|
|
}.id(UUID()) |
|
|
} |
|
|
} |
|
|
@ -44,7 +43,9 @@ struct MasterSplitView: View { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
ToolbarItem(placement: .navigationBarTrailing) { |
|
|
ToolbarItem(placement: .navigationBarTrailing) { |
|
|
Button(action: { model.showSettings = true }, label: { |
|
|
|
|
|
|
|
|
Button(action: { |
|
|
|
|
|
model.showSettings = true |
|
|
|
|
|
}, label: { |
|
|
Image(systemName: "slider.horizontal.3") |
|
|
Image(systemName: "slider.horizontal.3") |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
@ -68,25 +69,33 @@ struct MasterSplitView: View { |
|
|
DetailView(model: model) |
|
|
DetailView(model: model) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if model.showWeb { |
|
|
|
|
|
KBrowserView(item: model.selectedDetail!.name, completionHandler: { model.showWeb = false }).background(.black) |
|
|
|
|
|
|
|
|
if model.showWeb, let selectedDetail = model.selectedDetail { |
|
|
|
|
|
KBrowserView(item: selectedDetail.name, completionHandler: { |
|
|
|
|
|
model.showWeb = false |
|
|
|
|
|
}).background(.black) |
|
|
} |
|
|
} |
|
|
if model.showVideo { |
|
|
if model.showVideo { |
|
|
SVideoPlayer(completionHandler: model.saveVideo, model: model.videoModel).background(.black) |
|
|
SVideoPlayer(completionHandler: model.saveVideo, model: model.videoModel).background(.black) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if model.showPhoto { |
|
|
if model.showPhoto { |
|
|
SPhotoAlbumView(completionHandler: { saved in |
|
|
|
|
|
|
|
|
SPhotoAlbumView(completionHandler: { |
|
|
|
|
|
saved in |
|
|
model.showPhoto = false |
|
|
model.showPhoto = false |
|
|
}, model: model.photoModel).background(.black) |
|
|
}, model: model.photoModel).background(.black) |
|
|
} |
|
|
} |
|
|
}.sheet(isPresented: $model.showFilePicker, onDismiss: { model.showFilePicker = false}) { |
|
|
|
|
|
DocPickerViewController(callback: model.pickURL, onDismiss: { model.showFilePicker = false }) |
|
|
|
|
|
} |
|
|
|
|
|
.sheet(isPresented: $model.showSettings, onDismiss: { model.showSettings = false}) { |
|
|
|
|
|
|
|
|
}.sheet(isPresented: $model.showFilePicker, onDismiss: { |
|
|
|
|
|
model.showFilePicker = false |
|
|
|
|
|
}) { |
|
|
|
|
|
DocPickerViewController(callback: model.pickURL, onDismiss: { |
|
|
|
|
|
model.showFilePicker = false |
|
|
|
|
|
}) |
|
|
|
|
|
}.sheet(isPresented: $model.showSettings, onDismiss: { |
|
|
|
|
|
model.showSettings = false |
|
|
|
|
|
}) { |
|
|
KSettingsView(kSettings: LocalManager.sharedInstance.settings, completionHandler: { |
|
|
KSettingsView(kSettings: LocalManager.sharedInstance.settings, completionHandler: { |
|
|
model.showSettings = false |
|
|
model.showSettings = false |
|
|
} ) |
|
|
|
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |