From 2a494027069b6099775d24261bbd5b828fe7e95f Mon Sep 17 00:00:00 2001 From: NeverAgain11 Date: Tue, 28 Nov 2023 11:32:01 +0800 Subject: [PATCH] add a condition check before adding the status item (#244) --- Easydict/Feature/StatusItem/EZMenuItemManager.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Easydict/Feature/StatusItem/EZMenuItemManager.m b/Easydict/Feature/StatusItem/EZMenuItemManager.m index 2535dca35..27eca55a2 100644 --- a/Easydict/Feature/StatusItem/EZMenuItemManager.m +++ b/Easydict/Feature/StatusItem/EZMenuItemManager.m @@ -13,6 +13,7 @@ #import "EZShortcut.h" #import #import "EZRightClickDetector.h" +#import "EZConfiguration.h" static CGFloat const kImageMenuItemHeightRatio = 1.4; static CGFloat const kTitleMenuItemHeightRatio = 1.2; @@ -71,6 +72,9 @@ - (void)setup { if (self.statusItem) { return; } + if (EZConfiguration.shared.hideMenuBarIcon) { + return; + } NSStatusItem *statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]; [statusItem setMenu:self.menu];