diff --git a/Easydict/App/Assets.xcassets/arrow.clockwise.circle.imageset/Contents.json b/Easydict/App/Assets.xcassets/arrow.clockwise.circle.imageset/Contents.json new file mode 100644 index 000000000..e0c536d92 --- /dev/null +++ b/Easydict/App/Assets.xcassets/arrow.clockwise.circle.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "arrow_clockwise_circle.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/App/Assets.xcassets/arrow.clockwise.circle.imageset/arrow_clockwise_circle.png b/Easydict/App/Assets.xcassets/arrow.clockwise.circle.imageset/arrow_clockwise_circle.png new file mode 100644 index 000000000..fc25e5353 Binary files /dev/null and b/Easydict/App/Assets.xcassets/arrow.clockwise.circle.imageset/arrow_clockwise_circle.png differ diff --git a/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/Contents.json b/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/Contents.json new file mode 100644 index 000000000..038cf5aea --- /dev/null +++ b/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "camera-metering-spot_20.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "camera-metering-spot (1).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/camera-metering-spot (1).png b/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/camera-metering-spot (1).png new file mode 100644 index 000000000..f1d9739ba Binary files /dev/null and b/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/camera-metering-spot (1).png differ diff --git a/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/camera-metering-spot_20.png b/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/camera-metering-spot_20.png new file mode 100644 index 000000000..eb053e77b Binary files /dev/null and b/Easydict/App/Assets.xcassets/camera.metering.spot.imageset/camera-metering-spot_20.png differ diff --git a/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/Contents.json b/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/Contents.json new file mode 100644 index 000000000..ed350ca3b --- /dev/null +++ b/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "edit-camera.viewfinder.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "edit-camera.viewfinder-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/edit-camera.viewfinder-1.png b/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/edit-camera.viewfinder-1.png new file mode 100644 index 000000000..3184b5002 Binary files /dev/null and b/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/edit-camera.viewfinder-1.png differ diff --git a/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/edit-camera.viewfinder.png b/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/edit-camera.viewfinder.png new file mode 100644 index 000000000..52e9d15be Binary files /dev/null and b/Easydict/App/Assets.xcassets/camera.viewfinder.imageset/edit-camera.viewfinder.png differ diff --git a/Easydict/App/Assets.xcassets/dock.rectangle.imageset/Contents.json b/Easydict/App/Assets.xcassets/dock.rectangle.imageset/Contents.json new file mode 100644 index 000000000..41df1edfb --- /dev/null +++ b/Easydict/App/Assets.xcassets/dock.rectangle.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "dock.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/App/Assets.xcassets/dock.rectangle.imageset/dock.png b/Easydict/App/Assets.xcassets/dock.rectangle.imageset/dock.png new file mode 100644 index 000000000..fc8205791 Binary files /dev/null and b/Easydict/App/Assets.xcassets/dock.rectangle.imageset/dock.png differ diff --git a/Easydict/App/Assets.xcassets/highlighter.imageset/Contents.json b/Easydict/App/Assets.xcassets/highlighter.imageset/Contents.json new file mode 100644 index 000000000..150250380 --- /dev/null +++ b/Easydict/App/Assets.xcassets/highlighter.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "select_40.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "select.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/App/Assets.xcassets/highlighter.imageset/select.png b/Easydict/App/Assets.xcassets/highlighter.imageset/select.png new file mode 100644 index 000000000..a78109432 Binary files /dev/null and b/Easydict/App/Assets.xcassets/highlighter.imageset/select.png differ diff --git a/Easydict/App/Assets.xcassets/highlighter.imageset/select_40.png b/Easydict/App/Assets.xcassets/highlighter.imageset/select_40.png new file mode 100644 index 000000000..b35223cf1 Binary files /dev/null and b/Easydict/App/Assets.xcassets/highlighter.imageset/select_40.png differ diff --git a/Easydict/App/Assets.xcassets/keyboard.imageset/Contents.json b/Easydict/App/Assets.xcassets/keyboard.imageset/Contents.json new file mode 100644 index 000000000..abdf5ce84 --- /dev/null +++ b/Easydict/App/Assets.xcassets/keyboard.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "keyboard_20.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "keyboard (2).png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/App/Assets.xcassets/keyboard.imageset/keyboard (2).png b/Easydict/App/Assets.xcassets/keyboard.imageset/keyboard (2).png new file mode 100644 index 000000000..7ca989901 Binary files /dev/null and b/Easydict/App/Assets.xcassets/keyboard.imageset/keyboard (2).png differ diff --git a/Easydict/App/Assets.xcassets/keyboard.imageset/keyboard_20.png b/Easydict/App/Assets.xcassets/keyboard.imageset/keyboard_20.png new file mode 100644 index 000000000..7a0d20a8c Binary files /dev/null and b/Easydict/App/Assets.xcassets/keyboard.imageset/keyboard_20.png differ diff --git a/Easydict/App/Assets.xcassets/stop.circle.imageset/Contents.json b/Easydict/App/Assets.xcassets/stop.circle.imageset/Contents.json new file mode 100644 index 000000000..bce7266eb --- /dev/null +++ b/Easydict/App/Assets.xcassets/stop.circle.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "stop circle.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/App/Assets.xcassets/stop.circle.imageset/stop circle.png b/Easydict/App/Assets.xcassets/stop.circle.imageset/stop circle.png new file mode 100644 index 000000000..c5e47c342 Binary files /dev/null and b/Easydict/App/Assets.xcassets/stop.circle.imageset/stop circle.png differ diff --git "a/Easydict/App/Assets.xcassets/xmark.circle.fill.imageset/2.1\345\213\276.png" "b/Easydict/App/Assets.xcassets/xmark.circle.fill.imageset/2.1\345\213\276.png" new file mode 100644 index 000000000..5451c0131 Binary files /dev/null and "b/Easydict/App/Assets.xcassets/xmark.circle.fill.imageset/2.1\345\213\276.png" differ diff --git a/Easydict/App/Assets.xcassets/xmark.circle.fill.imageset/Contents.json b/Easydict/App/Assets.xcassets/xmark.circle.fill.imageset/Contents.json new file mode 100644 index 000000000..f7d016738 --- /dev/null +++ b/Easydict/App/Assets.xcassets/xmark.circle.fill.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "2.1勾.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Easydict/Feature/Service/Caiyun/CaiyunService.swift b/Easydict/Feature/Service/Caiyun/CaiyunService.swift index 00f9903b1..7d02d50a5 100644 --- a/Easydict/Feature/Service/Caiyun/CaiyunService.swift +++ b/Easydict/Feature/Service/Caiyun/CaiyunService.swift @@ -31,11 +31,11 @@ public final class CaiyunService: QueryService { } return orderedDict } - - override public func ocr(_: EZQueryModel) async throws -> EZOCRResult { - NSLog("Caiyun Translate does not support OCR") - throw QueryServiceError.notSupported - } + +// override public func ocr(_: EZQueryModel) async throws -> EZOCRResult { +// NSLog("Caiyun Translate does not support OCR") +// throw QueryServiceError.notSupported +// } private var apiEndPoint = "https://api.interpreter.caiyunai.com/v1/translator" @@ -45,7 +45,7 @@ public final class CaiyunService: QueryService { // easydict://writeKeyValue?EZCaiyunToken= private var token: String { let token = UserDefaults.standard.string(forKey: EZCaiyunToken) - if let token, !token.isEmpty { + if let token = token, !token.isEmpty { return token } else { return CaiyunService.defaultTestToken @@ -89,8 +89,8 @@ public final class CaiyunService: QueryService { headers: headers) .validate() .responseDecodable(of: CaiyunResponse.self) { [weak self] response in - guard let self else { return } - let result = self.result + guard let me = self else { return } + let result = me.result switch response.result { case let .success(value): result.from = from diff --git a/Easydict/Feature/ViewController/View/CustomButton/EZAudioButton/EZAudioButton.m b/Easydict/Feature/ViewController/View/CustomButton/EZAudioButton/EZAudioButton.m index f2620a0c0..65721f4fb 100644 --- a/Easydict/Feature/ViewController/View/CustomButton/EZAudioButton/EZAudioButton.m +++ b/Easydict/Feature/ViewController/View/CustomButton/EZAudioButton/EZAudioButton.m @@ -64,7 +64,7 @@ - (void)setIsPlaying:(BOOL)isPlaying { // NSImage *audioImage = [NSImage ez_imageWithSymbolName:symbolName size:CGSizeMake(15, 15)]; NSImage *playImage = [NSImage imageNamed:@"audio"]; - NSImage *pauseImage = [NSImage ez_imageWithSymbolName:@"pause.circle"]; + NSImage *pauseImage = [NSImage imageNamed:@"pause.circle"]; self.image = isPlaying ? pauseImage : playImage; diff --git a/Easydict/Feature/ViewController/View/CustomButton/EZReplaceTextButton/EZReplaceTextButton.m b/Easydict/Feature/ViewController/View/CustomButton/EZReplaceTextButton/EZReplaceTextButton.m index 7836f750a..b94c2b0be 100644 --- a/Easydict/Feature/ViewController/View/CustomButton/EZReplaceTextButton/EZReplaceTextButton.m +++ b/Easydict/Feature/ViewController/View/CustomButton/EZReplaceTextButton/EZReplaceTextButton.m @@ -22,7 +22,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect { } - (void)setup { - self.image = [NSImage ez_imageWithSymbolName:@"arrow.forward.square"]; + self.image = [NSImage imageNamed:@"arrow.forward.square"]; [self excuteLight:^(NSButton *button) { button.image = [button.image imageWithTintColor:[NSColor ez_imageTintLightColor]]; diff --git a/Easydict/Feature/ViewController/View/CustomButton/EZSymbolImageButton/EZSymbolImageButton.m b/Easydict/Feature/ViewController/View/CustomButton/EZSymbolImageButton/EZSymbolImageButton.m index 764d9345d..06f9a96f8 100644 --- a/Easydict/Feature/ViewController/View/CustomButton/EZSymbolImageButton/EZSymbolImageButton.m +++ b/Easydict/Feature/ViewController/View/CustomButton/EZSymbolImageButton/EZSymbolImageButton.m @@ -13,7 +13,7 @@ @implementation EZSymbolImageButton + (instancetype)buttonWithSybolImageName:(NSString *)sybolImageName { EZSymbolImageButton *button = [[EZSymbolImageButton alloc] init]; - NSImage *audioImage = [NSImage ez_imageWithSymbolName:sybolImageName]; + NSImage *audioImage = [NSImage imageNamed:@"audio"]; button.image = audioImage; [button excuteLight:^(NSButton *button) { diff --git a/Easydict/Feature/ViewController/View/QueryView/EZQueryView.m b/Easydict/Feature/ViewController/View/QueryView/EZQueryView.m index 6f41a4113..79a03b757 100644 --- a/Easydict/Feature/ViewController/View/QueryView/EZQueryView.m +++ b/Easydict/Feature/ViewController/View/QueryView/EZQueryView.m @@ -154,7 +154,7 @@ - (void)setup { [self addSubview:clearButton]; self.clearButton = clearButton; - NSImage *clearImage = [NSImage ez_imageWithSymbolName:@"xmark.circle.fill"]; + NSImage *clearImage = [NSImage imageNamed:@"xmark.circle.fill"]; clearImage = [clearImage imageWithTintColor:[NSColor mm_colorWithHexString:@"#868686"]]; clearButton.image = clearImage; diff --git a/Easydict/Feature/ViewController/View/ResultView/EZResultView.m b/Easydict/Feature/ViewController/View/ResultView/EZResultView.m index 736481b25..46f51c8fa 100644 --- a/Easydict/Feature/ViewController/View/ResultView/EZResultView.m +++ b/Easydict/Feature/ViewController/View/ResultView/EZResultView.m @@ -144,7 +144,7 @@ - (void)setup { EZHoverButton *stopButton = [[EZHoverButton alloc] init]; self.stopButton = stopButton; [self addSubview:stopButton]; - NSImage *stopImage = [NSImage ez_imageWithSymbolName:@"stop.circle"]; + NSImage *stopImage = [NSImage imageNamed:@"stop.circle"]; stopImage = [stopImage imageWithTintColor:[NSColor mm_colorWithHexString:@"#707070"]]; stopButton.image = stopImage; stopButton.mas_key = @"stopButton"; @@ -161,7 +161,7 @@ - (void)setup { EZHoverButton *retryButton = [[EZHoverButton alloc] init]; self.retryButton = retryButton; [self addSubview:retryButton]; - NSImage *retryImage = [NSImage ez_imageWithSymbolName:@"arrow.clockwise.circle"]; + NSImage *retryImage = [NSImage imageNamed:@"arrow.clockwise.circle"]; retryButton.image = retryImage; retryButton.mas_key = @"retryButton"; retryButton.toolTip = NSLocalizedString(@"retry", nil); diff --git a/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m b/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m index ba9005e78..31ca6ab30 100644 --- a/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m +++ b/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m @@ -840,7 +840,7 @@ - (void)refreshWithResult:(EZQueryResult *)result { EZOpenLinkButton *linkButton = [[EZOpenLinkButton alloc] init]; [self addSubview:linkButton]; - NSImage *linkImage = [NSImage ez_imageWithSymbolName:@"link"]; + NSImage *linkImage = [NSImage imageNamed:@"link"]; linkButton.image = linkImage; NSString *toolTip = NSLocalizedString(@"open_web_link", nil);