Skip to content

Commit

Permalink
fix: refactor app list issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phlpsong committed Jan 18, 2024
1 parent e2e16a3 commit 00c211e
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 114 deletions.
12 changes: 12 additions & 0 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
03FD68BB2B1DC59600FD388E /* CryptoSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 03FD68BA2B1DC59600FD388E /* CryptoSwift */; };
03FD68BE2B1E151A00FD388E /* String+EncryptAES.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03FD68BD2B1E151A00FD388E /* String+EncryptAES.swift */; };
0A057D6D2B499A000025C51D /* ServiceTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A057D6C2B499A000025C51D /* ServiceTab.swift */; };
0A2A05A62B59757100EEA142 /* Bundle+AppInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A2A05A52B59757100EEA142 /* Bundle+AppInfo.swift */; };
0A2BA9602B49A989002872A4 /* Binding+DidSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A2BA95F2B49A989002872A4 /* Binding+DidSet.swift */; };
0A2BA9642B4A3CCD002872A4 /* Notification+Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A2BA9632B4A3CCD002872A4 /* Notification+Name.swift */; };
0A8685C82B552A590022534F /* DisabledTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8685C72B552A590022534F /* DisabledTab.swift */; };
Expand Down Expand Up @@ -705,6 +706,7 @@
03FD68BD2B1E151A00FD388E /* String+EncryptAES.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+EncryptAES.swift"; sourceTree = "<group>"; };
06E15747A7BD34D510ADC6A8 /* Pods-Easydict.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Easydict.debug.xcconfig"; path = "Target Support Files/Pods-Easydict/Pods-Easydict.debug.xcconfig"; sourceTree = "<group>"; };
0A057D6C2B499A000025C51D /* ServiceTab.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServiceTab.swift; sourceTree = "<group>"; };
0A2A05A52B59757100EEA142 /* Bundle+AppInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+AppInfo.swift"; sourceTree = "<group>"; };
0A2BA95F2B49A989002872A4 /* Binding+DidSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Binding+DidSet.swift"; sourceTree = "<group>"; };
0A2BA9632B4A3CCD002872A4 /* Notification+Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Notification+Name.swift"; sourceTree = "<group>"; };
0A8685C72B552A590022534F /* DisabledTab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisabledTab.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1823,6 +1825,7 @@
03CF88602B137ECB0030C199 /* Swift */ = {
isa = PBXGroup;
children = (
0A2A05A42B59755F00EEA142 /* Bundle */,
0A2BA9622B4A3CBB002872A4 /* Notification */,
0A2BA95E2B49A967002872A4 /* Binding */,
03FD68BC2B1E14B500FD388E /* String */,
Expand Down Expand Up @@ -2003,6 +2006,14 @@
path = String;
sourceTree = "<group>";
};
0A2A05A42B59755F00EEA142 /* Bundle */ = {
isa = PBXGroup;
children = (
0A2A05A52B59757100EEA142 /* Bundle+AppInfo.swift */,
);
path = Bundle;
sourceTree = "<group>";
};
0A2BA95E2B49A967002872A4 /* Binding */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2656,6 +2667,7 @@
9672D7D22B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.m in Sources */,
03BDA7BF2A26DA280079D04F /* NSScanner+EscapedScanning.m in Sources */,
03542A4C2937B5F100C34C33 /* EZYoudaoTranslate.m in Sources */,
0A2A05A62B59757100EEA142 /* Bundle+AppInfo.swift in Sources */,
037852B329583F5200D0E2CF /* EZServiceCell.m in Sources */,
03247E362968158B00AFCD67 /* EZScriptExecutor.m in Sources */,
03882F8E29D95044005B5A52 /* ToastWindowController.m in Sources */,
Expand Down
23 changes: 23 additions & 0 deletions Easydict/Feature/Utility/Swift/Bundle/Bundle+AppInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// Bundle+AppInfo.swift
// Easydict
//
// Created by phlpsong on 2024/1/18.
// Copyright © 2024 izual. All rights reserved.
//

import Foundation

extension Bundle {
var applicationName: String {
if let displayName: String = infoDictionary?["CFBundleDisplayName"] as? String {
return displayName
} else if let name: String = infoDictionary?["CFBundleName"] as? String {
return name
}
if let executableURL {
return executableURL.deletingLastPathComponent().lastPathComponent
}
return ""
}
}
6 changes: 3 additions & 3 deletions Easydict/NewApp/View/SettingView/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ struct SettingView: View {
.tabItem { Label("service", systemImage: "briefcase") }
.tag(SettingTab.service)

DisabledTab()
DisabledAppTab()
.tabItem { Label("disabled_app_list", systemImage: "nosign") }
.tag(SettingTab.disabled.rawValue)
.tag(SettingTab.disabled)

PrivacyTab()
.tabItem { Label("privacy", systemImage: "hand.raised.square") }
Expand All @@ -59,7 +59,7 @@ struct SettingView: View {

let originalFrame = window.frame
let newSize = switch selection {
case .general, .privacy, .about:
case .general, .privacy, .about, .disabled:
CGSize(width: 500, height: 520)
case .service:
CGSize(width: 800, height: 520)
Expand Down
Loading

0 comments on commit 00c211e

Please sign in to comment.