SPB Git

Repository Public License

SettingsView.swift 27.7 KB 479 lines swift

1// ORIX Convert — App/Sources/Features/Settings/SettingsView.swift2// Description: The Settings scene: General, Performance, Privacy, Advanced, About. Every statement shown here is a3//              fact about this build (no network code, where files live, which components are bundled).4// Author: Simon-Pierre Boucher — contact@spboucher.ai5import AppKit6import ConvertCore7import EngineMedia8import SwiftUI910struct SettingsView: View {11    @Environment(AppModel.self) private var model12    @State private var tab = "general"1314    var body: some View {15        TabView(selection: $tab) {16            GeneralSettings().tabItem { Label(L("General"), systemImage: "gearshape") }.tag("general")17            PerformanceSettings().tabItem { Label(L("Performance"), systemImage: "speedometer") }.tag("performance")18            PrivacySettings().tabItem { Label(L("Privacy"), systemImage: "hand.raised") }.tag("privacy")19            AdvancedSettings().tabItem { Label(L("Advanced"), systemImage: "wrench.and.screwdriver") }.tag("advanced")20            AboutSettings().tabItem { Label(L("About"), systemImage: "info.circle") }.tag("about")21        }22        // The About pane lists every engine and every bundled component with its licence: it gets a taller window,23        // and its form scrolls (the licence rows are reachable whatever the screen height).24        .frame(width: 620, height: tab == "about" ? 760 : 520)25        .onAppear {26            if let wanted = model.launch.section?.split(separator: ":").dropFirst().first { tab = String(wanted) }27        }28    }29}3031private struct SettingsPage<Content: View>: View {32    @ViewBuilder var content: Content33    var body: some View {34        Form { content }.formStyle(.grouped).scrollContentBackground(.hidden).background(ORIX.Palette.canvas)35    }36}3738private struct GeneralSettings: View {39    @Environment(AppModel.self) private var model40    var body: some View {41        @Bindable var settings = model.settings42        SettingsPage {43            Section(L("Output")) {44                Picker(L("Save converted files"), selection: $settings.stored.outputMode) {45                    ForEach(OutputLocationMode.allCases) { Text($0.title).tag($0) }46                }47                if settings.stored.outputMode == .chosenFolder {48                    LabeledContent(L("Folder")) {49                        HStack {50                            Text(model.settings.outputFolder?.path ?? L("None chosen")).font(.callout).foregroundStyle(ORIX.Palette.textSecondary).lineLimit(1).truncationMode(.head)51                            Button(L("Choose…")) { chooseFolder() }52                        }53                    }54                }55                LabeledContent(L("Name template")) {56                    TextField(L("Name template"), text: $settings.stored.nameTemplate).labelsHidden().font(.body.monospaced()).frame(width: 220)57                }58                Text(L("Tokens: {name} {ext} {date} {counter} {counter:3} {width} {height}. Example: %@",59                       OutputNameTemplate.fileName(base: OutputNameTemplate.render(settings.stored.nameTemplate, OutputNameContext(name: L("holiday photo"), ext: "heic", counter: 1, width: 4032, height: 3024)), ext: "jpg")))60                    .font(.caption).foregroundStyle(ORIX.Palette.textSecondary)61                Picker(L("If the file already exists"), selection: $settings.stored.conflictPolicy) {62                    ForEach([ConflictPolicy.rename, .askUser, .skip, .replace], id: \.self) { Text($0.title).tag($0) }63                }64                Text(settings.stored.conflictPolicy.explanation + " " + L("Original files are never replaced unless you allow it for a batch."))65                    .font(.caption).foregroundStyle(ORIX.Palette.textSecondary)66            }67            Section(L("When a batch finishes")) {68                Toggle(L("Notify me if ORIX Convert is in the background"), isOn: $settings.stored.notifyWhenDone)69                Text(L("The notification is local. macOS asks for your permission the first time one is needed.")).font(.caption).foregroundStyle(ORIX.Palette.textSecondary)70                Toggle(L("Reveal the results in the Finder"), isOn: $settings.stored.revealWhenDone)71            }72            Section(L("Appearance")) {73                Picker(L("Appearance"), selection: $settings.stored.appearance) {74                    Text(L("Match System")).tag("system")75                    Text(L("Light")).tag("light")76                    Text(L("Dark")).tag("dark")77                }78                .pickerStyle(.segmented)79            }80        }81    }8283    private func chooseFolder() {84        let panel = NSOpenPanel()85        panel.canChooseFiles = false86        panel.canChooseDirectories = true87        panel.canCreateDirectories = true88        if panel.runModal() == .OK, let url = panel.url { model.settings.outputFolder = url }89    }90}9192private struct PerformanceSettings: View {93    @Environment(AppModel.self) private var model94    @State private var resources = SystemResourceMonitor().currentState()95    @State private var mediaLines: [String] = []9697    var body: some View {98        @Bindable var settings = model.settings99        let limits = settings.queueConfiguration.limits(for: resources)100        SettingsPage {101            Section(L("Concurrency")) {102                Stepper(value: $settings.stored.maxConcurrentJobs, in: 1...16) {103                    LabeledContent(L("Conversions at once"), value: Fmt.count(settings.stored.maxConcurrentJobs))104                }105                Stepper(value: $settings.stored.maxHeavyJobs, in: 1...max(1, settings.stored.maxConcurrentJobs)) {106                    LabeledContent(L("Heavy conversions at once"), value: Fmt.count(min(settings.stored.maxHeavyJobs, settings.stored.maxConcurrentJobs)))107                }108                Text(L("Heavy: video, office documents converted by a helper program, 3D models, and files of 1 GB or more. The default follows the number of performance cores of this Mac (%lld).", QueueConfiguration.defaultConcurrency()))109                    .font(.caption).foregroundStyle(ORIX.Palette.textSecondary)110            }111            Section(L("Power")) {112                Toggle(L("Halve the load in Low Power Mode"), isOn: $settings.stored.reduceInLowPowerMode)113                Toggle(L("Halve the load on battery"), isOn: $settings.stored.reduceOnBattery)114            }115            Section(L("Video encoders and decoders on this Mac")) {116                if mediaLines.isEmpty {117                    Text(L("Reading what this Mac offers…")).font(.callout).foregroundStyle(ORIX.Palette.textSecondary)118                } else {119                    ForEach(mediaLines, id: \.self) { line in120                        Label { Text(LE(line)).font(.callout).fixedSize(horizontal: false, vertical: true).textSelection(.enabled) } icon: {121                            Image(systemName: line.contains("encode: hardware") ? "cpu.fill" : (line.contains("encode") ? "cpu" : "play.rectangle")).foregroundStyle(ORIX.Palette.textSecondary)122                        }123                    }124                    Text(L("Read from VideoToolbox and from the bundled FFmpeg when this pane opens. “Hardware” means the Apple media engine of this Mac encodes; “software” means the processor does."))125                        .font(.caption).foregroundStyle(ORIX.Palette.textSecondary)126                }127            }128            Section(L("Right now")) {129                LabeledContent(L("Thermal state"), value: resources.thermal.title)130                LabeledContent(L("Low Power Mode"), value: resources.lowPowerMode ? L("On") : L("Off"))131                LabeledContent(L("Power source"), value: resources.onBattery ? L("Battery") : L("Power adapter"))132                LabeledContent(L("Limits in force"), value: L("%lld at once, %lld heavy", limits.total, limits.heavy))133                if let reason = limits.reason { Text(LE(reason)).font(.caption).foregroundStyle(ORIX.Palette.caution) }134                Text(L("Under serious thermal pressure the load is halved and one heavy conversion runs at a time; when the state is critical no new conversion starts. Conversions already running are never slowed down or suspended."))135                    .font(.caption).foregroundStyle(ORIX.Palette.textSecondary)136            }137        }138        .task {139            // Encoder discovery asks VideoToolbox and the bundled ffmpeg: off the main thread, once.140            if mediaLines.isEmpty { mediaLines = await Task.detached(priority: .utility) { MediaHardware.summaryLines() }.value }141        }142        .task {143            while !Task.isCancelled {144                resources = SystemResourceMonitor().currentState()145                try? await Task.sleep(for: .seconds(2))146            }147        }148    }149}150151extension ThermalLevel {152    var title: String {153        switch self {154        case .nominal: L("Normal")155        case .fair: L("Slightly elevated")156        case .serious: L("Serious")157        case .critical: L("Critical")158        }159    }160}161162private struct PrivacySettings: View {163    @Environment(AppModel.self) private var model164    @State private var confirmClear = false165    @State private var cleaned: String?166    @State private var tempSize: Int64?167168    var body: some View {169        @Bindable var settings = model.settings170        SettingsPage {171            Section(L("Facts")) {172                fact("network.slash", L("ORIX Convert contains no network code. Files never leave this Mac."))173                fact("person.crop.circle.badge.xmark", L("No account, no API key, no telemetry, no analytics."))174                fact("lock", L("Passwords typed for a conversion are used in memory for that conversion only. They are never written to the history, presets or logs."))175                fact("doc.badge.gearshape", L("File contents are never stored by the app: the history keeps paths, settings, sizes and results."))176            }177            Section(L("History")) {178                Toggle(L("Record conversions in the history"), isOn: $settings.stored.historyEnabled)179                LabeledContent(L("Database")) { pathText(AppPaths.historyDatabase) }180                Button(L("Clear History…")) { confirmClear = true }181            }182            Section(L("Temporary files")) {183                LabeledContent(L("Location")) { pathText(model.manager.workDirectories.root) }184                LabeledContent(L("Size now"), value: Fmt.bytes(tempSize))185                Text(L("Each conversion works in a private folder that is removed when it ends. Folders left by a crash are removed at the next launch."))186                    .font(.caption).foregroundStyle(ORIX.Palette.textSecondary)187                HStack {188                    Button(L("Clean Now")) { cleanTemporaryFiles() }.disabled(model.queue.hasUnfinishedWork)189                    if model.queue.hasUnfinishedWork { Text(L("Available when no conversion is running.")).font(.caption).foregroundStyle(ORIX.Palette.textSecondary) }190                    if let cleaned { Text(cleaned).font(.caption).foregroundStyle(ORIX.Palette.success) }191                }192            }193        }194        .task { tempSize = Self.directorySize(model.manager.workDirectories.root) }195        .confirmationDialog(L("Clear the whole history?"), isPresented: $confirmClear) {196            Button(L("Clear History"), role: .destructive) { model.history.clearAll() }197            Button(L("Cancel"), role: .cancel) {}198        } message: { Text(L("Converted files are not touched.")) }199    }200201    private func fact(_ symbol: String, _ text: String) -> some View {202        Label { Text(text).fixedSize(horizontal: false, vertical: true) } icon: { Image(systemName: symbol).foregroundStyle(ORIX.Palette.accent) }203    }204205    private func pathText(_ url: URL) -> some View {206        HStack(spacing: 4) {207            Text(url.path).font(.caption.monospaced()).foregroundStyle(ORIX.Palette.textSecondary).lineLimit(1).truncationMode(.head).textSelection(.enabled)208            Button { FileActions.reveal([FileActions.exists(url) ? url : url.deletingLastPathComponent()]) } label: { Image(systemName: "magnifyingglass") }209                .buttonStyle(.borderless).accessibilityLabel(L("Reveal in Finder"))210        }211    }212213    /// Removes every work folder; only offered while nothing is running.214    private func cleanTemporaryFiles() {215        let root = model.manager.workDirectories.root216        let before = Self.directorySize(root) ?? 0217        let children = (try? FileManager.default.contentsOfDirectory(at: root, includingPropertiesForKeys: nil)) ?? []218        for child in children { try? FileManager.default.removeItem(at: child) }219        tempSize = Self.directorySize(root)220        cleaned = L("%@ freed", Fmt.bytes(max(0, before - (tempSize ?? 0))))221    }222223    static func directorySize(_ url: URL) -> Int64? {224        guard let enumerator = FileManager.default.enumerator(at: url, includingPropertiesForKeys: [.fileSizeKey, .isRegularFileKey]) else { return 0 }225        var total: Int64 = 0226        for case let item as URL in enumerator {227            if let values = try? item.resourceValues(forKeys: [.fileSizeKey, .isRegularFileKey]), values.isRegularFile == true { total += Int64(values.fileSize ?? 0) }228        }229        return total230    }231}232233/// The command-line tool shipped in `Contents/Helpers`, and the command that links it into the PATH.234enum CommandLineTool {235    static var bundledURL: URL? {236        let url = Bundle.main.bundleURL.appendingPathComponent("Contents/Helpers/orix-convert")237        return FileManager.default.isExecutableFile(atPath: url.path) ? url : nil238    }239240    /// `sudo mkdir -p /usr/local/bin && sudo ln -sf '<tool>' /usr/local/bin/orix-convert`, the path quoted for the shell.241    static func installCommand(for tool: URL) -> String {242        let quoted = "'" + tool.path.replacingOccurrences(of: "'", with: "'\\''") + "'"243        return "sudo mkdir -p /usr/local/bin && sudo ln -sf \(quoted) /usr/local/bin/orix-convert"244    }245}246247private struct AdvancedSettings: View {248    @Environment(AppModel.self) private var model249    @State private var showCLI = false250    @State private var copiedCLI = false251252    /// Safety limits the engines expose as options (pixels, sizes, entries). Nothing is listed when none does.253    private var limitOptions: [(engine: String, option: OptionDescriptor)] {254        var seen = Set<String>()255        var found: [(String, OptionDescriptor)] = []256        for engine in model.registry.engines {257            for path in engine.paths {258                for option in engine.options(for: path) where option.id.split(separator: ".").contains(where: { $0 == "limit" || $0 == "limits" }) || option.id.hasPrefix("max.") || option.id.contains(".max") {259                    if seen.insert(engine.id + "|" + option.id).inserted { found.append((LE(engine.displayName), option)) }260                }261            }262        }263        return found.map { (engine: $0.0, option: $0.1) }264    }265266    var body: some View {267        @Bindable var settings = model.settings268        SettingsPage {269            Section(L("Command-line tool")) {270                if let tool = CommandLineTool.bundledURL {271                    Text(L("ORIX Convert includes “orix-convert”, the same engines for the Terminal and for scripts. The app installs nothing outside itself: to call it by name, create the link yourself with this command."))272                        .font(.callout).foregroundStyle(ORIX.Palette.textSecondary).fixedSize(horizontal: false, vertical: true)273                    DisclosureGroup(L("Install command-line tool…"), isExpanded: $showCLI) {274                        VStack(alignment: .leading, spacing: ORIX.Space.s) {275                            Text(CommandLineTool.installCommand(for: tool)).font(.caption.monospaced()).textSelection(.enabled).fixedSize(horizontal: false, vertical: true)276                                .padding(ORIX.Space.s).frame(maxWidth: .infinity, alignment: .leading)277                                .background(ORIX.Palette.hairline.opacity(0.5), in: RoundedRectangle(cornerRadius: 6))278                            HStack {279                                Button(copiedCLI ? L("Copied") : L("Copy Command")) {280                                    NSPasteboard.general.clearContents()281                                    NSPasteboard.general.setString(CommandLineTool.installCommand(for: tool), forType: .string)282                                    copiedCLI = true283                                }284                                Button(L("Reveal Tool in Finder")) { FileActions.reveal([tool]) }285                            }286                            Text(L("Paste it in Terminal; macOS asks for your password because /usr/local/bin belongs to the system. Then try: orix-convert --help. To remove the link: sudo rm /usr/local/bin/orix-convert"))287                                .font(.caption).foregroundStyle(ORIX.Palette.textSecondary).fixedSize(horizontal: false, vertical: true)288                        }289                    }290                } else {291                    Text(L("The command-line tool “orix-convert” is not included in this build.")).font(.callout).foregroundStyle(ORIX.Palette.textSecondary)292                }293            }294            Section(L("Logs")) {295                Toggle(L("Keep detailed job logs"), isOn: $settings.stored.keepJobLogs)296                Text(L("On: up to 2,000 lines per conversion, kept in memory until the job is cleared. Off: the last 50 lines. Logs are never written to disk."))297                    .font(.caption).foregroundStyle(ORIX.Palette.textSecondary)298            }299            Section(L("Safety limits")) {300                let limits = limitOptions301                if limits.isEmpty {302                    Text(L("The engines of this build enforce their safety limits (pixel counts, sizes, entries) internally and expose none as a setting."))303                        .font(.callout).foregroundStyle(ORIX.Palette.textSecondary)304                } else {305                    ForEach(limits, id: \.option.id) { entry in306                        LabeledContent(LE(entry.option.label), value: entry.engine + " · " + entry.option.defaultValue.plainText)307                    }308                    Text(L("These limits are set per conversion, in the options panel.")).font(.caption).foregroundStyle(ORIX.Palette.textSecondary)309                }310            }311            Section(L("Data folder")) {312                LabeledContent(L("Settings, presets, history")) {313                    Text(AppPaths.applicationSupport.path).font(.caption.monospaced()).foregroundStyle(ORIX.Palette.textSecondary).lineLimit(1).truncationMode(.head).textSelection(.enabled)314                }315                if let error = model.historyError { Text(error).font(.caption).foregroundStyle(ORIX.Palette.danger) }316            }317        }318    }319}320321/// A licence notice copied into the bundle from EmbeddedEngines/<name>/NOTICE.md.322struct LicenseNotice: Identifiable {323    let name: String324    let text: String325    var id: String { name }326    /// Version read from a "| Version | x |" row of the notice, when it has one.327    var version: String? {328        for line in text.split(separator: "\n") {329            let cells = line.split(separator: "|").map { $0.trimmingCharacters(in: .whitespaces) }330            if cells.count >= 2, cells[0].lowercased() == "version" { return cells[1] }331        }332        return nil333    }334335    /// Full licence texts shipped with the component: `Licenses/<name>/*`, and for LibreOffice the files it carries336    /// in its own bundle. Read on demand.337    var documents: [URL] = []338339    /// Largest licence text shown (LibreOffice's LICENSE is about 500 kB).340    static let maxDocumentBytes = 4 << 20341342    static func text(of document: URL) -> String {343        guard let size = (try? document.resourceValues(forKeys: [.fileSizeKey]))?.fileSize, size <= maxDocumentBytes, let data = try? Data(contentsOf: document) else {344            return L("This file is too large to show here. Reveal it in the Finder to read it.")345        }346        return String(data: data, encoding: .utf8) ?? String(decoding: data, as: UTF8.self)347    }348349    static func loadAll() -> [LicenseNotice] {350        let fm = FileManager.default351        guard let folder = Bundle.main.resourceURL?.appendingPathComponent("Licenses", isDirectory: true),352              let files = try? fm.contentsOfDirectory(at: folder, includingPropertiesForKeys: nil) else { return [] }353        return files.filter { $0.pathExtension == "md" }.sorted { $0.lastPathComponent < $1.lastPathComponent }.compactMap { url in354            guard let text = try? String(contentsOf: url, encoding: .utf8) else { return nil }355            var notice = LicenseNotice(name: url.deletingPathExtension().lastPathComponent, text: text)356            let own = (try? fm.contentsOfDirectory(at: url.deletingPathExtension(), includingPropertiesForKeys: nil)) ?? []357            notice.documents = own.filter { !$0.lastPathComponent.hasPrefix(".") }.sorted { $0.lastPathComponent < $1.lastPathComponent }358            if notice.name == "libreoffice", let office = BundledTools.url(for: "LibreOffice.app/Contents/MacOS/soffice") {359                let resources = office.deletingLastPathComponent().deletingLastPathComponent().appendingPathComponent("Resources")360                notice.documents += ["LICENSE", "NOTICE"].map { resources.appendingPathComponent($0) }.filter { fm.fileExists(atPath: $0.path) }361            }362            return notice363        }364    }365}366367private struct AboutSettings: View {368    @Environment(AppModel.self) private var model369    @State private var notices: [LicenseNotice] = []370    @State private var shown: LicenseNotice?371    /// The licence text shown in the sheet: `nil` for the notice itself.372    @State private var shownDocument: URL?373374    private var version: String {375        let info = Bundle.main.infoDictionary376        return L("Version %@ (%@)", info?["CFBundleShortVersionString"] as? String ?? "—", info?["CFBundleVersion"] as? String ?? "—")377    }378379    /// Helper tools found in the bundle or, for development builds, in the repository.380    private var tools: [(name: String, location: String)] {381        var seen = Set<String>()382        var found: [(String, String)] = []383        for directory in BundledTools.searchDirectories() {384            let inBundle = directory.path.hasPrefix(Bundle.main.bundlePath)385            for name in ((try? FileManager.default.contentsOfDirectory(atPath: directory.path)) ?? []).sorted() where !name.hasPrefix(".") {386                if seen.insert(name).inserted { found.append((name, inBundle ? L("In the app") : L("Development copy in the repository"))) }387            }388        }389        return found.map { (name: $0.0, location: $0.1) }390    }391392    var body: some View {393        let registry = model.registry394        ScrollViewReader { proxy in395        SettingsPage {396            Section {397                HStack(spacing: ORIX.Space.l) {398                    Image(nsImage: NSApp.applicationIconImage).resizable().frame(width: 64, height: 64).accessibilityHidden(true)399                    VStack(alignment: .leading, spacing: 3) {400                        Text("ORIX Convert").font(.title2.weight(.semibold))401                        Text(L("Every Format. One App.")).font(.callout).foregroundStyle(ORIX.Palette.textSecondary)402                        Text(version).font(.caption.monospacedDigit()).foregroundStyle(ORIX.Palette.textSecondary).textSelection(.enabled)403                        Text("© 2026 Simon-Pierre Boucher").font(.caption).foregroundStyle(ORIX.Palette.textTertiary)404                    }405                }406            }407            Section(L("Engines")) {408                ForEach(registry.engines, id: \.id) { engine in409                    let missing = registry.unavailableEngines.first { $0.id == engine.id }410                    LabeledContent(LE(engine.displayName)) {411                        Text(missing.map { L("Unavailable: %@", LE($0.reason)) } ?? L("Available · %lld paths", registry.paths(engine: engine.id).count))412                            .font(.callout).foregroundStyle(missing == nil ? ORIX.Palette.textSecondary : ORIX.Palette.caution)413                    }414                }415                let pending = EngineCatalog.knownPackages.filter { !EngineCatalog.wiredPackages.contains($0) }416                if !pending.isEmpty {417                    Text(L("Not part of this build: %@", pending.joined(separator: ", "))).font(.caption).foregroundStyle(ORIX.Palette.textTertiary)418                }419            }420            Section(L("Bundled components")) {421                Text(L("Each component is listed with its version and its licence. Scroll to see them all.")).font(.caption).foregroundStyle(ORIX.Palette.textTertiary).id("licences")422                if tools.isEmpty && notices.isEmpty { Text(L("No third-party component is bundled in this build.")).font(.callout).foregroundStyle(ORIX.Palette.textSecondary) }423                ForEach(tools, id: \.name) { tool in LabeledContent(tool.name, value: tool.location) }424                ForEach(notices) { notice in425                    LabeledContent(notice.name) {426                        HStack {427                            Text(notice.version.map { L("Version %@", $0) } ?? L("See the notice")).font(.callout).foregroundStyle(ORIX.Palette.textSecondary)428                                // A long version line (build identifiers) wraps instead of being cut or pushing the button away.429                                .lineLimit(3).multilineTextAlignment(.trailing).fixedSize(horizontal: false, vertical: true)430                            if !notice.documents.isEmpty { Text(notice.documents.count == 1 ? L("1 licence text") : L("%lld licence texts", notice.documents.count)).font(.caption).foregroundStyle(ORIX.Palette.textTertiary) }431                            Button(L("Licence…")) { shownDocument = nil; shown = notice }432                        }433                    }434                }435            }436            Section(L("Acknowledgements")) {437                Text(L("ORIX Convert is built on Apple frameworks (PDFKit, Core Graphics, ImageIO, Vision, AVFoundation) and on the open-source components listed above, each under its own licence. Thank you to their authors."))438                    .font(.callout).foregroundStyle(ORIX.Palette.textSecondary).fixedSize(horizontal: false, vertical: true)439            }440        }441        .onAppear {442            notices = LicenseNotice.loadAll()443            // `-ORIXSelect licences` (screenshots): show the licence rows at the top.444            if model.launch.select == "licences" {445                Task { try? await Task.sleep(for: .milliseconds(400)); proxy.scrollTo("licences", anchor: .top) }446            }447        }448        }449        .sheet(item: $shown) { notice in450            VStack(spacing: 0) {451                if !notice.documents.isEmpty {452                    HStack {453                        Picker(L("Document"), selection: $shownDocument) {454                            Text(L("Notice")).tag(URL?.none)455                            ForEach(notice.documents, id: \.self) { Text($0.lastPathComponent).tag(URL?.some($0)) }456                        }457                        .frame(maxWidth: 380)458                        Spacer()459                    }460                    .padding(.horizontal, ORIX.Space.l).padding(.vertical, ORIX.Space.s)461                    ORIX.Palette.hairline.frame(height: 1)462                }463                ScrollView {464                    Text(shownDocument.map { LicenseNotice.text(of: $0) } ?? notice.text).font(.caption.monospaced()).textSelection(.enabled)465                        .frame(maxWidth: .infinity, alignment: .leading).padding(ORIX.Space.l)466                }467                ORIX.Palette.hairline.frame(height: 1)468                HStack {469                    Text(notice.name).font(.headline)470                    Spacer()471                    if let document = shownDocument { Button(L("Reveal in Finder")) { FileActions.reveal([document]) } }472                    Button(L("Done")) { shown = nil }.keyboardShortcut(.defaultAction)473                }.padding(ORIX.Space.l)474            }475            .frame(width: 680, height: 520)476        }477    }478}479
Files main
Menu

Theme