Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: button on About cannot be clicked #751

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@
C490BF722BE910B70021E40A /* AdvancedTabItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C490BF712BE910B70021E40A /* AdvancedTabItemView.swift */; };
C4A512BE2C414A2400F00F33 /* AIToolService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4A512BD2C414A2400F00F33 /* AIToolService.swift */; };
C4BE8E1C2C72E61B00F53204 /* LaunchAtLogin in Frameworks */ = {isa = PBXBuildFile; productRef = C4BE8E1B2C72E61B00F53204 /* LaunchAtLogin */; };
C4BFDD7A2BE61F550094026B /* Vortex in Frameworks */ = {isa = PBXBuildFile; productRef = C4BFDD792BE61F550094026B /* Vortex */; };
C4CCDAA32C407A0D00AC88BA /* SummaryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4CCDAA22C407A0D00AC88BA /* SummaryService.swift */; };
C4CCDAA52C407A4100AC88BA /* PolishingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4CCDAA42C407A4100AC88BA /* PolishingService.swift */; };
C4DD01E92B12B3C80025EE8E /* TencentService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4DD01E82B12B3C80025EE8E /* TencentService.swift */; };
Expand Down Expand Up @@ -904,7 +903,6 @@
files = (
0AC8A84F2B6DFDD4006DA5CC /* SettingsAccess in Frameworks */,
03022F192B3591AE00B63209 /* GoogleGenerativeAI in Frameworks */,
C4BFDD7A2BE61F550094026B /* Vortex in Frameworks */,
2721E4D02AFE920700A059AC /* Alamofire in Frameworks */,
038030952B4106800009230C /* CocoaLumberjack in Frameworks */,
03FD68BB2B1DC59600FD388E /* CryptoSwift in Frameworks */,
Expand Down Expand Up @@ -2701,7 +2699,6 @@
03022F182B3591AE00B63209 /* GoogleGenerativeAI */,
0AC8A84E2B6DFDD4006DA5CC /* SettingsAccess */,
03779F192BB25797008D3C42 /* OpenAI */,
C4BFDD792BE61F550094026B /* Vortex */,
0364EC892C208EB50036B61B /* KeySender */,
033E181E2C5A970A0099A7B0 /* Vapor */,
C4BE8E1B2C72E61B00F53204 /* LaunchAtLogin */,
Expand Down Expand Up @@ -2767,7 +2764,6 @@
03022F172B3591AE00B63209 /* XCRemoteSwiftPackageReference "generative-ai-swift" */,
0AC8A84D2B6DFDD4006DA5CC /* XCRemoteSwiftPackageReference "SettingsAccess" */,
03779F182BB25797008D3C42 /* XCRemoteSwiftPackageReference "OpenAI" */,
C4BFDD782BE61F550094026B /* XCRemoteSwiftPackageReference "Vortex" */,
0364EC882C208EB40036B61B /* XCRemoteSwiftPackageReference "KeySender" */,
033E181D2C5A970A0099A7B0 /* XCRemoteSwiftPackageReference "vapor" */,
C4BE8E1A2C72E5C500F53204 /* XCRemoteSwiftPackageReference "LaunchAtLogin-Modern" */,
Expand Down Expand Up @@ -3791,14 +3787,6 @@
minimumVersion = 1.1.0;
};
};
C4BFDD782BE61F550094026B /* XCRemoteSwiftPackageReference "Vortex" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/twostraws/Vortex";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.1;
};
};
EA3B81FA2B52555C004C0E8B /* XCRemoteSwiftPackageReference "Defaults" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/Defaults.git";
Expand Down Expand Up @@ -3920,11 +3908,6 @@
package = C4BE8E1A2C72E5C500F53204 /* XCRemoteSwiftPackageReference "LaunchAtLogin-Modern" */;
productName = LaunchAtLogin;
};
C4BFDD792BE61F550094026B /* Vortex */ = {
isa = XCSwiftPackageProductDependency;
package = C4BFDD782BE61F550094026B /* XCRemoteSwiftPackageReference "Vortex" */;
productName = Vortex;
};
EA3B81FB2B52555C004C0E8B /* Defaults */ = {
isa = XCSwiftPackageProductDependency;
package = EA3B81FA2B52555C004C0E8B /* XCRemoteSwiftPackageReference "Defaults" */;
Expand Down
11 changes: 1 addition & 10 deletions Easydict.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "6b2d9735092da5c9bc9b0a4954947f373d68f35b0939813ad8f54d785301c35e",
"originHash" : "8dd6aa510186229d6f2ea6220f7c231129077cb7b54cb2ca2c6d0c98c0660732",
"pins" : [
{
"identity" : "abseil-cpp-binary",
Expand Down Expand Up @@ -504,15 +504,6 @@
"version" : "4.102.1"
}
},
{
"identity" : "vortex",
"kind" : "remoteSourceControl",
"location" : "https://github.com/twostraws/Vortex",
"state" : {
"revision" : "bb48b128d3c13c68c68e83833c622eec9f6c701f",
"version" : "1.0.1"
}
},
{
"identity" : "websocket-kit",
"kind" : "remoteSourceControl",
Expand Down
2 changes: 1 addition & 1 deletion Easydict/App/EasydictApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct EasydictApp: App {

// About window
Window("setting.about", id: .aboutWindowId) {
SettingsAboutTab()
AboutTab()
.frame(width: 500, height: 220)
.disableWindowMinimize()
}
Expand Down
2 changes: 1 addition & 1 deletion Easydict/Swift/View/SettingView/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct SettingView: View {
.tabItem { Label("privacy", systemImage: "hand.raised.square") }
.tag(SettingTab.privacy)

SettingsAboutTab()
AboutTab()
.tabItem { Label("setting.about", systemImage: "info.bubble") }
.tag(SettingTab.about)
}
Expand Down
146 changes: 53 additions & 93 deletions Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,111 +8,71 @@

import SFSafeSymbols
import SwiftUI
import Vortex

// MARK: - SettingsAboutTab

// Use ScrollView to enable resize animation for Settings
struct SettingsAboutTab: View {
var body: some View {
ScrollView {
AboutTab()
}
}
}

// MARK: - AboutTab

struct AboutTab: View {
// MARK: Internal

var body: some View {
VortexViewReader { proxy in
GeometryReader { geometry in
ZStack {
VortexView(.confetti) {
Rectangle()
.fill(.white)
.frame(width: 16, height: 16)
.tag("square")

Circle()
.fill(.white)
.frame(width: 16)
.tag("circle")
HStack(alignment: .center, spacing: 30) {
Image(.logo)
.resizable()
.renderingMode(.original)
.frame(width: 100, height: 100)
.shadow(color: .gray, radius: 1, x: 0, y: 0.8)
.padding(.bottom, 2)
.padding(.leading, 16)
.padding(.trailing, 16)

VStack(alignment: .leading) {
VStack(alignment: .leading) {
Text(appName)
.font(.system(size: 35, weight: .medium))
.padding(.bottom, 3)

Text("current_version \(version)")
.font(.system(size: 13))
.foregroundColor(.gray)
.padding(.bottom, 29)

Text(copyrightInfo)
.font(.system(size: 11))
.foregroundColor(.gray)
.padding(.bottom, 20)
}

HStack(spacing: 15) {
Button {
NSWorkspace.shared.open(
URL(string: "https://github.com/tisfeng/Easydict")!
)
} label: {
Label("setting.about.github_link", systemSymbol: .starFill)
}
.frame(height: 220)

HStack(alignment: .center, spacing: 30) {
Image(.logo)
.resizable()
.renderingMode(.original)
.frame(width: 100, height: 100)
.shadow(color: .gray, radius: 1, x: 0, y: 0.8)
.padding(.bottom, 2)
.padding(.leading, 16)
.padding(.trailing, 16)
.onTapGesture { location in
proxy.move(
to:
CGPoint(
x: location.x + ((geometry.size.width / 2) - 222),
y: location.y + 60
)
)
proxy.burst()
}
VStack(alignment: .leading) {
VStack(alignment: .leading) {
Text(appName)
.font(.system(size: 35, weight: .medium))
.padding(.bottom, 3)

Text("current_version \(version)")
.font(.system(size: 13))
.foregroundColor(.gray)
.padding(.bottom, 29)

Text(copyrightInfo)
.font(.system(size: 11))
.foregroundColor(.gray)
.padding(.bottom, 20)
}

HStack(spacing: 15) {
Button {
NSWorkspace.shared.open(
URL(string: "https://github.com/tisfeng/Easydict")!
)
} label: {
Label("setting.about.github_link", systemSymbol: .starFill)
}

Button {
NSWorkspace.shared
.open(
URL(
string:
"https://github.com/tisfeng/Easydict/graphs/contributors"
)!
)
} label: {
Label("setting.about.contributor_link", systemSymbol: .person3Fill)
}

Button {
openWindow(id: .acknowledgementsWindowId)
} label: {
Label("setting.about.acknowledgements", systemSymbol: .checkmarkSealFill)
}
}
.padding(.bottom, 10)
}

Button {
NSWorkspace.shared
.open(
URL(
string:
"https://github.com/tisfeng/Easydict/graphs/contributors"
)!
)
} label: {
Label("setting.about.contributor_link", systemSymbol: .person3Fill)
}

Button {
openWindow(id: .acknowledgementsWindowId)
} label: {
Label("setting.about.acknowledgements", systemSymbol: .checkmarkSealFill)
}
.frame(maxWidth: .infinity)
}
.padding(.bottom, 10)
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
}

// MARK: Private
Expand Down
Loading