Skip to content

Commit

Permalink
perf(UI): improve AboutTab layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed May 3, 2024
1 parent 3c64f8f commit 8bc9834
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Easydict/Swift/View/SettingView/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct SettingView: View {
case .privacy:
320
case .about:
250
300
default:
maxWidth * 0.82
}
Expand Down
25 changes: 11 additions & 14 deletions Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import SwiftUI
@objcMembers
class AboutTabWrapper: NSObject {
func makeNSView() -> NSView {
NSHostingView(rootView: AboutTab().frame(width: 500, height: 190))
NSHostingView(rootView: AboutTab().frame(width: 500, height: 250))
}
}

Expand All @@ -38,7 +38,7 @@ struct AboutTab: View {
// MARK: Internal

var body: some View {
HStack(alignment: .center, spacing: 20) {
HStack(alignment: .center, spacing: 30) {
Image(.logo)
.resizable()
.frame(width: 100, height: 100)
Expand All @@ -48,42 +48,39 @@ struct AboutTab: View {
VStack(alignment: .leading) {
VStack(alignment: .leading) {
Text(appName)
.font(.system(size: 26, weight: .semibold))
Spacer()
.frame(height: 3)
.font(.system(size: 35, weight: .medium))
.padding(.top, 25)
.padding(.bottom, 3)

Text("current_version \(version)")
.font(.system(size: 14))
.font(.system(size: 13))
.foregroundColor(.gray)

Spacer()

.frame(height: 20)
Text(copyrightInfo)
.font(.system(size: 11))
.foregroundColor(.gray)
.padding(.top, 25)
.padding(.bottom, 20)
}
.padding(.vertical, 3)

HStack {
HStack(spacing: 15) {
Button {
NSWorkspace.shared.open(URL(string: "https://github.com/tisfeng/Easydict")!)
} label: {
Label("github_link", systemImage: "star.fill")
.frame(width: 120)
.frame(width: 120, height: 20)
}

Button {
NSWorkspace.shared
.open(URL(string: "https://github.com/tisfeng/Easydict/graphs/contributors")!)
} label: {
Label("contributor_link", systemImage: "person.3.sequence.fill")
.frame(width: 120)
.frame(width: 120, height: 20)
}
}
}
}
.padding(.top, 20)
.frame(maxWidth: .infinity)
}

Expand Down

0 comments on commit 8bc9834

Please sign in to comment.