feat(mac): Added new about window

This commit is contained in:
Eli Schantz 2026-09-10 22:37:25 -04:00
parent be97f1e046
commit 8a206ccb21
5 changed files with 248 additions and 0 deletions

View file

@ -47,6 +47,11 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
3A589DC630539F2B00E2DD63 /* Resources */ = {
isa = PBXFileSystemSynchronizedRootGroup;
path = Resources;
sourceTree = "<group>";
};
D87D6F492FAF95400083A95E /* Installation */ = {
isa = PBXFileSystemSynchronizedRootGroup;
path = Installation;
@ -97,6 +102,7 @@
D88F03BD2F50ED5000C02A31 = {
isa = PBXGroup;
children = (
3A589DC630539F2B00E2DD63 /* Resources */,
D8F10B613048F12A00C1E597 /* Localizable.xcstrings */,
D87D6F492FAF95400083A95E /* Installation */,
D88F03C82F50ED5000C02A31 /* Config */,
@ -139,6 +145,7 @@
dependencies = (
);
fileSystemSynchronizedGroups = (
3A589DC630539F2B00E2DD63 /* Resources */,
D87D6F492FAF95400083A95E /* Installation */,
D88F03C82F50ED5000C02A31 /* Config */,
);

View file

@ -0,0 +1,56 @@
/*
* Keyman is copyright (C) SIL Global. MIT License.
*
* Created by Eli Schantz on 2026-07-23
*
* View shown when About Keyman Configuration is selected from the menu.
*/
import SwiftUI
import KeymanSettings
struct AboutPanelView: View {
var body: some View {
VStack(spacing: 20) {
HStack(alignment: .top, spacing: 28) {
Image(nsImage: NSApp.applicationIconImage)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 104, height: 104)
VStack(alignment: .leading, spacing: 6) {
Text("Keyman Configuration")
.font(.system(size: 32, weight: .semibold))
Text("Version \(ConfigAppUtil.configAppVersion())")
.font(.system(size: 13))
.foregroundStyle(.secondary)
Spacer(minLength: 14)
Text("Copyright © SIL Global")
.font(.system(size: 11))
.foregroundStyle(.secondary)
}
Spacer(minLength: 0)
}
HStack {
Spacer()
Button("License Agreement") {
if let url = Bundle.main.url(forResource: "keyman-for-mac-os-license", withExtension: "html") {
NSWorkspace.shared.open(url)
}
}
}
}
.padding(.top, 32)
.padding(.horizontal, 42)
.padding(.bottom, 20)
.frame(width: 570, height: 200)
}
}
#Preview {
AboutPanelView()
}

View file

@ -7,6 +7,7 @@
*/
import SwiftUI
import AppKit
import KeymanSettings
import OSLog
import Sentry
@ -61,6 +62,15 @@ struct ConfigApp: App {
}
.windowResizability(.contentSize)
.defaultSize(width: 600, height: 500)
.commands {
CommandGroup(replacing: .appInfo) {
Button {
AboutPanelPresenter.showAboutPanel()
} label: {
Label("About Keyman Configuration", systemImage: "info.circle")
}
}
}
// for testing purposes
// Window("Install Test", id: "install-debug") {
@ -69,3 +79,35 @@ struct ConfigApp: App {
// }
}
}
@MainActor
private enum AboutPanelPresenter {
private static var aboutWindow: NSWindow?
static func showAboutPanel() {
let contentView = AboutPanelView()
let window = aboutWindow ?? makeAboutWindow()
window.contentView = NSHostingView(rootView: contentView)
window.center()
window.makeKeyAndOrderFront(nil)
aboutWindow = window
NSApp.activate(ignoringOtherApps: true)
}
private static func makeAboutWindow() -> NSWindow {
let window = NSWindow(
contentRect: NSRect(x: 0, y: 0, width: 570, height: 200),
styleMask: [.titled, .closable],
backing: .buffered,
defer: false
)
window.titleVisibility = .hidden
window.titlebarAppearsTransparent = true
window.isReleasedWhenClosed = false
window.backgroundColor = .windowBackgroundColor
return window
}
}

View file

