From 8a3715d39eca066ce1d2a5f83a74fb26289e569d Mon Sep 17 00:00:00 2001 From: choykarl <253440030@qq.com> Date: Thu, 1 Feb 2024 11:20:53 +0800 Subject: [PATCH] Modify menu bar icon (#370) * feat: modify menu bar icon * feat: use the debug icon in debug mode * Update Easydict/App/Localizable.xcstrings `Menubar icon` would do Co-authored-by: Tisfeng * perf(UI): adjust localization for menubar * fix: string catalog file * Update Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift * Update Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift * Update Easydict/NewApp/EasydictApp.swift Co-authored-by: Tisfeng * pref: optimize the use of MenuBarIconType * feat: switch icon colors based on the color scheme * pref: use .primary style * perf: rename MenuBarIconType enum value * Revert "perf(UI): adjust localization for menubar" This reverts commit dd4bfccecf44b3a9a3a7de6ad9c47a18068b1163. * perf: update menu bar icon, use original rendering mode in debug * perf: rename menu bar icon --------- Co-authored-by: Jerry Zhang Co-authored-by: Tisfeng Co-authored-by: Jerry <89069957+Jerry23011@users.noreply.github.com> --- .../Contents.json | 7 +++--- .../rounded.png | Bin 0 -> 4444 bytes .../Contents.json | 4 +--- .../square_menu_bar_icon.imageset/square.png | Bin 0 -> 2813 bytes .../status_icon.imageset/release_18.png | Bin 1489 -> 0 bytes .../status_icon.imageset/release_36.png | Bin 1756 -> 0 bytes .../status_icon.imageset/release_54.png | Bin 838 -> 0 bytes .../status_icon_debug.imageset/debug_20 1.png | Bin 1213 -> 0 bytes .../status_icon_debug.imageset/debug_40 1.png | Bin 2122 -> 0 bytes .../status_icon_debug.imageset/debug_60 1.png | Bin 1101 -> 0 bytes Easydict/App/Localizable.xcstrings | 19 ++++++++++++++- .../Feature/StatusItem/EZMenuItemManager.m | 4 ++-- .../Configuration+Defaults.swift | 1 + Easydict/NewApp/EasydictApp.swift | 22 +++++++++++------- .../View/SettingView/Tabs/GeneralTab.swift | 13 +++++++++++ 15 files changed, 53 insertions(+), 17 deletions(-) rename Easydict/App/Assets.xcassets/menu-icon/{status_icon.imageset => rounded_menu_bar_icon.imageset}/Contents.json (70%) create mode 100644 Easydict/App/Assets.xcassets/menu-icon/rounded_menu_bar_icon.imageset/rounded.png rename Easydict/App/Assets.xcassets/menu-icon/{status_icon_debug.imageset => square_menu_bar_icon.imageset}/Contents.json (70%) create mode 100644 Easydict/App/Assets.xcassets/menu-icon/square_menu_bar_icon.imageset/square.png delete mode 100644 Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/release_18.png delete mode 100644 Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/release_36.png delete mode 100644 Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/release_54.png delete mode 100644 Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_20 1.png delete mode 100644 Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_40 1.png delete mode 100644 Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_60 1.png diff --git a/Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/Contents.json b/Easydict/App/Assets.xcassets/menu-icon/rounded_menu_bar_icon.imageset/Contents.json similarity index 70% rename from Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/Contents.json rename to Easydict/App/Assets.xcassets/menu-icon/rounded_menu_bar_icon.imageset/Contents.json index d0d1860d8..ca238cdf9 100644 --- a/Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/Contents.json +++ b/Easydict/App/Assets.xcassets/menu-icon/rounded_menu_bar_icon.imageset/Contents.json @@ -1,17 +1,15 @@ { "images" : [ { - "filename" : "release_18.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "release_36.png", + "filename" : "rounded.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "release_54.png", "idiom" : "universal", "scale" : "3x" } @@ -19,5 +17,8 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "localizable" : true } } diff --git a/Easydict/App/Assets.xcassets/menu-icon/rounded_menu_bar_icon.imageset/rounded.png b/Easydict/App/Assets.xcassets/menu-icon/rounded_menu_bar_icon.imageset/rounded.png new file mode 100644 index 0000000000000000000000000000000000000000..72cd3f20084652e98713eade6c81028f7eee37aa GIT binary patch literal 4444 zcmZ`-c|25o`#xihEHNm%nQRF&h-@Qd&C*z7vS%=sF&LRbOpPRaBFYR?$l8M}5kd>4 zAw;%EWKW{WLzeU#)%(=1&-hGFqFurdIEs?@#Po~(>}sWWD_Rse8b764*N0IavN=Q837X7$=t`v3Q%D9djM7tKfuiJK#UUri2%FVb}O6!iT>-`g5-a4m;fLi z1F-z$pcr=dFk`G;%@50*5BilcpXpz=Vm|XPe^IdlMC8Znc?W1jLWb#waxI;kw@OYdy3>Fa)p&X&6 z931KkQ_<4Wg27c`s;Wv1hEmu$EZ&o#gbh3RBgudA7@@(tKV;wM`cY1IH<`AxEjlbX zFnqTyy`!qS-z)q-@K=971i$zWSPWk8KaxM-KUGe@;=juL4*n@P8HzzO9_07FRDQPg zJN6rYcRFn(hJX%qGQtF*v0=NjsKa$(|26QZ@OW@waHt*5^9)*#QRlnlH|S6H_cG4^ ztIThKpF&;O?z{f&-T&BF-%-ZS(&N;H{ku!`IDHTBEigW2thteay%Wchb3mZWQ$ano z_3>!JSJbg<+0swaOf8c5PxRT!D_9?rk+N66{s43$-7lTUkCK<_m86+up5S9bNpKK3 zH}4qBT#khnT)g(8$UYg#v7F7K14)xl`7|oJJoT|z?Q8d#Yvdc}Tgc73wx+1Jk-oFJ z8?#NmmaE4GpOj1uT;%_oM~VIEr?mV@89fBvt(>;dw(8Vt>Z`%j#{`hik4nzd9!diDU>Uwq=2dMj2ovAC=z z?@?C0|9jbIRJ{yd*Qsj7REZGtP~TPL9}Xzn`|lCUsgK9IXpV>n@=#)BtZ;$(mbq#jEwQU zTf|#NA3?>ry{iAKTM#&cUD~)x-{wYLNfKaTH4kj7ms&TV4tVx(iVFugZP$Ueg!2=D zOS;GSS0;{CR3ILS`GJFJK0crcQr+-WfCK_pHAA`pGCh%QtIsxWczR-4!Q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on.imageset/release_18.png deleted file mode 100644 index 24e2328eb4a8f26bfceeb22e907cf004ecd8bff2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1489 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lxRtf@J#ddWzYh$IT%Q&?xfOIj~R9FF-xv3?I3Kh9IdBs*0wn|_XRzNmLSYJs2tfVB{Rw=?aK*2e`C{@8s z&p^*W$&O1wLBXadCCw_x#SN+*$g@?-C@Cqh($_C9FV`zK*2^zS*Eh7ZwA42+(l;{F z1**_3uFNY*tkBIXR)!b?Gsh*hIJqdZpd>RtPXT0ZVp4u-iLH_n$Rap^xU(cP4PjGW zG1OZ?59)(t^bPe4^s#A6t;oco4I~562KE=kIvbE-R*^xe#rZj)0j_clpZ(YC~^4QbGF~mZ!cglY6utbrD_tP_z>?d4fQ8Tw5!0vbGd_|W0w|mwB z>naML#?5GT-C(6%v@rexXV|nwxvKsT^H?@Fe|q4;61+9>%hKY;vd66*(|f%lS=PB5 zd{y};)#G+YGOD)v$M%cnhxD|>Pkrj^h&o%KV#_(VI9U7ihM+aq9!|M7&pp7D!~TKo zn}f0eMPVynZ`|B@ebSyx>)8fu+l*Pda$iROHLeidChM{DqZ9MS_qsP4%^x`5WJ(KO zwsD`SEl)X66aR+l1KaWriPW@58}NNUXnBvB|AFw0S9()ob?5Y_&$;;P=FvV#*puwU5r zP3qS|OX60p9PEyK?RkktDnm{r-UW|!#D5l diff --git a/Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/release_36.png b/Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/release_36.png deleted file mode 100644 index 2a7dbe54091ec3c3907821f84a15b24ed98e3372..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1756 zcmY*Z2~-nT6#WAf5>hn~7J(w;Kr5moY*N4w0TUs}E|jgcgpiadfsh0N2_A?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75>!ZNOA8bTg@j{Ihlqh8sr^m2~4wqHtcsS8d-UK(~UaJ zlT6Q%5((pW+r`IQ6{8w1o+l%&s&}jJ+qw3ez{%$gH_7&0U>?) z(AE41mxl}Ea=)D!A7ZB=(LTY}O(qARoDC<$F>`ml+YjA3Di04i*E8x|G|^QvtdD7a zGSuAW-!^v>_Faixvt9k7_=Pt0)y))hN~~n7m#>>`#JRuKWk!YDcHOp2Fo-Pol)=vl znKK13^8Et2f>smG7fhvy3y*RGB52t02BVHgl=IQOiw3O@I|^s|T-%w8;Ny=>?t1)n Q!Cm*yrqjZx%77&CKOA_s^#A|> diff --git a/Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/release_54.png b/Easydict/App/Assets.xcassets/menu-icon/status_icon.imageset/release_54.png deleted file mode 100644 index 22fa1bbc39c439db39b2000287a6a797921c3df1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 838 zcmV-M1G)T(P)Px&07*naRA@u(noGz{Q5462-_*o}sVGS(N{A5>6B(f-kpUSD5{m1At48d1U=pAWV;^wRJi7y|Y73Yu ziw#EXbwIE(=$KpG0BcgrT+q}9y=+6b^Lf=H|pxQL_9m^s(v~44{`%tl2+I1FeQ}2!>%VLDK9jh}GB~pjh zv?AF3MKkReSLMA-MR4e972Pf*K@ZGXx5q*jVF+edY20}%Bt*(+<2!g37K&vE4jEGw zMQn8+w0VSxD5Fi`U`_dxSm9ubYyGWH_v>|9;b3*bls0##|6y9%s?|C0A3;$5YdPx# diff --git a/Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_20 1.png b/Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_20 1.png deleted file mode 100644 index 9f51401bcb4027976e1319cc6db548a5badc1c7b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1213 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>>x%Bs2U~)hW1Pb7O0viAPoW@Kn&6Yp_vyjB1~Ms z1XnGxfEmFCX>)u&_aBhrEbxddW?VstT4fPE4;bsH1+JHo@{EISEfi{E8w==W>t3(ll+GC>+vK+}V5TAlYfnK%a zveAbJn;n;A+(UK-1|~aC7sn6_!P?1Zy~7+u+SiBOY7Y=`>TW5QUMAor?~%XW!adpqcnZe@jnBAWLU!=V_*czJgyE^^Wwe5NQj`I&XYt=e_Sje;@4pe#Y|o zyqT89+n4^>AH|U$9whVrT=LtqK4qdu*LfB2e-o2w(JtV4=D1&8yL+~>SaD8oQIPP` zl7#I|C-oBrR#}~Vp!KIow1QWDVccSi_Rp3!t>GWo#U60(X*j-MUGwDdow*E0^DaM7 zJMZzU^RIRP*2DSQRu4qJILV)B`1p9isYTNzC3Y}=JE!a4RP>pw*5=yaC7F zewY5iw)D=b&c@Z8x4#R?G+xkX+x{TJqN4iJQmc*U4slxWXB)8cTJU~5wN|S*X;byd zV3D^!=f?R?{rF>{yw8#s=ag@KRycn56+1`$9Oqw3bNKGe`u=ep^OHBcws-jZM6v++l_ z*~a}1_D%Jt)H8y7E<9PoyXw0xpLS5xYd&T%(eSl<4xAD$S6#PCEBl7f=WYL(cI@c- T_~!XfaHjNh^>bP0l+XkKM{2R( diff --git a/Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_40 1.png b/Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_40 1.png deleted file mode 100644 index 76d13685bc8c1c88262d538bb0dda064c85737e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2122 zcmY*ad0dj&8a}w-icMm7T(EHTKN)D8?_LF_d07%Xld|+xrd(^(|R9^rN+W?S!9DoIgN`4JM z91Z{_0{~(c0H)Eo_X0@J!ErX-Gu+n~`~YEHpbawynh=6P4}e(!wHt(h7tHc2rou2^ zG#UW>GZJWh(d>eiecXz#TsAL7_sIztS(C*G$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kq*PdzPz%wyJxh--`AO;6fj?63s_O-76iC}^KCC2eWw1T z*6D>Z7Ou~FYb1)e_`j4!DI=rq#(UZ)g2Z)|J&Bzw8_<=~Osk?Ca*lOTLLRl{R$NFA z-hApWxq+yuq*i-QHl(P^T%nNp$KQxwc&Dl;e3gOoA&8%lklm_bmaKVxn?xG>V}|*a z;9F6rZr_kDT{z6uyffU#w1|7~D=~a!S-&4kL0Es%VqP>o{$uLD1|~0^Y41#XlT&uS zyq%R0E-tOxRM0iSc`L@eypMSK0Uw=tZ%IdHI~S%}*Qc>2h3u-~?Upw;Xwj#s>~C^2 zY9v*{Kj4J^iSTNMmquY??scA1LNS`S$Q!Z^nrsRmIWiTLUeL11y>1P|M3jE^zu6IhF?HrVr<-9C%RUv*Di@|@qUYq)mG$e1SPx>WI Vq|;VcsH^@%dT#Y|zqN&N>_0c8jX3}S diff --git a/Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_60 1.png b/Easydict/App/Assets.xcassets/menu-icon/status_icon_debug.imageset/debug_60 1.png deleted file mode 100644 index 0e7cca491c9fea1adad0cdf802c1fd5dafe1fa33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1101 zcmV-T1hV^yP)Px(2T4RhRA@u(npvn$Q5462Hy$WMUX?NrNk}rs1L0A4A#)*9NFom?4~8OSC}fH! z51tIA%wxuq$V_=uNGPI}@7#`k*ZI!c=bWqk-FsGj58pZewb%OZ|Jm#8z0a?hEOZ=R16_+EY%MZ*a6W`P0#AXqj#C%l zO;STX3g;oxSTnMVz!-blgh9@!lvEuJner$P|t9 zsnUXN)JIyItGeSylCa|PE?gqQS|=4!w0wI%4POM|v=|NU`;1}l##0mTB=g)}rNASYqI68v>bzL?)+{gz~l-HNODZUqwaP z+Bxd0a^B>u?_uA(1TVW6J*zlA0tWat94cWU^1wi*Pi2W{fc}MqO86Ks!(nkrSqjR| z$6_~>;(0lEP%l^u@hz)7phArh8PDKfE$TlC)5 z-phA^!T*b}HI5Z0iOcsR*Tw-CfC-gPEbje&2{W<=4dqqXO2mpg0Zeni4}pQPYx2Lp zgV_lzw**NeoHXOI&crM^#4%b;SOaW{fz|<=vKB83VXr+SUxqRK3Shh9-x+utyDr!oz{>KHRc$CTOsl~5oL-p*)TYqm2fBEo#T8T zkTLh8pbTZEG^n7qq?yagBBQ?fG=&BD9O&*Ov=-Q0K$4>YSp~T!Gph53_QwO~6r9Z1 zq$3-ch43z5sp4A%>4U&Lr|r)`djr`B@<}-nAd3(6gpY-=G%TwW?L+ei;2t24c{S5! zX03sbl_C@OH6Ku^IB8!Wz5yMyVP_>g3b^9Y>n>D_qb&o)Pt+BattRI^L}k}xS5sD5 z|Cp7qIB7j;O-hS%Q#php<5tG6ugN%;@f^2nfC!bDusHUr>=X|1%*Z7?GT|_pwOF~~ zlZuy|__-Aa`zRdu+X_qpWFl`dH;#57#kW|wakb(laTXOpIBG*yGP1*%wp|)8T5W(; zN-xRM&~%zEp@)-}ta6m;YvhwvVT-CkVoJh6%2HrbrNRYvW{^#l3I{1mfl2)VXfww> T0qogd00000NkvXXu0mjf)p!0x diff --git a/Easydict/App/Localizable.xcstrings b/Easydict/App/Localizable.xcstrings index bfb9668af..0819e750d 100644 --- a/Easydict/App/Localizable.xcstrings +++ b/Easydict/App/Localizable.xcstrings @@ -1805,6 +1805,23 @@ } } }, + "modify_menubar_icon" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Menu bar icon" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "菜单栏图标" + } + } + } + }, "mouse_select_translate_window_type" : { "localizations" : { "en" : { @@ -3467,4 +3484,4 @@ } }, "version" : "1.0" -} +} \ No newline at end of file diff --git a/Easydict/Feature/StatusItem/EZMenuItemManager.m b/Easydict/Feature/StatusItem/EZMenuItemManager.m index 9f40e3fc9..81497fd5e 100644 --- a/Easydict/Feature/StatusItem/EZMenuItemManager.m +++ b/Easydict/Feature/StatusItem/EZMenuItemManager.m @@ -83,9 +83,9 @@ - (void)setup { NSStatusBarButton *button = statusItem.button; #if DEBUG - NSImage *image = [NSImage imageNamed:@"status_icon_debug"]; + NSImage *image = [NSImage imageNamed:@"rounded_menu_bar_icon"]; #else - NSImage *image = [NSImage imageNamed:@"status_icon"]; + NSImage *image = [NSImage imageNamed:@"square_menu_bar_icon"]; #endif [button setImage:image]; diff --git a/Easydict/NewApp/Configuration/Configuration+Defaults.swift b/Easydict/NewApp/Configuration/Configuration+Defaults.swift index 2cafce5ed..b8ab739dd 100644 --- a/Easydict/NewApp/Configuration/Configuration+Defaults.swift +++ b/Easydict/NewApp/Configuration/Configuration+Defaults.swift @@ -52,6 +52,7 @@ extension Defaults.Keys { static let appearanceType = Key("EZConfiguration_kApperanceKey", default: .followSystem) static let fontSizeOptionIndex = Key("EZConfiguration_kTranslationControllerFontKey", default: 0) + static let selectedMenuBarIcon = Key("EZConfiguration_kSelectedMenuBarIconKey", default: .square) } extension Defaults.Keys { diff --git a/Easydict/NewApp/EasydictApp.swift b/Easydict/NewApp/EasydictApp.swift index bb3e1be41..95e985b93 100644 --- a/Easydict/NewApp/EasydictApp.swift +++ b/Easydict/NewApp/EasydictApp.swift @@ -31,13 +31,8 @@ struct EasydictApp: App { @AppStorage(Defaults.Key.hideMenuBarIcon.name) private var hideMenuBar = Defaults.Key.hideMenuBarIcon.defaultValue - private var menuBarImage: String { - #if DEBUG - "status_icon_debug" - #else - "status_icon" - #endif - } + @Default(.selectedMenuBarIcon) + private var menuBarIcon var body: some Scene { if #available(macOS 13, *) { @@ -47,9 +42,13 @@ struct EasydictApp: App { Label { Text("Easydict") } icon: { - Image(menuBarImage) + Image(menuBarIcon.rawValue) .resizable() + #if DEBUG + .renderingMode(.original) + #else .renderingMode(.template) + #endif .scaledToFit() } .help("Easydict 🍃") @@ -67,3 +66,10 @@ extension Bool { mutating set { self = newValue.toggledValue } } } + +enum MenuBarIconType: String, CaseIterable, Defaults.Serializable, Identifiable { + var id: Self { self } + + case square = "square_menu_bar_icon" + case rounded = "rounded_menu_bar_icon" +} diff --git a/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift b/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift index 26e427fee..a1e59e04e 100644 --- a/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift +++ b/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift @@ -11,6 +11,8 @@ import SwiftUI @available(macOS 13, *) struct GeneralTab: View { + @Environment(\.colorScheme) var colorScheme + var body: some View { Form { Section { @@ -136,6 +138,16 @@ struct GeneralTab: View { Toggle(isOn: $hideMenuBarIcon) { Text("hide_menu_bar_icon") } + Picker( + "modify_menubar_icon", + selection: $selectedMenuBarIcon + ) { + ForEach(MenuBarIconType.allCases) { option in + Image(option.rawValue) + .renderingMode(.template) + .foregroundStyle(.primary) + } + } } header: { Text("setting.general.other.header") } @@ -180,6 +192,7 @@ struct GeneralTab: View { @Default(.appearanceType) private var appearanceType @Default(.fontSizeOptionIndex) private var fontSizeOptionIndex + @Default(.selectedMenuBarIcon) private var selectedMenuBarIcon } @available(macOS 13, *)