From 84458c01780f896b71ef15a6b40cf3f5cd268692 Mon Sep 17 00:00:00 2001 From: Sharker <1548742234@qq.com> Date: Thu, 11 Apr 2024 23:23:39 +0800 Subject: [PATCH] Fix tool tips (#500) * fix: title bar tooptip * feat: add update tool tips status when change shortcut * pref: pref UI when shortcut is empty * Update Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m Co-authored-by: Tisfeng * Update Easydict/Swift/Feature/Configuration/Configuration+Defaults.swift Co-authored-by: Phillip Song <103433299+phlpsong@users.noreply.github.com> * pref: move same logic into common func * pref: pref update window title bar code * perf: improve code, reduce duplicat code * refactor: change cancellables types from Array to Set --------- Co-authored-by: Tisfeng Co-authored-by: Phillip Song <103433299+phlpsong@users.noreply.github.com> --- .../Configuration+Defaults.swift | 23 + .../Feature/Configuration/Configuration.swift | 443 +++++++++--------- .../Feature/Shortcut/Shortcut+Bind.swift | 15 - .../ViewController/View/Titlebar/EZTitlebar.h | 3 + .../ViewController/View/Titlebar/EZTitlebar.m | 45 +- .../Window/WindowManager/EZWindowManager.h | 2 + .../Window/WindowManager/EZWindowManager.m | 6 + 7 files changed, 290 insertions(+), 247 deletions(-) diff --git a/Easydict/Swift/Feature/Configuration/Configuration+Defaults.swift b/Easydict/Swift/Feature/Configuration/Configuration+Defaults.swift index 301251c8f..2b4692164 100644 --- a/Easydict/Swift/Feature/Configuration/Configuration+Defaults.swift +++ b/Easydict/Swift/Feature/Configuration/Configuration+Defaults.swift @@ -189,6 +189,29 @@ class DefaultsWrapper { } } +// MARK: - ShortcutWrapper + +@propertyWrapper +class ShortcutWrapper { + // MARK: Lifecycle + + init(_ key: Defaults.Key) { + self.key = key + } + + // MARK: Internal + + let key: Defaults.Key + + var wrappedValue: String { + let keyCombo = Defaults[key] + if let keyCombo, keyCombo.doubledModifiers { + return keyCombo.keyEquivalentModifierMaskString + keyCombo.keyEquivalentModifierMaskString + } + return (keyCombo?.keyEquivalentModifierMaskString ?? "") + (keyCombo?.keyEquivalent ?? "") + } +} + // Service Configuration extension Defaults.Keys { // OpenAI diff --git a/Easydict/Swift/Feature/Configuration/Configuration.swift b/Easydict/Swift/Feature/Configuration/Configuration.swift index 184c331d0..761453500 100644 --- a/Easydict/Swift/Feature/Configuration/Configuration.swift +++ b/Easydict/Swift/Feature/Configuration/Configuration.swift @@ -124,7 +124,12 @@ class Configuration: NSObject { @DefaultsWrapper(.showQuickActionButton) var showQuickActionButton: Bool - var cancellables: [AnyCancellable] = [] + var cancellables: Set = [] + + @ShortcutWrapper(.pinShortcut) var pinShortcutString: String + @ShortcutWrapper(.googleShortcut) var googleShortcutString: String + @ShortcutWrapper(.appleDictionaryShortcut) var appleDictShortcutString: String + @ShortcutWrapper(.eudicShortcut) var eudicDictShortcutString: String var automaticallyChecksForUpdates: Bool { get { @@ -162,263 +167,246 @@ class Configuration: NSObject { // swiftlint:disable:next function_body_length private func observeKeys() { - cancellables.append( - Defaults.publisher(.firstLanguage) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetFirstLanguage() - } - ) + Defaults.publisher(.firstLanguage) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetFirstLanguage() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.secondLanguage) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetSecondLanguage() - } - ) + Defaults.publisher(.secondLanguage) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetSecondLanguage() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoSelectText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoSelectText() - } - ) + Defaults.publisher(.autoSelectText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoSelectText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.forceAutoGetSelectedText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetForceAutoGetSelectedText() - } - ) + Defaults.publisher(.forceAutoGetSelectedText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetForceAutoGetSelectedText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.disableEmptyCopyBeep) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetDisableEmptyCopyBeep() - } - ) + Defaults.publisher(.disableEmptyCopyBeep) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetDisableEmptyCopyBeep() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.clickQuery) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetClickQuery() - } - ) + Defaults.publisher(.clickQuery) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetClickQuery() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.launchAtStartup, options: []) - .removeDuplicates() - .sink { [weak self] change in - self?.didSetLaunchAtStartup(change.oldValue, new: change.newValue) - } - ) + Defaults.publisher(.launchAtStartup, options: []) + .removeDuplicates() + .sink { [weak self] change in + self?.didSetLaunchAtStartup(change.oldValue, new: change.newValue) + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.hideMainWindow) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetHideMainWindow() - } - ) + Defaults.publisher(.hideMainWindow) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetHideMainWindow() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoQueryOCRText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoQueryOCRText() - } - ) + Defaults.publisher(.autoQueryOCRText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoQueryOCRText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoQuerySelectedText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoQuerySelectedText() - } - ) + Defaults.publisher(.autoQuerySelectedText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoQuerySelectedText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoQueryPastedText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoQueryPastedText() - } - ) + Defaults.publisher(.autoQueryPastedText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoQueryPastedText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoPlayAudio) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoPlayAudio() - } - ) + Defaults.publisher(.autoPlayAudio) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoPlayAudio() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoCopySelectedText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoCopySelectedText() - } - ) + Defaults.publisher(.autoCopySelectedText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoCopySelectedText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoCopyOCRText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoCopyOCRText() - } - ) + Defaults.publisher(.autoCopyOCRText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoCopyOCRText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.autoCopyFirstTranslatedText) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAutoCopyFirstTranslatedText() - } - ) + Defaults.publisher(.autoCopyFirstTranslatedText) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAutoCopyFirstTranslatedText() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.languageDetectOptimize) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetLanguageDetectOptimize() - } - ) + Defaults.publisher(.languageDetectOptimize) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetLanguageDetectOptimize() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.defaultTTSServiceType) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetDefaultTTSServiceType() - } - ) + Defaults.publisher(.defaultTTSServiceType) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetDefaultTTSServiceType() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.showGoogleQuickLink) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetShowGoogleQuickLink() - } - ) + Defaults.publisher(.showGoogleQuickLink) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetShowGoogleQuickLink() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.showEudicQuickLink) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetShowEudicQuickLink() - } - ) + Defaults.publisher(.showEudicQuickLink) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetShowEudicQuickLink() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.showAppleDictionaryQuickLink) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetShowAppleDictionaryQuickLink() - } - ) + Defaults.publisher(.showAppleDictionaryQuickLink) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetShowAppleDictionaryQuickLink() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.showQuickActionButton, options: []) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetShowSettingQuickLink() - } - ) + Defaults.publisher(.showQuickActionButton, options: []) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetShowSettingQuickLink() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.hideMenuBarIcon) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetHideMenuBarIcon() - } - ) + Defaults.publisher(.hideMenuBarIcon) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetHideMenuBarIcon() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.enableBetaNewApp) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetEnableBetaNewApp() - } - ) + Defaults.publisher(.enableBetaNewApp) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetEnableBetaNewApp() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.fixedWindowPosition) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetFixedWindowPosition() - } - ) + Defaults.publisher(.fixedWindowPosition) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetFixedWindowPosition() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.mouseSelectTranslateWindowType) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetMouseSelectTranslateWindowType() - } - ) + Defaults.publisher(.mouseSelectTranslateWindowType) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetMouseSelectTranslateWindowType() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.shortcutSelectTranslateWindowType) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetShortcutSelectTranslateWindowType() - } - ) + Defaults.publisher(.shortcutSelectTranslateWindowType) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetShortcutSelectTranslateWindowType() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.adjustPopButtonOrigin) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAdjustPopButtomOrigin() - } - ) + Defaults.publisher(.adjustPopButtonOrigin) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAdjustPopButtomOrigin() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.allowCrashLog) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAllowCrashLog() - } - ) + Defaults.publisher(.allowCrashLog) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAllowCrashLog() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.allowAnalytics) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetAllowAnalytics() - } - ) + Defaults.publisher(.allowAnalytics) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetAllowAnalytics() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.clearInput) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetClearInput() - } - ) + Defaults.publisher(.clearInput) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetClearInput() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.fontSizeOptionIndex) - .removeDuplicates() - .sink { [weak self] _ in - self?.didSetFontSizeIndex() - } - ) + Defaults.publisher(.fontSizeOptionIndex) + .removeDuplicates() + .sink { [weak self] _ in + self?.didSetFontSizeIndex() + } + .store(in: &cancellables) - cancellables.append( - Defaults.publisher(.appearanceType) - .removeDuplicates() - .sink { [weak self] change in - let newValue = change.newValue + Defaults.publisher(.appearanceType) + .removeDuplicates() + .sink { [weak self] change in + let newValue = change.newValue + + self?.didSetAppearance(newValue) + } + .store(in: &cancellables) - self?.didSetAppearance(newValue) + let shortcutKeys: [Defaults.Key] = [ + .pinShortcut, + .appleDictionaryShortcut, + .googleShortcut, + .eudicShortcut, + ] + for key in shortcutKeys { + Defaults.publisher(key) + .removeDuplicates() + .sink { [weak self] _ in + self?.updateWindowTitlebar() } - ) + .store(in: &cancellables) + } } } @@ -588,6 +576,11 @@ extension Configuration { fileprivate func didSetAppearance(_ appearance: AppearenceType) { DarkModeManager.sharedManager().updateDarkMode(appearance.rawValue) } + + fileprivate func updateWindowTitlebar() { + let windowManager = EZWindowManager.shared() + windowManager.updateWindowsTitlebar() + } } // MARK: Window Frame diff --git a/Easydict/Swift/Feature/Shortcut/Shortcut+Bind.swift b/Easydict/Swift/Feature/Shortcut/Shortcut+Bind.swift index 60ba241c5..f4d7b811c 100644 --- a/Easydict/Swift/Feature/Shortcut/Shortcut+Bind.swift +++ b/Easydict/Swift/Feature/Shortcut/Shortcut+Bind.swift @@ -8,83 +8,68 @@ // 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() { if Configuration.shared.fontSizeIndex < Configuration.shared.fontSizes.count - 1 { Configuration.shared.fontSizeIndex += 1 } } - @objc func decreaseFontSize() { if Configuration.shared.fontSizeIndex > 0 { 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() diff --git a/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.h b/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.h index dad869835..5c5db88a7 100644 --- a/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.h +++ b/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.h @@ -33,6 +33,9 @@ typedef void(^EZTitlebarQuickActionBlock)(EZTitlebarQuickAction); @property (nonatomic, copy) EZTitlebarQuickActionBlock menuActionBlock; + +- (void)updateButtonsToolTip; + @end NS_ASSUME_NONNULL_END diff --git a/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.m b/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.m index 4f27ba95f..9f5b6bf21 100644 --- a/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.m +++ b/Easydict/objc/ViewController/View/Titlebar/EZTitlebar.m @@ -16,6 +16,13 @@ #import "EZConfiguration.h" #import "EZPreferencesWindowController.h" +typedef NS_ENUM(NSInteger, EZTitlebarButtonType) { + EZTitlebarButtonTypePin = 0, + EZTitlebarButtonTypeGoogle, + EZTitlebarButtonTypeAppleDic, + EZTitlebarButtonTypeEudicDic, +}; + @interface EZTitlebar () @property (nonatomic, strong) NSStackView *stackView; @@ -39,6 +46,9 @@ - (instancetype)initWithFrame:(NSRect)frameRect { return self; } +- (void)updateButtonsToolTip { + [self updateConstraints]; +} - (void)setup { self.buttonWidth = 24; @@ -272,7 +282,7 @@ - (EZOpenLinkButton *)googleButton { googleButton.link = EZGoogleWebSearchURL; googleButton.image = [[NSImage imageNamed:@"google_icon"] resizeToSize:self.imageSize]; - googleButton.toolTip = [NSString stringWithFormat:@"%@, %@", NSLocalizedString(@"open_in_google", nil), @" ⌘+⏎"]; + googleButton.toolTip = [self toolTipStrWithButtonType:EZTitlebarButtonTypeGoogle]; googleButton.contentTintColor = NSColor.clearColor; [googleButton mas_remakeConstraints:^(MASConstraintMaker *make) { @@ -289,7 +299,7 @@ - (EZOpenLinkButton *)appleDictionaryButton { appleDictButton.link = EZAppleDictionaryAppURLScheme; appleDictButton.image = [[NSImage imageNamed:EZServiceTypeAppleDictionary] resizeToSize:self.imageSize]; - appleDictButton.toolTip = [NSString stringWithFormat:@"%@, %@", NSLocalizedString(@"open_in_apple_dictionary", nil), @"⌘+⇧+D"]; + appleDictButton.toolTip = [self toolTipStrWithButtonType:EZTitlebarButtonTypeAppleDic]; appleDictButton.contentTintColor = NSColor.clearColor; [appleDictButton mas_remakeConstraints:^(MASConstraintMaker *make) { @@ -307,7 +317,7 @@ - (EZOpenLinkButton *)eudicButton { eudicButton.link = EZEudicAppURLScheme; eudicButton.image = [[NSImage imageNamed:@"Eudic"] resizeToSize:self.imageSize]; - eudicButton.toolTip = [NSString stringWithFormat:@"%@, %@", NSLocalizedString(@"open_in_eudic", nil), @"⌘+⇧+⏎"]; + eudicButton.toolTip = [self toolTipStrWithButtonType:EZTitlebarButtonTypeEudicDic]; eudicButton.contentTintColor = NSColor.clearColor; [eudicButton mas_remakeConstraints:^(MASConstraintMaker *make) { @@ -332,12 +342,33 @@ - (void)setPin:(BOOL)pin { #pragma mark - +- (NSString *)toolTipStrWithButtonType:(EZTitlebarButtonType)type { + NSString *toolTipStr = @""; + NSString *shortcutStr = @""; + NSString *hint = @""; + if (type == EZTitlebarButtonTypePin) { + shortcutStr = Configuration.shared.pinShortcutString; + hint = self.pin ? NSLocalizedString(@"unpin", nil) : NSLocalizedString(@"pin", nil); + } else if (type == EZTitlebarButtonTypeGoogle) { + shortcutStr = Configuration.shared.googleShortcutString; + hint = NSLocalizedString(@"open_in_google", nil); + } else if (type == EZTitlebarButtonTypeAppleDic) { + shortcutStr = Configuration.shared.appleDictShortcutString; + hint = NSLocalizedString(@"open_in_apple_dictionary", nil); + } else if (type == EZTitlebarButtonTypeEudicDic) { + shortcutStr = Configuration.shared.eudicDictShortcutString; + hint = NSLocalizedString(@"open_in_eudic", nil); + } + if (shortcutStr.length != 0) { + toolTipStr = [NSString stringWithFormat:@"%@, %@", hint, shortcutStr]; + } else { + toolTipStr = [NSString stringWithFormat:@"%@", hint]; + } + return toolTipStr; +} - (void)updatePinButton { - NSString *shortcut = @"⌘+P"; - NSString *action = self.pin ? NSLocalizedString(@"unpin", nil) : NSLocalizedString(@"pin", nil); - self.pinButton.toolTip = [NSString stringWithFormat:@"%@, %@", action, shortcut]; - + self.pinButton.toolTip = [self toolTipStrWithButtonType:EZTitlebarButtonTypePin]; CGFloat imageWidth = 18; CGSize imageSize = CGSizeMake(imageWidth, imageWidth); diff --git a/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.h b/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.h index ea4b03851..7da74dc54 100644 --- a/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.h +++ b/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.h @@ -94,6 +94,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)updateFloatingWindowType:(EZWindowType)floatingWindowType isShowing:(BOOL)isShowing; +- (void)updateWindowsTitlebar; + @end NS_ASSUME_NONNULL_END diff --git a/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m b/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m index 5197fd52c..0b36eabaf 100644 --- a/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m +++ b/Easydict/objc/ViewController/Window/WindowManager/EZWindowManager.m @@ -455,6 +455,12 @@ - (void)updateFloatingWindowType:(EZWindowType)floatingWindowType isShowing:(BOO // NSLog(@"after floatingWindowTypeArray: %@", self.floatingWindowTypeArray); } +- (void)updateWindowsTitlebar { + [_mainWindow.titleBar updateButtonsToolTip]; + [self.fixedWindow.titleBar updateButtonsToolTip]; + [self.miniWindow.titleBar updateButtonsToolTip]; +} + - (NSScreen *)getMouseLocatedScreen { NSPoint mouseLocation = [NSEvent mouseLocation]; // ???: self.endPoint