@ -1,6 +1,10 @@
{
"sourceLanguage" : "en",
"strings" : {
"About Keyman Configuration" : {
"comment" : "A label for the about panel.",
"isCommentAutoGenerated" : true
},
"Access has not been granted." : {
},
@ -30,6 +34,10 @@
},
"Copy link" : {
},
"Copyright © SIL Global" : {
"comment" : "A copyright notice.",
"isCommentAutoGenerated" : true
},
"Copyright:" : {
@ -78,6 +86,14 @@
},
"Keyboards" : {
},
"Keyman Configuration" : {
"comment" : "The name of the app.",
"isCommentAutoGenerated" : true
},
"License Agreement" : {
"comment" : "A button that opens a web page with the license agreement for Keyman for macOS.",
"isCommentAutoGenerated" : true
},
"Missing Keyman Components" : {
@ -129,6 +145,10 @@
},
"To use Keyman, enable the Keyman input method in System Settings." : {
},
"Version %@" : {
"comment" : "A description of the app, including its version and copyright.",
"isCommentAutoGenerated" : true
},
"Website:" : {

View file

@ -0,0 +1,123 @@
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 12 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:PMingLiU;
panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
{font-family:Mangal;
panose-1:2 4 5 3 5 2 3 3 2 2;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"\@PMingLiU";
panose-1:2 2 5 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-autospace:none;
font-size:12.0pt;
font-family:"Arial","sans-serif";}
h1
{mso-style-link:"Heading 1 Char";
margin:0cm;
margin-bottom:.0001pt;
text-autospace:none;
font-size:12.0pt;
font-family:"Arial","sans-serif";
font-weight:normal;}
h2
{mso-style-link:"Heading 2 Char";
margin:0cm;
margin-bottom:.0001pt;
text-autospace:none;
font-size:12.0pt;
font-family:"Arial","sans-serif";
font-weight:normal;}
.MsoChpDefault
{font-size:11.0pt;}
.MsoPapDefault
{margin-bottom:10.0pt;
line-height:115%;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
-->
</style>
</head>
<body lang=EN-AU style='text-justify-trim:punctuation'>
<div class=WordSection1>
<p class=MsoNormal style='margin-bottom:10.0pt'><b><span style='font-size:10.0pt;
color:black'>Keyman­® for macOS
End&nbsp;User&nbsp;Licence&nbsp;and&nbsp;Services&nbsp;Agreement</span></b></p>
<p>The MIT License</p>
<p>Copyright (c) 2017 SIL International</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<!--
<h1 style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:
1.0cm;text-indent:-1.0cm;page-break-after:avoid'><b><span style='font-size:
10.0pt;color:black'>3.       Support</span></b></h1>
<h2 style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:
1.0cm;text-indent:-1.0cm'><span style='font-size:10.0pt;color:black'>3.1     &quot;<b>SIL</b>
shall provide electronic support for <b>Keyman for Mac OS X </b>generally during
Australian Eastern Standard Time Business hours but do not warrant an immediate
response in all instances.&quot;</span></h2>
<h2 style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:
1.0cm;text-indent:-1.0cm'><span style='font-size:10.0pt;color:black'>3.2     For
current support contact details and installation instructions please visit
http://www.keyman.com/.</span></h2>
<h1 style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:
1.0cm;text-indent:-1.0cm;page-break-after:avoid'><b><span style='font-size:
10.0pt;color:black'>4.       Disclaimer and acknowledgments </span></b></h1>
<h2 style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:
1.0cm;text-indent:-1.0cm'><span style='font-size:10.0pt;color:black'>4.1     You
acknowledge that: the use of foreign languages is a complex area and <b>Keyman
for Mac OS X</b> is not designed as a substitute in any way for the assistance of a
skilled translator as to the correct meaning of any text you may create using <b>Keyman
for Mac OS X</b>;  Supplied with <b>Keyman for Mac OS X</b> are certain operating
instructions and a failure to follow these instructions carefully could result in
erroneous output being created by <b>Keyman for Mac OS X</b>; Whilst <b>Keyman
for Mac OS X</b> may be used by persons without a detailed knowledge of computers, <b>Keyman
for Mac OS X</b> is designed to be used by persons who are familiar with the
respective language implemented by each keyboard;  You should check all final
results created by <b>Keyman for Mac OS X</b> for any anomalies;  <b>Keyman for Mac OS X</b>
does not check for all anomalies and data incorrectly entered may be processed
without question.</span></h2>
-->
<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'>
<p class=MsoNormal style='margin-bottom:10.0pt;line-height:6.0pt;border:none;
padding:0cm'><span style='font-size:10.0pt;color:black;letter-spacing:-.25pt'>&nbsp;</span></p>
</div>
</div>
</body>
</html>