Skip to content

Commit 832f6fd

Browse files
authored
Redesigned About Window (#1000)
* Redesigned ackview, small fixes to aboutview Signed-off-by: Wouter01 <wouterhennen@gmail.com> * Redesigned about window Signed-off-by: Wouter01 <wouterhennen@gmail.com> * linter fix Signed-off-by: Wouter01 <wouterhennen@gmail.com> * improvements to design Signed-off-by: Wouter01 <wouterhennen@gmail.com> * Small tweaks Signed-off-by: Wouter01 <wouterhennen@gmail.com> * tweaks Signed-off-by: Wouter01 <wouterhennen@gmail.com> * decreased icon size Signed-off-by: Wouter01 <wouterhennen@gmail.com> * padding tweaks Signed-off-by: Wouter01 <wouterhennen@gmail.com> Signed-off-by: Wouter01 <wouterhennen@gmail.com>
1 parent 585dbb2 commit 832f6fd

5 files changed

Lines changed: 76 additions & 57 deletions

File tree

CodeEdit.xcodeproj/project.pbxproj

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@
314314
6C48D8F72972E5F300D6D205 /* WindowObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C48D8F62972E5F300D6D205 /* WindowObserver.swift */; };
315315
6C97EBCC2978760400302F95 /* AcknowledgementsWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C97EBCB2978760400302F95 /* AcknowledgementsWindowController.swift */; };
316316
6C97EBCF297876E500302F95 /* AboutWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C97EBCE297876E500302F95 /* AboutWindowController.swift */; };
317+
6CBD1BC62978DE53006639D5 /* Font+Caption3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBD1BC52978DE53006639D5 /* Font+Caption3.swift */; };
317318
6CDA84AD284C1BA000C1CC3A /* TabBarContextMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CDA84AC284C1BA000C1CC3A /* TabBarContextMenu.swift */; };
318319
B62617282964924E00E866AB /* CodeEditKit in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 2801BB89290D5A8E00EBF552 /* CodeEditKit */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
319320
B658FB3427DA9E1000EA4DBD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B658FB3327DA9E1000EA4DBD /* Assets.xcassets */; };
@@ -693,6 +694,7 @@
693694
6C48D8F62972E5F300D6D205 /* WindowObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowObserver.swift; sourceTree = "<group>"; };
694695
6C97EBCB2978760400302F95 /* AcknowledgementsWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AcknowledgementsWindowController.swift; sourceTree = "<group>"; };
695696
6C97EBCE297876E500302F95 /* AboutWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutWindowController.swift; sourceTree = "<group>"; };
697+
6CBD1BC52978DE53006639D5 /* Font+Caption3.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Font+Caption3.swift"; sourceTree = "<group>"; };
696698
6CDA84AC284C1BA000C1CC3A /* TabBarContextMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarContextMenu.swift; sourceTree = "<group>"; };
697699
B658FB2C27DA9E0F00EA4DBD /* CodeEdit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CodeEdit.app; sourceTree = BUILT_PRODUCTS_DIR; };
698700
B658FB3127DA9E0F00EA4DBD /* WorkspaceView.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = WorkspaceView.swift; sourceTree = "<group>"; tabWidth = 4; };
@@ -1842,6 +1844,7 @@
18421844
58D01C87293167DC00C5B6B4 /* Extensions */ = {
18431845
isa = PBXGroup;
18441846
children = (
1847+
6CBD1BC42978DE3E006639D5 /* Text */,
18451848
5831E3D02934036D00D5A6D2 /* NSTableView */,
18461849
5831E3CA2933E86F00D5A6D2 /* View */,
18471850
5831E3C72933E7F700D5A6D2 /* Bundle */,
@@ -2174,6 +2177,14 @@
21742177
path = Environment;
21752178
sourceTree = "<group>";
21762179
};
2180+
6CBD1BC42978DE3E006639D5 /* Text */ = {
2181+
isa = PBXGroup;
2182+
children = (
2183+
6CBD1BC52978DE53006639D5 /* Font+Caption3.swift */,
2184+
);
2185+
path = Text;
2186+
sourceTree = "<group>";
2187+
};
21772188
B658FB2327DA9E0F00EA4DBD = {
21782189
isa = PBXGroup;
21792190
children = (
@@ -2718,6 +2729,7 @@
27182729
58798264292EC4080085B254 /* Plugin.swift in Sources */,
27192730
587B9DA629300ABD00AC7927 /* ToolbarBranchPicker.swift in Sources */,
27202731
58F2EB05292FB2B0004A9BDE /* AppPreferencesModel.swift in Sources */,
2732+
6CBD1BC62978DE53006639D5 /* Font+Caption3.swift in Sources */,
27212733
58F2EAF1292FB2B0004A9BDE /* TerminalThemeView.swift in Sources */,
27222734
04C3254B27FF23B000C8DA2D /* ExtensionNavigatorData.swift in Sources */,
27232735
58798261292EC4080085B254 /* ExtensionsManager.swift in Sources */,
@@ -2950,7 +2962,7 @@
29502962
ENABLE_PREVIEWS = YES;
29512963
GENERATE_INFOPLIST_FILE = YES;
29522964
INFOPLIST_FILE = CodeEdit/Info.plist;
2953-
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2022-2023 CodeEdit";
2965+
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
29542966
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
29552967
LD_RUNPATH_SEARCH_PATHS = (
29562968
"$(inherited)",
@@ -3135,7 +3147,7 @@
31353147
ENABLE_PREVIEWS = YES;
31363148
GENERATE_INFOPLIST_FILE = YES;
31373149
INFOPLIST_FILE = CodeEdit/Info.plist;
3138-
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2022-2023 CodeEdit";
3150+
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
31393151
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
31403152
LD_RUNPATH_SEARCH_PATHS = (
31413153
"$(inherited)",
@@ -3453,7 +3465,7 @@
34533465
ENABLE_PREVIEWS = YES;
34543466
GENERATE_INFOPLIST_FILE = YES;
34553467
INFOPLIST_FILE = CodeEdit/Info.plist;
3456-
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2022-2023 CodeEdit";
3468+
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
34573469
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
34583470
LD_RUNPATH_SEARCH_PATHS = (
34593471
"$(inherited)",
@@ -3488,7 +3500,7 @@
34883500
ENABLE_PREVIEWS = YES;
34893501
GENERATE_INFOPLIST_FILE = YES;
34903502
INFOPLIST_FILE = CodeEdit/Info.plist;
3491-
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2022-2023 CodeEdit";
3503+
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
34923504
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
34933505
LD_RUNPATH_SEARCH_PATHS = (
34943506
"$(inherited)",

CodeEdit/Features/About/Views/AboutView.swift

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -24,68 +24,66 @@ public struct AboutView: View {
2424
Bundle.versionPostfix ?? ""
2525
}
2626

27-
public var body: some View {
28-
HStack(spacing: 0) {
29-
logo
30-
VStack(alignment: .leading, spacing: 0) {
31-
topMetaData
32-
Spacer()
33-
bottomMetaData
34-
actionButtons
35-
}
36-
.padding([.trailing, .vertical])
37-
}
38-
.background(.regularMaterial)
39-
.edgesIgnoringSafeArea(.top)
40-
}
27+
private static var licenseURL = URL(string: "https://github.com/CodeEditApp/CodeEdit/blob/main/LICENSE.md")!
4128

42-
// MARK: Sub-Views
29+
public var body: some View {
30+
VStack(spacing: 0) {
31+
Image(nsImage: NSApp.applicationIconImage)
32+
.resizable()
33+
.frame(width: 64, height: 64)
34+
.padding(.top, 9)
35+
.padding(.bottom, 10)
4336

44-
private var logo: some View {
45-
Image(nsImage: NSApp.applicationIconImage)
46-
.resizable()
47-
.frame(width: 128, height: 128)
48-
.padding(32)
49-
}
37+
Text("CodeEdit")
38+
.font(.title)
39+
.fontWeight(.bold)
5040

51-
private var topMetaData: some View {
52-
VStack(alignment: .leading, spacing: 5) {
53-
Text("CodeEdit").font(.system(size: 38, weight: .regular))
5441
Text("Version \(appVersion)\(appVersionPostfix) (\(appBuild))")
5542
.textSelection(.enabled)
5643
.foregroundColor(.secondary)
57-
.font(.system(size: 13, weight: .light))
58-
}
59-
}
44+
.font(.caption2)
45+
.padding(.vertical, 3)
6046

61-
private var bottomMetaData: some View {
62-
VStack(alignment: .leading, spacing: 5) {
63-
if let copyright = Bundle.copyrightString {
64-
Text(copyright)
65-
}
66-
Text("MIT License")
67-
}
68-
.foregroundColor(.secondary)
69-
.font(.system(size: 9, weight: .light))
70-
.padding(.bottom, 10)
71-
}
47+
VStack {
48+
Button {
49+
50+
} label: {
51+
Text("Contributors")
52+
.foregroundColor(.primary)
53+
.frame(maxWidth: .infinity)
54+
}
7255

73-
private var actionButtons: some View {
74-
HStack {
75-
Button {
76-
AcknowledgementsView().showWindow(width: 300, height: 400)
77-
} label: {
78-
Text("Acknowledgements")
79-
.foregroundColor(.primary)
56+
.controlSize(.large)
57+
58+
Button {
59+
AcknowledgementsView().showWindow(width: 300, height: 400)
60+
} label: {
61+
Text("Acknowledgements")
62+
.foregroundColor(.primary)
63+
.frame(maxWidth: .infinity)
64+
}
65+
.controlSize(.large)
8066
}
67+
.padding(.vertical)
8168

82-
Button {
83-
openURL(URL(string: "https://github.com/CodeEditApp/CodeEdit/blob/main/LICENSE.md")!)
84-
} label: {
85-
Text("License Agreement")
86-
.foregroundColor(.primary)
69+
Link(destination: Self.licenseURL) {
70+
Text("MIT License")
71+
.underline()
72+
.font(.caption3)
73+
.textSelection(.disabled)
74+
.foregroundColor(.secondary)
8775
}
76+
.padding(.vertical, 2)
77+
78+
Text(Bundle.copyrightString ?? "")
79+
.textSelection(.disabled)
80+
.foregroundColor(.secondary)
81+
.font(.caption3)
8882
}
83+
.padding([.horizontal, .bottom], 16)
84+
.frame(width: 280)
85+
.fixedSize()
86+
.background(.regularMaterial)
8987
}
9088

9189
public func showWindow(width: CGFloat, height: CGFloat) {

CodeEdit/Features/About/Views/AboutWindowController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ final class AboutViewWindowController: NSWindowController {
1313
// New window holding our SwiftUI view
1414
let window = NSWindow(contentViewController: hostingController)
1515
self.init(window: window)
16-
window.setContentSize(size)
1716
window.styleMask = [.closable, .fullSizeContentView, .titled, .nonactivatingPanel]
1817
window.standardWindowButton(.miniaturizeButton)?.isHidden = true
1918
window.standardWindowButton(.zoomButton)?.isHidden = true

CodeEdit/Info.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,5 @@
12661266
<string>https://github.com/CodeEditApp/CodeEdit/releases/download/latest/appcast.xml</string>
12671267
<key>SUPublicEDKey</key>
12681268
<string>/vAnxnK9wj4IqnUt6wS9EN3Ug69zHb+S/Pb9CyZuwa0=</string>
1269-
<key>CFBundleShortVersionString</key>
1270-
<string>0.0.1</string>
12711269
</dict>
12721270
</plist>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Font+Caption3.swift
3+
// CodeEdit
4+
//
5+
// Created by Wouter Hennen on 19/01/2023.
6+
//
7+
8+
import SwiftUI
9+
10+
extension Font {
11+
static var caption3: Font { .system(size: 11, weight: .medium) }
12+
}

0 commit comments

Comments
 (0)