diff --git a/Cartfile b/Cartfile index a7dcdf54..c7d6cc5f 100644 --- a/Cartfile +++ b/Cartfile @@ -8,6 +8,8 @@ github "ddddxxx/Semver" github "ddddxxx/SwiftyOpenCC" -github "SnapKit/SnapKit" ~> 4.0.0 +github "ddddxxx/TouchBarHelper" + +github "SnapKit/SnapKit" github "shpakovski/MASShortcut" diff --git a/Cartfile.resolved b/Cartfile.resolved index 40897c0f..deb66d6d 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,7 +1,8 @@ -github "SnapKit/SnapKit" "4.0.0" +github "SnapKit/SnapKit" "4.0.1" github "ddddxxx/GenericID" "v0.3.0" github "ddddxxx/LyricsProvider" "v0.4.3" github "ddddxxx/MusicPlayer" "v0.1.1" github "ddddxxx/Semver" "v0.1.2" github "ddddxxx/SwiftyOpenCC" "v0.2.2" +github "ddddxxx/TouchBarHelper" "v1.0.0" github "shpakovski/MASShortcut" "2.3.6" diff --git a/LyricsX.xcodeproj/project.pbxproj b/LyricsX.xcodeproj/project.pbxproj index 8e66d5ce..34588ff8 100644 --- a/LyricsX.xcodeproj/project.pbxproj +++ b/LyricsX.xcodeproj/project.pbxproj @@ -79,6 +79,9 @@ E91F76EB21211B8D00755698 /* PreferenceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91F76EA21211B8D00755698 /* PreferenceViewController.swift */; }; E97593E42150F47900D80616 /* Polyfill.swift in Sources */ = {isa = PBXBuildFile; fileRef = E97593E32150F47800D80616 /* Polyfill.swift */; }; E97593E62150F6FB00D80616 /* IBInspection.swift in Sources */ = {isa = PBXBuildFile; fileRef = E97593E52150F6FB00D80616 /* IBInspection.swift */; }; + E97AFB55215CAF4400AF74CD /* TouchBarHelper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E97AFB54215CAF4400AF74CD /* TouchBarHelper.framework */; }; + E97AFB56215CAF4400AF74CD /* TouchBarHelper.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E97AFB54215CAF4400AF74CD /* TouchBarHelper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + E97AFB59215CBF0300AF74CD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E97AFB5B215CBF0300AF74CD /* InfoPlist.strings */; }; E9E55138207C4CB000F9958A /* TouchBarLyrics.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E55137207C4CB000F9958A /* TouchBarLyrics.swift */; }; E9EBDA2521115A150019FDF9 /* Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EBDA2421115A150019FDF9 /* Observation.swift */; }; /* End PBXBuildFile section */ @@ -94,6 +97,7 @@ BB58B0851E82B82F00598D4F /* OpenCC.framework in Embed Frameworks */, BBF83E231FB5502000D76E5B /* MusicPlayer.framework in Embed Frameworks */, BB4FBE761F0F1E440045A8FA /* LyricsProvider.framework in Embed Frameworks */, + E97AFB56215CAF4400AF74CD /* TouchBarHelper.framework in Embed Frameworks */, BB34F4AA1EFFBCBC008B9E4B /* MASShortcut.framework in Embed Frameworks */, BB4141C91E46CDD700A51775 /* SnapKit.framework in Embed Frameworks */, BBE557981EC0291E00F1EC31 /* GenericID.framework in Embed Frameworks */, @@ -177,9 +181,10 @@ E91F76EA21211B8D00755698 /* PreferenceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferenceViewController.swift; sourceTree = ""; }; E97593E32150F47800D80616 /* Polyfill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Polyfill.swift; sourceTree = ""; }; E97593E52150F6FB00D80616 /* IBInspection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBInspection.swift; sourceTree = ""; }; + E97AFB54215CAF4400AF74CD /* TouchBarHelper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TouchBarHelper.framework; path = Carthage/Build/Mac/TouchBarHelper.framework; sourceTree = ""; }; + E97AFB5A215CBF0300AF74CD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + E97AFB5C215CBF0500AF74CD /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = ""; }; E9E5512F207C4B7600F9958A /* DFRFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DFRFoundation.framework; path = ../../../../System/Library/PrivateFrameworks/DFRFoundation.framework; sourceTree = ""; }; - E9E55131207C4BC700F9958A /* TouchBarPrivateAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TouchBarPrivateAPI.h; sourceTree = ""; }; - E9E55133207C4C2700F9958A /* LyricsX-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LyricsX-Bridging-Header.h"; sourceTree = ""; }; E9E55137207C4CB000F9958A /* TouchBarLyrics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarLyrics.swift; sourceTree = ""; }; E9EBDA2421115A150019FDF9 /* Observation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Observation.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -195,6 +200,7 @@ BBF83E221FB5502000D76E5B /* MusicPlayer.framework in Frameworks */, BB4141C81E46CDD700A51775 /* SnapKit.framework in Frameworks */, BB4FBE751F0F1E440045A8FA /* LyricsProvider.framework in Frameworks */, + E97AFB55215CAF4400AF74CD /* TouchBarHelper.framework in Frameworks */, BB34F4A91EFFBCBC008B9E4B /* MASShortcut.framework in Frameworks */, BB58B0841E82B82F00598D4F /* OpenCC.framework in Frameworks */, BBE557971EC0291E00F1EC31 /* GenericID.framework in Frameworks */, @@ -251,7 +257,6 @@ BB063B2F1E8A93CE00A25C3E /* View */, BB7EC7B41E4ECFFB00A0AC3F /* Controller */, BB7EC7B61E4ED03900A0AC3F /* Utility */, - E9E55132207C4BFC00F9958A /* CBridge */, BB4141BC1E45B26800A51775 /* Supporting Files */, ); path = LyricsX; @@ -262,6 +267,7 @@ children = ( BB4141B11E458BA800A51775 /* Assets.xcassets */, BB0BE9581F444C9E0068FF67 /* Localizable.strings */, + E97AFB5B215CBF0300AF74CD /* InfoPlist.strings */, BB9BCEB81E84120D001BC54B /* LyricsX.entitlements */, BB4141B61E458BA900A51775 /* Info.plist */, BB58B0811E82971400598D4F /* UserDefaults.plist */, @@ -293,6 +299,7 @@ BB58B0831E82B82F00598D4F /* OpenCC.framework */, BB34F7E71F2197C800B7C484 /* Semver.framework */, BB4141C61E46CDD200A51775 /* SnapKit.framework */, + E97AFB54215CAF4400AF74CD /* TouchBarHelper.framework */, ); name = Frameworks; sourceTree = ""; @@ -366,15 +373,6 @@ path = Component; sourceTree = ""; }; - E9E55132207C4BFC00F9958A /* CBridge */ = { - isa = PBXGroup; - children = ( - E9E55131207C4BC700F9958A /* TouchBarPrivateAPI.h */, - E9E55133207C4C2700F9958A /* LyricsX-Bridging-Header.h */, - ); - path = CBridge; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -487,6 +485,7 @@ buildActionMask = 2147483647; files = ( BB0BE9561F444C9E0068FF67 /* Localizable.strings in Resources */, + E97AFB59215CBF0300AF74CD /* InfoPlist.strings in Resources */, BB6139741FCCFA6700CBD808 /* Perference.storyboard in Resources */, BB4141B21E458BA800A51775 /* Assets.xcassets in Resources */, BB58B0821E82971400598D4F /* UserDefaults.plist in Resources */, @@ -654,6 +653,15 @@ name = Perference.storyboard; sourceTree = ""; }; + E97AFB5B215CBF0300AF74CD /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + E97AFB5A215CBF0300AF74CD /* en */, + E97AFB5C215CBF0500AF74CD /* zh-Hans */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -796,7 +804,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = ddddxxx.LyricsX; - SWIFT_OBJC_BRIDGING_HEADER = "LyricsX/CBridge/LyricsX-Bridging-Header.h"; SWIFT_VERSION = 4.0; SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks"; }; @@ -822,7 +829,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = ddddxxx.LyricsX; SWIFT_ACTIVE_COMPILATION_CONDITIONS = IS_FOR_MAS; - SWIFT_OBJC_BRIDGING_HEADER = "LyricsX/CBridge/LyricsX-Bridging-Header.h"; SWIFT_VERSION = 4.0; SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks"; }; diff --git a/LyricsX/CBridge/LyricsX-Bridging-Header.h b/LyricsX/CBridge/LyricsX-Bridging-Header.h deleted file mode 100644 index 98f3d624..00000000 --- a/LyricsX/CBridge/LyricsX-Bridging-Header.h +++ /dev/null @@ -1,5 +0,0 @@ -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// - -#import "TouchBarPrivateAPI.h" diff --git a/LyricsX/CBridge/TouchBarPrivateAPI.h b/LyricsX/CBridge/TouchBarPrivateAPI.h deleted file mode 100644 index 622d5c1b..00000000 --- a/LyricsX/CBridge/TouchBarPrivateAPI.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// TouchBarPrivateAPI.h -// -// This file is part of LyricsX -// Copyright (C) 2017 Xander Deng - https://github.com/ddddxxx/LyricsX -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#ifndef TouchBarPrivateAPI_h -#define TouchBarPrivateAPI_h - -#import - -@interface NSTouchBarItem (PrivateMethods) - -+ (void)addSystemTrayItem:(NSTouchBarItem *)item; - -+ (void)removeSystemTrayItem:(NSTouchBarItem *)item; - -@end - -@interface NSTouchBar (PrivateMethods) - -// MARK: macOS 10.14 and above - -+ (void)presentSystemModalTouchBar:(NSTouchBar *)touchBar placement:(long long)placement systemTrayItemIdentifier:(NSTouchBarItemIdentifier)identifier NS_AVAILABLE_MAC(10.14); - -+ (void)presentSystemModalTouchBar:(NSTouchBar *)touchBar systemTrayItemIdentifier:(NSTouchBarItemIdentifier)identifier NS_AVAILABLE_MAC(10.14); - -+ (void)dismissSystemModalTouchBar:(NSTouchBar *)touchBar NS_AVAILABLE_MAC(10.14); - -+ (void)minimizeSystemModalTouchBar:(NSTouchBar *)touchBar NS_AVAILABLE_MAC(10.14); - -// MARK: macOS 10.13 and below - -+ (void)presentSystemModalFunctionBar:(NSTouchBar *)touchBar placement:(long long)placement systemTrayItemIdentifier:(NSTouchBarItemIdentifier)identifier NS_DEPRECATED_MAC(10.12.2, 10.14); - -+ (void)presentSystemModalFunctionBar:(NSTouchBar *)touchBar systemTrayItemIdentifier:(NSTouchBarItemIdentifier)identifier NS_DEPRECATED_MAC(10.12.2, 10.14); - -+ (void)dismissSystemModalFunctionBar:(NSTouchBar *)touchBar NS_DEPRECATED_MAC(10.12.2, 10.14); - -+ (void)minimizeSystemModalFunctionBar:(NSTouchBar *)touchBar NS_DEPRECATED_MAC(10.12.2, 10.14); - -@end - -#endif /* TouchBarPrivateAPI_h */ diff --git a/LyricsX/Component/AppDelegate.swift b/LyricsX/Component/AppDelegate.swift index 6062d066..03a0de13 100644 --- a/LyricsX/Component/AppDelegate.swift +++ b/LyricsX/Component/AppDelegate.swift @@ -220,7 +220,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate { .PreferBilingualLyrics: isZh, .ChineseConversionIndex: isHant ? 2 : 0, .DesktopLyricsXPositionFactor: 0.5, - .DesktopLyricsYPositionFactor: 0.95, + .DesktopLyricsYPositionFactor: 0.9, ]) } } diff --git a/LyricsX/Controller/LyricsHUDViewController.swift b/LyricsX/Controller/LyricsHUDViewController.swift index acf7305d..487a89c6 100644 --- a/LyricsX/Controller/LyricsHUDViewController.swift +++ b/LyricsX/Controller/LyricsHUDViewController.swift @@ -109,7 +109,7 @@ class LyricsHUDViewController: NSViewController, NSWindowDelegate, ScrollLyricsV NSAnimationContext.runAnimationGroup { context in context.duration = 0.3 context.allowsImplicitAnimation = true - context.timingFunction = .mystery + context.timingFunction = .swiftOut self.lyricsScrollView.scroll(position: pos) } } else { diff --git a/LyricsX/Controller/SearchLyricsViewController.swift b/LyricsX/Controller/SearchLyricsViewController.swift index e6d0ae05..f601420d 100644 --- a/LyricsX/Controller/SearchLyricsViewController.swift +++ b/LyricsX/Controller/SearchLyricsViewController.swift @@ -226,7 +226,7 @@ class SearchLyricsViewController: NSViewController, NSTableViewDelegate, NSTable NSAnimationContext.runAnimationGroup({ context in context.duration = 0.33 context.allowsImplicitAnimation = true - context.timingFunction = .mystery + context.timingFunction = .swiftOut hideLrcPreviewConstraint?.animator().isActive = false view.window?.setFrame(windowFrame, display: false, animate: true) view.needsUpdateConstraints = true diff --git a/LyricsX/Controller/TouchBarLyrics.swift b/LyricsX/Controller/TouchBarLyrics.swift index 6799cdb8..cf24b97e 100644 --- a/LyricsX/Controller/TouchBarLyrics.swift +++ b/LyricsX/Controller/TouchBarLyrics.swift @@ -21,6 +21,7 @@ import Cocoa import LyricsProvider import OpenCC +import TouchBarHelper #if IS_FOR_MAS #else @@ -39,7 +40,9 @@ class TouchBarLyrics: NSObject, NSTouchBarDelegate { touchBar.defaultItemIdentifiers = [.lyrics] systemTrayItem.view = NSButton(image: #imageLiteral(resourceName: "status_bar_icon"), target: self, action: #selector(presentTouchBar)) - self.systemTrayItem.setSystemTrayPresent(true) + systemTrayItem.addSystemTray() + DFRElementSetControlStripPresenceForIdentifier(systemTrayItem.identifier, true) + DFRSystemModalShowsCloseBoxWhenFrontMost(true) NotificationCenter.default.addObserver(self, selector: #selector(self.handleLyricsDisplay), name: .lyricsShouldDisplay, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(self.handleLyricsDisplay), name: .currentLyricsChange, object: nil) @@ -48,7 +51,7 @@ class TouchBarLyrics: NSObject, NSTouchBarDelegate { } deinit { - self.systemTrayItem.setSystemTrayPresent(false) + self.systemTrayItem.removeSystemTray() } @objc private func presentTouchBar() { @@ -95,20 +98,6 @@ class TouchBarLyrics: NSObject, NSTouchBarDelegate { } } -@available(OSX 10.12.2, *) -private extension NSTouchBarItem { - - func setSystemTrayPresent(_ isPresent: Bool) { - if isPresent { - NSTouchBarItem.addSystemTrayItem(self) - } else { - NSTouchBarItem.removeSystemTrayItem(self) - } - DFRElementSetControlStripPresenceForIdentifier?(identifier, isPresent) - DFRSystemModalShowsCloseBoxWhenFrontMost?(isPresent) - } -} - @available(OSX 10.12.2, *) private extension NSTouchBarItem.Identifier { @@ -117,37 +106,6 @@ private extension NSTouchBarItem.Identifier { static let systemTrayItem = NSTouchBarItem.Identifier("ddddxxx.LyricsX.touchBar.systemTrayItem") } -// MARK: DFRFoundation API - -private let DFRFoundationPath = "/System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation" - -// swiftlint:disable type_name identifier_name -@available(OSX 10.12.2, *) -private typealias DFRElementSetControlStripPresenceForIdentifierType = @convention(c) (NSTouchBarItem.Identifier, Bool) -> Void - -@available(OSX 10.12.2, *) -private typealias DFRSystemModalShowsCloseBoxWhenFrontMostType = @convention(c) (Bool) -> Void - -@available(OSX 10.12.2, *) -private let (DFRElementSetControlStripPresenceForIdentifier, DFRSystemModalShowsCloseBoxWhenFrontMost): - (DFRElementSetControlStripPresenceForIdentifierType?, DFRSystemModalShowsCloseBoxWhenFrontMostType?) = { - guard let handle = dlopen(DFRFoundationPath, RTLD_LAZY) else { - return (nil, nil) - } - defer { - dlclose(handle) - } - let f1 = dlsym(handle, "DFRElementSetControlStripPresenceForIdentifier")?.do { - unsafeBitCast($0, to: DFRElementSetControlStripPresenceForIdentifierType.self) - } - let f2 = dlsym(handle, "DFRSystemModalShowsCloseBoxWhenFrontMost")?.do { - unsafeBitCast($0, to: DFRSystemModalShowsCloseBoxWhenFrontMostType.self) - } - return (f1, f2) -}() - -// swiftlint:enable type_name identifier_name - // MARK: - NSTextField + Progress private extension NSTextField { diff --git a/LyricsX/Supporting Files/Info.plist b/LyricsX/Supporting Files/Info.plist index 8ac51bf3..cd262881 100644 --- a/LyricsX/Supporting Files/Info.plist +++ b/LyricsX/Supporting Files/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.4.1 CFBundleVersion - 1920 + 1926 Fabric APIKey @@ -104,6 +104,8 @@ + NSAppleEventsUsageDescription + LyricsX needs to know what song you're currently playing, to show lyrics accordingly. NSHumanReadableCopyright Copyright © 2017 Xander Deng. All rights reserved. NSMainStoryboardFile diff --git a/LyricsX/Supporting Files/en.lproj/InfoPlist.strings b/LyricsX/Supporting Files/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..90edd533 --- /dev/null +++ b/LyricsX/Supporting Files/en.lproj/InfoPlist.strings @@ -0,0 +1 @@ +"NSAppleEventsUsageDescription" = "LyricsX needs to know what song you're currently playing, to show lyrics accordingly." diff --git a/LyricsX/Supporting Files/zh-Hans.lproj/InfoPlist.strings b/LyricsX/Supporting Files/zh-Hans.lproj/InfoPlist.strings new file mode 100644 index 00000000..53802899 --- /dev/null +++ b/LyricsX/Supporting Files/zh-Hans.lproj/InfoPlist.strings @@ -0,0 +1 @@ +"NSAppleEventsUsageDescription" = "LyricsX 需要获取当前播放的音乐,并据此展示歌词" diff --git a/LyricsX/Utility/Global.swift b/LyricsX/Utility/Global.swift index 41cbfe8e..2b2ecc1f 100644 --- a/LyricsX/Utility/Global.swift +++ b/LyricsX/Utility/Global.swift @@ -39,6 +39,7 @@ let isFromMacAppStore = (try? Bundle.main.appStoreReceiptURL?.checkResourceIsRea extension CAMediaTimingFunction { static let mystery = CAMediaTimingFunction(controlPoints: 0.2, 0.1, 0.2, 1) + static let swiftOut = CAMediaTimingFunction(controlPoints: 0.4, 0.0, 0.2, 1) } func log(_ message: @autoclosure () -> String, file: String = #file, line: UInt = #line) { diff --git a/LyricsX/Utility/StdExtension.swift b/LyricsX/Utility/StdExtension.swift index 0361a4f5..f96e0506 100644 --- a/LyricsX/Utility/StdExtension.swift +++ b/LyricsX/Utility/StdExtension.swift @@ -38,6 +38,9 @@ extension Comparable { extension Strideable { func clamped(to limit: Range) -> Self { + guard !limit.isEmpty else { + preconditionFailure("Range cannot be empty") + } let upperBound = limit.upperBound.advanced(by: -1) return min(max(self, limit.lowerBound), upperBound) } diff --git a/LyricsX/Utility/Then.swift b/LyricsX/Utility/Then.swift index c8f5406e..af1cbb2b 100644 --- a/LyricsX/Utility/Then.swift +++ b/LyricsX/Utility/Then.swift @@ -54,5 +54,3 @@ extension CGPoint: Then {} extension CGRect: Then {} extension CGSize: Then {} extension CGVector: Then {} - -extension UnsafeMutableRawPointer: Then {} diff --git a/LyricsX/View/KaraokeLabel.swift b/LyricsX/View/KaraokeLabel.swift index e8a1e760..be4f2135 100644 --- a/LyricsX/View/KaraokeLabel.swift +++ b/LyricsX/View/KaraokeLabel.swift @@ -142,7 +142,7 @@ class KaraokeLabel: NSTextField { override func draw(_ dirtyRect: NSRect) { let context = NSGraphicsContext.current!.cgContext context.textMatrix = .identity - context.translateBy(x: 0, y: dirtyRect.height) + context.translateBy(x: 0, y: bounds.height) context.scaleBy(x: 1.0, y: -1.0) CTFrameDraw(ctFrame, context) } diff --git a/LyricsX/View/KaraokeLyricsView.swift b/LyricsX/View/KaraokeLyricsView.swift index 26b61c26..15a962a6 100644 --- a/LyricsX/View/KaraokeLyricsView.swift +++ b/LyricsX/View/KaraokeLyricsView.swift @@ -126,7 +126,7 @@ class KaraokeLyricsView: NSBox { NSAnimationContext.runAnimationGroup({ context in context.duration = 0.25 context.allowsImplicitAnimation = true - context.timingFunction = .mystery + context.timingFunction = .swiftOut toBeHide.forEach { stackView.removeArrangedSubview($0) $0.isHidden = true diff --git a/LyricsX/zh-Hans.lproj/Main.strings b/LyricsX/zh-Hans.lproj/Main.strings index e708b753..69b42d9c 100644 --- a/LyricsX/zh-Hans.lproj/Main.strings +++ b/LyricsX/zh-Hans.lproj/Main.strings @@ -71,7 +71,7 @@ "o52-Z0-lue.title" = "如果您认为 LyricsX 对您有所帮助,并愿意支持软件的维护,可以扫描下方的二维码向我捐赠。"; /* Class = "NSMenuItem"; title = "Show In Finder"; ObjectID = "DNi-vI-MTr"; */ -"DNi-vI-MTr.title" = "Show In Finder"; +"DNi-vI-MTr.title" = "在 Finder 中显示"; /* Class = "NSMenuItem"; title = "Lyrics"; ObjectID = "hxE-X4-sJh"; */ -"hxE-X4-sJh.title" = "Lyrics"; +"hxE-X4-sJh.title" = "歌词"; diff --git a/LyricsX/zh-Hans.lproj/Perference.strings b/LyricsX/zh-Hans.lproj/Perference.strings index 8a67ac50..d18d6704 100644 --- a/LyricsX/zh-Hans.lproj/Perference.strings +++ b/LyricsX/zh-Hans.lproj/Perference.strings @@ -161,4 +161,4 @@ "slB-q7-1dB.title" = "全局歌词偏移 (ms):"; /* Class = "NSButtonCell"; title = "Draggable"; ObjectID = "T7p-MT-Mrh"; */ -"T7p-MT-Mrh.title" = "Draggable"; +"T7p-MT-Mrh.title" = "允许拖放";