-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: split global shortcut * fix: restore app shortcut * feat: add main menu shortcut part * feat: add default app shortcut * feat: change add default app shortcut place * feat: add Divider * fix: review localized string * fix: create keyCombo clearly * fix: optimize AppshortcutSetting and GlobalShortcut * fix: remove unused code * fix: refactor command * fix: UI optimize * fix: remove unused code * fix: remove unused code * fix: try fix bug * perf: adjust settings page size * perf: adjust shortcut view size * Apply suggestions from code review Co-authored-by: Tisfeng <[email protected]> * Update Easydict/NewApp/View/SettingView/Tabs/View/Shortcut/AppShortcutSetting.swift * fix: appshortcutsetting shortcut type * fix: review localizable * fix: optimize code * fix: optimize code --------- Co-authored-by: Tisfeng <[email protected]>
- Loading branch information
Showing
19 changed files
with
866 additions
and
158 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// | ||
// Shortcut+Bind.swift | ||
// Easydict | ||
// | ||
// Created by Sharker on 2024/2/4. | ||
// Copyright © 2024 izual. All rights reserved. | ||
// | ||
|
||
// App shortcut binding func | ||
extension Shortcut { | ||
@objc func clearInput() { | ||
EZWindowManager.shared().clearInput() | ||
} | ||
|
||
@objc func clearAll() { | ||
EZWindowManager.shared().clearAll() | ||
} | ||
|
||
@objc func shortcutCopy() { | ||
EZWindowManager.shared().copyQueryText() | ||
} | ||
|
||
@objc func shortcutCopyFirstResult() { | ||
EZWindowManager.shared().copyFirstTranslatedText() | ||
} | ||
|
||
@objc func shortcutFocus() { | ||
EZWindowManager.shared().focusInputTextView() | ||
} | ||
|
||
@objc func shortcutPlay() { | ||
EZWindowManager.shared().playOrStopQueryTextAudio() | ||
} | ||
|
||
@objc func shortcutRetry() { | ||
EZWindowManager.shared().rerty() | ||
} | ||
|
||
@objc func shortcutToggle() { | ||
EZWindowManager.shared().toggleTranslationLanguages() | ||
} | ||
|
||
@objc func shortcutPin() { | ||
EZWindowManager.shared().pin() | ||
} | ||
|
||
@objc func shortcutHide() { | ||
EZWindowManager.shared().closeWindowOrExitSreenshot() | ||
} | ||
|
||
@objc func increaseFontSize() { | ||
Configuration.shared.fontSizeIndex += 1 | ||
} | ||
|
||
@objc func decreaseFontSize() { | ||
Configuration.shared.fontSizeIndex -= 1 | ||
} | ||
|
||
@objc func shortcutGoogle() { | ||
let window = EZWindowManager.shared().floatingWindow | ||
window?.titleBar.googleButton.openLink() | ||
} | ||
|
||
@objc func shortcutEudic() { | ||
let window = EZWindowManager.shared().floatingWindow | ||
window?.titleBar.eudicButton.openLink() | ||
} | ||
|
||
@objc func shortcutAppleDic() { | ||
let window = EZWindowManager.shared().floatingWindow | ||
window?.titleBar.appleDictionaryButton.openLink() | ||
} | ||
} | ||
|
||
// global shortcut binding func | ||
extension Shortcut { | ||
@objc func selectTextTranslate() { | ||
EZWindowManager.shared().selectTextTranslate() | ||
} | ||
|
||
@objc func snipTranslate() { | ||
EZWindowManager.shared().snipTranslate() | ||
} | ||
|
||
@objc func inputTranslate() { | ||
EZWindowManager.shared().inputTranslate() | ||
} | ||
|
||
@objc func showMiniFloatingWindow() { | ||
EZWindowManager.shared().showMiniFloatingWindow() | ||
} | ||
|
||
@objc func screenshotOCR() { | ||
EZWindowManager.shared().screenshotOCR() | ||
} | ||
} |
Oops, something went wrong.