74 lines
2.7 KiB
Swift
74 lines
2.7 KiB
Swift
import SwiftUI
|
|
|
|
struct PageSettingsDetailView: View {
|
|
|
|
@Environment(\.language)
|
|
private var language
|
|
|
|
@EnvironmentObject
|
|
private var content: Content
|
|
|
|
var body: some View {
|
|
ScrollView {
|
|
VStack(alignment: .leading) {
|
|
DetailTitle(
|
|
title: "Page Settings",
|
|
text: "Change the way pages are displayed")
|
|
|
|
IntegerPropertyView(
|
|
title: "Content Width",
|
|
value: $content.settings.pages.contentWidth,
|
|
footer: "The maximum width of the content in pages (in pixels)")
|
|
|
|
IntegerPropertyView(
|
|
title: "Fullscreen Image Width",
|
|
value: $content.settings.pages.largeImageWidth,
|
|
footer: "The maximum width of images that are diplayed fullscreen")
|
|
|
|
IntegerPropertyView(
|
|
title: "Page Link Image Width",
|
|
value: $content.settings.pages.pageLinkImageSize,
|
|
footer: "The maximum width of images diplayed as thumbnails on page links")
|
|
|
|
FilePropertyView(
|
|
title: "Default CSS File",
|
|
footer: "The CSS file containing the styling of all pages",
|
|
selectedFile: $content.settings.pages.defaultCssFile,
|
|
allowedType: .text)
|
|
|
|
FilePropertyView(
|
|
title: "Code Highlighting File",
|
|
footer: "The JavaScript file to provide syntax highlighting of code blocks",
|
|
selectedFile: $content.settings.pages.codeHighlightingJsFile,
|
|
allowedType: .text)
|
|
|
|
FilePropertyView(
|
|
title: "Audio Player CSS File",
|
|
footer: "The CSS file to provide the style for the audio player",
|
|
selectedFile: $content.settings.pages.audioPlayerCssFile,
|
|
allowedType: .text)
|
|
|
|
FilePropertyView(
|
|
title: "Audio Player JavaScript File",
|
|
footer: "The CSS file to provide the functionality for the audio player",
|
|
selectedFile: $content.settings.pages.audioPlayerJsFile,
|
|
allowedType: .text)
|
|
|
|
FilePropertyView(
|
|
title: "3D Model Viewer File",
|
|
footer: "The JavaScript file to provide the functionality for the 3D model viewer",
|
|
selectedFile: $content.settings.pages.modelViewerJsFile,
|
|
allowedType: .text)
|
|
}
|
|
.padding()
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#Preview {
|
|
PageSettingsDetailView()
|
|
.environmentObject(Content.mock)
|
|
.padding()
|
|
}
|