From de5cce835157bf3299a9e81eb245974d3ff531c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Lo=CC=81pez=20Brante?= Date: Tue, 21 Jun 2022 22:17:03 -0400 Subject: [PATCH] [About Dialog] Switched to WebView for credits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kevin LoĢpez Brante --- Window/AboutWindowController.swift | 15 ++++---- Window/AboutWindowController.xib | 41 +++++----------------- en.lproj/Credits.html | 55 +++++++++++++++++++++++------- 3 files changed, 57 insertions(+), 54 deletions(-) diff --git a/Window/AboutWindowController.swift b/Window/AboutWindowController.swift index 6d9dc7605..443b16dde 100644 --- a/Window/AboutWindowController.swift +++ b/Window/AboutWindowController.swift @@ -6,6 +6,7 @@ // import Cocoa +import WebKit class AboutWindowController: NSWindowController { @@ -13,7 +14,7 @@ class AboutWindowController: NSWindowController { @IBOutlet weak var appVersion: NSTextField! @IBOutlet weak var appCopyright: NSTextField! - @IBOutlet var creditsView: NSTextView! + @IBOutlet weak var creditsView: WKWebView! override var windowNibName: NSNib.Name? { return "AboutWindowController" @@ -26,12 +27,9 @@ class AboutWindowController: NSWindowController { self.window?.center() self.window?.isMovableByWindowBackground = true - - vfxView.wantsLayer = true - vfxView.canDrawSubviewsIntoLayer = true - vfxView.layer?.cornerRadius = 10.0 - vfxView.layer?.masksToBounds = true + creditsView.setValue(false, forKey: "drawsBackground") + // fill up labels @@ -47,9 +45,8 @@ class AboutWindowController: NSWindowController { if let creditsFile = Bundle.main.url(forResource: "Credits", withExtension: "html") { let data = try! Data(contentsOf: creditsFile) - if let attributedString = try? NSAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) { - creditsView.textStorage?.setAttributedString(attributedString) - } + creditsView.loadHTMLString(String(data: data, encoding: .utf8) ?? "Could not load credits.", baseURL: nil) + } } diff --git a/Window/AboutWindowController.xib b/Window/AboutWindowController.xib index 300afadba..8610f2369 100644 --- a/Window/AboutWindowController.xib +++ b/Window/AboutWindowController.xib @@ -3,6 +3,7 @@ + @@ -11,7 +12,7 @@ - + @@ -39,39 +40,15 @@ - + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - diff --git a/en.lproj/Credits.html b/en.lproj/Credits.html index dda2f8d99..3858b281e 100644 --- a/en.lproj/Credits.html +++ b/en.lproj/Credits.html @@ -1,15 +1,44 @@ + - - Now with 92% more future! -

- This program has been made possible through contributions from users like you. -

- All Cog code is copyrighted by me, and is licensed under the GPL. Cog contains bits of other code from third parties that are under their own licenses. -

- Sample rate converter designed by Aleksey Vaneev of Voxengo. -

- Thanks to my patrons: -
- Alexander Pecheny, Electric Keet, Antti Aro, Fjölnir Ásgeirsson, Giampaolo Bellavite, Louis Martinez V, alga - + + + + SpoGen web view + + + +
+ Now with 92% more future! +

+ This program has been made possible through contributions from users like you. +

+ All Cog code is copyrighted by me, and is licensed under the GPL. Cog contains bits of other code from third parties that are under their own licenses. +

+ Sample rate converter designed by Aleksey Vaneev of Voxengo. +

+ Thanks to my patrons: +
+ Alexander Pecheny, Electric Keet, Antti Aro, Fjölnir Ásgeirsson, Giampaolo Bellavite, Louis Martinez V, alga +
+