From e29cf19fddc6878f7e24c442f83d6ff0d23fa6b8 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 16 Jan 2019 01:00:42 +0530 Subject: [PATCH] macOS: Different status bar icon looks for different states - Looks dimmed when no tunnel is active - Looks normal when a tunnel is active - Animates when a tunnel is activating Signed-off-by: Roopesh Chander --- WireGuard/WireGuard.xcodeproj/project.pbxproj | 4 ++ .../WireGuard/Tunnel/TunnelsManager.swift | 4 ++ .../WireGuard/UI/macOS/AppDelegate.swift | 23 +++--- .../Contents.json | 9 ++- .../StatusBarIcon@1x.png | Bin 0 -> 978 bytes .../StatusBarIcon@2x.png | Bin 0 -> 1722 bytes .../StatusBarIcon@3x.png | Bin 0 -> 1975 bytes .../Contents.json | 26 +++++++ .../StatusBarIconDimmed@1x.png | Bin 0 -> 881 bytes .../StatusBarIconDimmed@2x.png | Bin 0 -> 1390 bytes .../StatusBarIconDimmed@3x.png | Bin 0 -> 1581 bytes .../StatusBarIconDot1.imageset/Contents.json | 26 +++++++ .../StatusBarIconDot1@1x.png | Bin 0 -> 953 bytes .../StatusBarIconDot1@2x.png | Bin 0 -> 1570 bytes .../StatusBarIconDot1@3x.png | Bin 0 -> 1744 bytes .../StatusBarIconDot2.imageset/Contents.json | 26 +++++++ .../StatusBarIconDot2@1x.png | Bin 0 -> 942 bytes .../StatusBarIconDot2@2x.png | Bin 0 -> 1502 bytes .../StatusBarIconDot2@3x.png | Bin 0 -> 1676 bytes .../StatusBarIconDot3.imageset/Contents.json | 26 +++++++ .../StatusBarIconDot3@1x.png | Bin 0 -> 958 bytes .../StatusBarIconDot3@2x.png | Bin 0 -> 1521 bytes .../StatusBarIconDot3@3x.png | Bin 0 -> 1677 bytes .../WireGuardMacStatusBarIcon@1x.png | Bin 990 -> 0 bytes .../WireGuardMacStatusBarIcon@2x.png | Bin 1714 -> 0 bytes .../WireGuardMacStatusBarIcon@3x.png | Bin 1956 -> 0 bytes .../UI/macOS/StatusItemController.swift | 66 ++++++++++++++++++ WireGuard/WireGuard/UI/macOS/StatusMenu.swift | 15 +++- 28 files changed, 209 insertions(+), 16 deletions(-) rename WireGuard/WireGuard/UI/macOS/Assets.xcassets/{WireGuardMacStatusBarIcon.imageset => StatusBarIcon.imageset}/Contents.json (57%) create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@1x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@2x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@3x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/Contents.json create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/StatusBarIconDimmed@1x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/StatusBarIconDimmed@2x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/StatusBarIconDimmed@3x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot1.imageset/Contents.json create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot1.imageset/StatusBarIconDot1@1x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot1.imageset/StatusBarIconDot1@2x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot1.imageset/StatusBarIconDot1@3x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/Contents.json create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/StatusBarIconDot2@1x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/StatusBarIconDot2@2x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/StatusBarIconDot2@3x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/Contents.json create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/StatusBarIconDot3@1x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/StatusBarIconDot3@2x.png create mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/StatusBarIconDot3@3x.png delete mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@1x.png delete mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@2x.png delete mode 100644 WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@3x.png create mode 100644 WireGuard/WireGuard/UI/macOS/StatusItemController.swift diff --git a/WireGuard/WireGuard.xcodeproj/project.pbxproj b/WireGuard/WireGuard.xcodeproj/project.pbxproj index a5119b6..b6b1c32 100644 --- a/WireGuard/WireGuard.xcodeproj/project.pbxproj +++ b/WireGuard/WireGuard.xcodeproj/project.pbxproj @@ -54,6 +54,7 @@ 6F7774EF21722D97006A79B3 /* TunnelsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7774EE21722D97006A79B3 /* TunnelsManager.swift */; }; 6F7774F321774263006A79B3 /* TunnelEditTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7774F221774263006A79B3 /* TunnelEditTableViewController.swift */; }; 6F7F7E5F21C7D74B00527607 /* TunnelErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7F7E5E21C7D74B00527607 /* TunnelErrors.swift */; }; + 6F89E17A21EDEB0E00C97BB9 /* StatusItemController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F89E17921EDEB0E00C97BB9 /* StatusItemController.swift */; }; 6F919EC3218A2AE90023B400 /* ErrorPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F919EC2218A2AE90023B400 /* ErrorPresenter.swift */; }; 6F919ED9218C65C50023B400 /* wireguard_doc_logo_22x29.png in Resources */ = {isa = PBXBuildFile; fileRef = 6F919ED5218C65C50023B400 /* wireguard_doc_logo_22x29.png */; }; 6F919EDA218C65C50023B400 /* wireguard_doc_logo_44x58.png in Resources */ = {isa = PBXBuildFile; fileRef = 6F919ED6218C65C50023B400 /* wireguard_doc_logo_44x58.png */; }; @@ -263,6 +264,7 @@ 6F7774EE21722D97006A79B3 /* TunnelsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelsManager.swift; sourceTree = ""; }; 6F7774F221774263006A79B3 /* TunnelEditTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelEditTableViewController.swift; sourceTree = ""; }; 6F7F7E5E21C7D74B00527607 /* TunnelErrors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelErrors.swift; sourceTree = ""; }; + 6F89E17921EDEB0E00C97BB9 /* StatusItemController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusItemController.swift; sourceTree = ""; }; 6F919EC2218A2AE90023B400 /* ErrorPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorPresenter.swift; sourceTree = ""; }; 6F919ED5218C65C50023B400 /* wireguard_doc_logo_22x29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wireguard_doc_logo_22x29.png; sourceTree = ""; }; 6F919ED6218C65C50023B400 /* wireguard_doc_logo_44x58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wireguard_doc_logo_44x58.png; sourceTree = ""; }; @@ -512,6 +514,7 @@ 6FBA104421D7EA750051C35F /* ViewController */, 6FBA101321D613F30051C35F /* Application.swift */, 6FB1BD5F21D2607A00A991BF /* AppDelegate.swift */, + 6F89E17921EDEB0E00C97BB9 /* StatusItemController.swift */, 6FBA101621D655340051C35F /* StatusMenu.swift */, 6FBA104121D6BC210051C35F /* ErrorPresenter.swift */, 6FCD99AE21E0EA1700BA4C82 /* ImportPanelPresenter.swift */, @@ -1111,6 +1114,7 @@ 6FB1BDBC21D50F0200A991BF /* ringlogger.c in Sources */, 6FB1BDBD21D50F0200A991BF /* ringlogger.h in Sources */, 6FBA103F21D6B6FF0051C35F /* TunnelImporter.swift in Sources */, + 6F89E17A21EDEB0E00C97BB9 /* StatusItemController.swift in Sources */, 6F4DD16B21DA558800690EAE /* TunnelListRow.swift in Sources */, 5F52D0BF21E3788900283CEA /* NSColor+Hex.swift in Sources */, 6FB1BDBE21D50F0200A991BF /* Logger.swift in Sources */, diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index 4476c4a..1b3cc50 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -222,6 +222,10 @@ class TunnelsManager { return tunnels.first { $0.name == tunnelName } } + func waitingTunnel() -> TunnelContainer? { + return tunnels.first { $0.status == .waiting } + } + func startActivation(of tunnel: TunnelContainer) { guard tunnels.contains(tunnel) else { return } // Ensure it's not deleted guard tunnel.status == .inactive else { diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift index a08f9dc..3f08987 100644 --- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift +++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift @@ -6,7 +6,8 @@ import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { - var statusItem: NSStatusItem? + var statusItemController: StatusItemController? + var currentTunnelStatusObserver: AnyObject? func applicationDidFinishLaunching(_ aNotification: Notification) { Logger.configureGlobal(withFilePath: FileManager.appLogFileURL?.path) @@ -19,21 +20,19 @@ class AppDelegate: NSObject, NSApplicationDelegate { } let tunnelsManager: TunnelsManager = result.value! + let statusItemController = StatusItemController() + let statusMenu = StatusMenu(tunnelsManager: tunnelsManager) - self.statusItem = createStatusBarItem(with: statusMenu) + + statusItemController.statusItem.menu = statusMenu + statusItemController.currentTunnel = statusMenu.currentTunnel + self.currentTunnelStatusObserver = statusMenu.observe(\.currentTunnel) { statusMenu, _ in + statusItemController.currentTunnel = statusMenu.currentTunnel + } + self.statusItemController = statusItemController tunnelsManager.tunnelsListDelegate = statusMenu tunnelsManager.activationDelegate = statusMenu } } } - -func createStatusBarItem(with statusMenu: StatusMenu) -> NSStatusItem { - let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength) - if let statusBarImage = NSImage(named: "WireGuardMacStatusBarIcon") { - statusBarImage.isTemplate = true - statusItem.button?.image = statusBarImage - } - statusItem.menu = statusMenu - return statusItem -} diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/Contents.json b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/Contents.json similarity index 57% rename from WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/Contents.json rename to WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/Contents.json index 2adee86..c878d79 100644 --- a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/Contents.json +++ b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/Contents.json @@ -2,22 +2,25 @@ "images" : [ { "idiom" : "universal", - "filename" : "WireGuardMacStatusBarIcon@1x.png", + "filename" : "StatusBarIcon@1x.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "WireGuardMacStatusBarIcon@2x.png", + "filename" : "StatusBarIcon@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "WireGuardMacStatusBarIcon@3x.png", + "filename" : "StatusBarIcon@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "template" } } \ No newline at end of file diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@1x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..c0a43e770fc50067a049029c44d332e94d58b012 GIT binary patch literal 978 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6Ea{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP+vfR zPlzi}!6=|s2>k#5U!{5NGN5sJB|(0{3@pq%LH&7hs>Msb{@D?4!X&=u+mlmeY>e(l z{+XEyayV@Kc_UcaD{S_MkCp6PcYl4qw*PbH!#C$<37zbe&^dH=!LxT&Z;P&Gu=f1W z?0DKe;m-S{h4;=EJl_!N)W^3{z;JHqvJy$*P1*-`zOa5YWx3^v9YC8Ilf2zs@t9c`WY+lDlId#$&j# za-PSbLY0|GyRC>;Zj z8*0z2jxX+B#K;i#Qp4$z(anRv5Kt{~jVMV;EJ?LWE=mPb3`PcqmbwOpx`w79hNf1= s##V;r+6Jap1_nl&r`%CAoT7)78&qol`;+00~dv=Kufz literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@2x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2057c3177cee30c2e99e405e07e0f2f11d717d60 GIT binary patch literal 1722 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!3?wz9Rv7~+mUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$Ysfq}^_ zz$e5Ns9+R~h5#iY@c;jR>7GomnL`l#M&z z{C!!-!(Vyw*#18ku5Fptt;Ia?+vf+jJ2)f0|9Y`^PqQ|Q^woby^JDY$%==cY5tOa{ zu~1zo%v1dRGZB}H{+=9%;t$mvzkjZ14CSl8G4<|lwy$^Qe6oGK`NYTVkxjh9hodhh zfAKxD{mw7TAAG~=ES z4w!$YdAc};Se#BySRi6xB(!!)=giiry>pu^Tgs5oiYG-G5_doxNi^?9duPiH7R=T5OdDr$wLznH|J)N9s@{aMLOPSeo za{iih2A+HHUWUQM=0anD13PPbOIxeE%PXc(ch}<&g0mi+mKLpk;4sItrpYv*)ImvZ ztLI6f3lf$SCe30~x!hW~>g`wfshBR;rF=3M8c%GxBG<8+ zS!#Zhabd(2=Gco2X=Y}!0fDS-iN?lyM|Ia8P`SvKw(WIU36rwnWx4c(DP@ecSMD_9ek;{GYPxtOlkkzQsb|;(;~b{>nyqunnY!w1V^M;Lyv8P`!rCN`^%QF<>UHxjvx6fx0;l>X0|pSjWRH}_r=W7 zxmGLSqe_kA^701_7t=Uqi_TbA^yhUC&jn;cNhqY_Uj@YUPYr3_cBqWrZD>c8r<-9`e7H^k}Ku4@X#z_Z`H#xJHnj3pf zpI)u+xKv?-f6mi7_4-9qf;br%&fk^Z9c!0f2284|C9V-ADTyViR>?)FK#IZ0z|d0H zz);uFG{n%<%GlV-&|KTV)XKoXNb{6CiiX_$l+3hB+!~xqihct%FnGH9xvX{q literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@3x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..60cc363a0d581f229e522d73ec8238a50823b0d3 GIT binary patch literal 1975 zcme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ts5iS%D4 literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/Contents.json b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/Contents.json new file mode 100644 index 0000000..aeb8a8e --- /dev/null +++ b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "StatusBarIconDimmed@1x.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "StatusBarIconDimmed@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "StatusBarIconDimmed@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "template" + } +} \ No newline at end of file diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/StatusBarIconDimmed@1x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/StatusBarIconDimmed@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..fb9d8f799f00f06fa1582ab0a6f25d091951f71f GIT binary patch literal 881 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6Ea{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP#<@I zPlzi}!6*QR!2kdMAC?IE0a+0xL4LsuOpI(=9v1w3v(u?A8+@l6fY#i=&TD#?w~ zoGc2Fb-6;S+J2Q)wygO%37V$0*@fllu3|}nB^7p-ChnpxZk~qC1sUe05sESFp&XL_ z)*-x!az)-B_m}hjX* z$ynrbN^4ctE2&v4(lQFOw2NN9$m)2pkmI$qhLn`2^lXlmiruHWJZE#wn8`icBU*u5 zJ38v4u|b5iwAbwg7PkT}P76Hbchcdu+)-IRr)hnDw`{`BWz=oCaIwI!pfuUJaL1b6 zv)KEWuaez9ReTeFr0d-!ds8KAYGU6^X!-l)4|9x6LyyCBg^`ovMyGm^HCW}IOrH%!*ONl8xnW)9|QfaTH+c}l9E`G zYL#4+3Zxi}3=A!G4GeV+O+yS#t&EMW49&F-OsxzIj5JTVqiD#@PsvQH#I3=(r06$L O1B0ilpUXO@geCyKYR@tN literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/StatusBarIconDimmed@2x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDimmed.imageset/StatusBarIconDimmed@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2f4e6135b6b2d56eaa146258555554906f9e4853 GIT binary patch literal 1390 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!3?wz9Rv7~+mUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBs4qLf zC&U$~U=+|H1pWhol;fgIc!r? zavSP0bE3T6#5|j-s|sCoYHH)1nE0}jE%e1@Ji@{``RxO>qbp0el-^o-O6(;~~{c$*_kWn+zlGYZlrLlV7;1=I|rxm8*gUHSlY17ni6yGzBj z+fUqp9L@rd$YLPv0mg18v+Wodm~uT`978NlubuKY{!)O*u}W@%L`JE0mYoN9%mu=j zgl6a)Y}H9&dBG&?ba;!#l}rEro|FAs_5MfAt3M^%Ys<^tf3~p}JH3C}RV(YP&DL_3 zvF~oauspx#y1LCb_A|fP#NTxL*C;l82%asuN2F7)I$6=_QRk8!pL9|$RfbM#NI3bj zM`6v!?RjUPX?RVEx$*mtYu4Q3&y-o4b@Qfdy4gGZ&%URp(s&{(wwgBQy>5IfEB`L? zX6y{tXS(%U#hmuMh?vj1okd$q;KpqO;i~@%L6v`>eaL0Y{3;v1qw4DFV~rXQ7rQZL zu054F`+aSjJd47%OH4{zn|;h4oMdEu$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}!6+am1pfd3e|3vuI#6j+NswPK10##1juI!2vXQs1g{%O(rJt9ptqPNvjW(-@ znU5p4l)k4bv$K_uhnBsIyPe+hA79pos4rREDl98Q0f69{uN8iqv@`OdOtjyD^sPu8E z|ECWjpFa70`q;|x`{!;J7OQM_*7laH4{eq|R~_aNzcP{U`=tq?pDrc27Fq6yPQ0dv54#T%A(ar zKNh@Rv6#zPV+Gf-BN^%mE_3E)EGp7ru47;@F;J26PM)s_3?bDL*NBpo#FA92iqx! literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot1.imageset/StatusBarIconDot1@2x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot1.imageset/StatusBarIconDot1@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..01b5eb37d0337bff2eeff2c53264f7b363f7c19e GIT binary patch literal 1570 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!3?wz9Rv7~+mUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBsBdS0 zPlzi}!6+DVA@KkI|BX-W#DVUfSQ6wH%)rRPEiNm?&%~pmZ{^`+D9SFN<>TkB%&KZ@ z<7@9|uE(q6<>|sK?QN;Sp(Mj6sBOZjCgP^ZW~{F3Y>+*zKitgK;_%N;JJRi{dNQmP zlB3V;4SV?aR!!rB(@kF_9-WUVe7 zv%kM@jtVNNTs$|;NS@1IQcN!3kN5?k;~0~?-CZV4V|lLtvL>2>S4={E+nQh0w zz_iQL#WBR<^x7%E!!IRB92XQ7*nToWziE$AsHwT@5mm2=I zZhzLTe~;&tzpxB4dU56R;dABBYrcJY`rGDw_U6CYTmP_T<>zLXTg0BdDErQ@D{YsJ z?}Hro)z{sNIezYb+k3-dgSv~MMDjZGGv9yyS}VI*utnfNgn(+>N7uD4XZQr@aMxue zY`AYUv%(-})53)=I%Xz0Z!KpAbt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$ z&vAz3T+_dqp)AUNab+!xy&7zux7%5`t(y*O2Hk1v)_=HY?SYth4>1+jz6Ue92;fk9e)!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP@hhK zPlzi}!6+am1pfd3e|3vuI#6j+NswPK10##1juI!2vXQs1g{%O(rJt9ptqPNvjW(-@ znU5p4l)k4bv$MOMe0XPju%5=W{t%~K|NiXmmR^+h`%B^G%9#Z}Kb1L5&zG^<_I<68 zVNg|(qMNa}mIs?ZzkwzPuZx_nMy0AC&^E>-Z+DmEn0>mdfE>;OkH}&m?E%JaC$sH< z3Ya`y977~7Cnq#8yScIHG<42voyzMxWp4B2?%D0r`F*+fHz;hMu%Tmx#HtNDS`@ac z$j=vWdXj9Rd7u$?Zb!%&AX=*N>weZkFttHF!7N{KQSu@44x!XI~JK8-qK>T5q zZ7s92o^rBqu(7G0Z*4L6iVbx^la@}LS{gK|ckP7Oph>nNH*8K`alCO+Q}g7_qgQoL zUXj&$llcCfX7-DxxsR1!FsA%g`g!sEReOa1&$*&U9|k#g9o(e2Ffr!gr4x2jM8cjw z>r6=C>YU;dc1A{2R+2fTz@=zWRb0pg<7tXcYDPSv7JgH28@IJbpA`?C;piA@U}R*+ zsQl=Wi}2LN5+9fub}}jVmAG0?0tSm}iEBhjN@7W>RdP`(kYX@0FtpS)Fw`|P4KXye tGB&m{G}ksTwK6a;(mdskq9HdwB{QuOw+82uqTfIb44$rjF6*2UngB1)*DC-3 literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/StatusBarIconDot2@2x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/StatusBarIconDot2@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..ce00482bf8f15df2f6ffa4b14c0737944a054e41 GIT binary patch literal 1502 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!3?wz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Guard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/StatusBarIconDot2@3x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot2.imageset/StatusBarIconDot2@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..82640f7ea12194013576bece93bff36c18654d2d GIT binary patch literal 1676 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&|3?#2~eYgdrSkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpuR}~ zJ|V6^1*2f_guws*|4;laN(4Hnr6kBNn1PX~=ESj)8$W!qdeuB;xSXX_@g- zh63&7jv^<$L^JQ;$+@w7%U4S?Jb3p}qOD@CmcujS z4RZAhw(H->muEP_<~&KoLbO`K;M!9rhfbcIDT-}2Jm+q2xMA}|@Y+q;Rxx27_a%8u z4=au+iUn7i1a`X=SxoghdhCr;ifs@c+ur6-G)&fT=l|9Eb*@!wBd6`hygwpo4Y;M5!| zzklaA1>9b*Yd`;5`TLRcd;k12{vNEkkTRtPatUtO+6R4rg7b#YJEA zdY#2CwtPuyufmpIUjc`?$}Yu%iGr`+D;Gu}HP6|=q zC-BO6qRb+>PXcG^7fwrAXW;wGs8X!*m5O~;Y1fjV)k`h->n@5}2=EEXAlN8s~nli0l5& zCGbLW_4XYRA72*EQ5JFa_WvL07NJr3sPfACrLihgc7S3XadY^swJ)wB`Jv|saDBFsX&Us$iUE2*T7KM&@{x*)XLb{%FtZf nz|_jXz)16yJBo(f{FKbJO57TpONxF2H86O(`njxgN@xNAR2>;h literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/Contents.json b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/Contents.json new file mode 100644 index 0000000..96da519 --- /dev/null +++ b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "StatusBarIconDot3@1x.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "StatusBarIconDot3@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "StatusBarIconDot3@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "template" + } +} \ No newline at end of file diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/StatusBarIconDot3@1x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/StatusBarIconDot3.imageset/StatusBarIconDot3@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..80e221be8e0d75505d73eb559f7774829c5f612c GIT binary patch literal 958 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6Ea{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP@jH) zPlzi}!6+ay1pfd3&lIS&9jH3FB*-tAfssX0M~Rb1*~r`1LRNs?($CA)R)tB-Mw?Z{ z%*T;iO5anJ+1X0o-o@Q6B2Y+UT7Sr*b@8z$|NfrO>o#>x*T?QZGkd2r|9mS`nLlfG zl-|70?>jjRojerzP1%h74K%gnbZ5-TIRUheG0EHACFRhq9iaH~=ES z4yb_7)5S4F;&O6A1GAeOn@&UL%+{&A&Qs<#Pwt-GKAqo}dw+w%_6Zw0R!FScu%ks` zyNdjLky(mKmy9+Qoq4g%=v241hL)!0;#mt1Ez~-#x_p_+k)AbE9Ort6IZuxEo*f$YzZJWGdyN6%dg$535HET=lmAh4< zcih^sQ(e7!g=35D-aS`$wC2{-{N3`0nW?$SS)h)GmwS3B*X53mD*?_dJs~ZNdUK{U zsf6z^*~G8fx^-veBFPy^NvacDmd;RqobNS%G}U;vjb? zhIQv;UIIA^$sR$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IWPg}()|r{jW>AQ}ee2)M zTYVvSMSm~wm&$&3Z?Z5@Mzv+ax29Pwzc1|45`NY4jIrxcqNuP+=KRYJS3WTGGaOoU zEuz@>ZllYIg=|Ue((=qlnxc%athu2cDpa^+qUX^cA_`twzOp&n(p4O-^4u$?82T|h zvRqktkzv(zts^Usxs+}E$Wt@_gW#<2qPF<`ih`!REgd=e<|*xx^A}aJoBsJNwm>WM z-B*73#*ddp)^T&Qo6g_w;Ht9WYEsSBd(nOQ_v`Pl+gRDHeYxW2=cM9LR;GZ? z^}Zi^&-Jymyvhvce&EG_I{&#y%R3|U6%23c>~}rZp5s?M-zHqR3 zIDNzIFG6fjS>CI>Q<{Hf{_LB(-aJsz$;g^JyYRDskHj9A&n>B(N?*3uY`FA{(^pLC zOZol+!PpkIH1`X>2|5L5)+{nu_~>f?g9Yw}E%)~ZBwp-K2D8!q|KNR{!+c`YY>UoBD1?S1QZt`TII zaQe>CDO=^vwD&NroB4-vX7>9>9Kxz>z?`RA;u=wsl30>zm0Xkxq!^403@vpH40R1n xLkvx=jE$`f&9x0otqcr|G*7vsXvob^$xN%nt--mZ=r>RUgQu&X%Q~loCIAC-C6fRE literal 0 HcmV?d00001 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@1x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@1x.png deleted file mode 100644 index 1a7d77cb90c859c23a6ae7d7582ea04bbb7c9e89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 990 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6Ea{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP+v@d zPlzi}!6=|b2>k#5Un=;O6wv6Rk|4ie21f3Ht_*3F+y!5LZ;mt&-}~eFnM!u|WB(>v zTMBczY`fye%p@N?_tX0lHjbN@_xq=Q{dN24>vJ;&`wWksU8rPI_3o-f3hVXn_jS6T zw0%sIT>2n~KYhltztI!Ey|F*PTU208xY@jp<)wSp>E3I6W%saV_Rrw=uYtBRCV9KN z6gzU-o&$0?3p^r=fwTu0yPeFo12R5&x;TbNTux4CV0Lq3(`o3O**cZidCJ`8$=$Qt zr}O)A?{^5CxM0GD4vkeCX6$HbSu$k{&n(4FMW60)b$MkhI;B;#D(jWhtSF5|w`8oE zVs=%%di6`=5L=tuF*Vm^X|B&sEE0R=k+3E11r^-r;7bQ<{*&5N3 z)cxp@q>xbeo(V0&lO_ds1vT=VU1V}az(@bogLID*E`hu(kvD}3Ep6`XtXy%ZXU|Vp zSJy;E3C9!R0W&7AInyA{z+n1CgTe~DWM4fWYhQ| diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@2x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@2x.png deleted file mode 100644 index 66c49c10b7f8051a6cfb09b82b9ed6aa2e4b8616..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1714 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!3?wz9Rv7~+mUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$Ysfq}_6 zz$e5Ns9+R~h5*?i@c;k+bBXg80`>1N3GxeOU}BSXj__7z(X5`i>)C}VmVyfUov;5s z&S2-SI<#;5pG&Jc>Qoq+zrJ{IpCj!1&sTfejKp$JovzJFNvbee$;;LBdAg!|{9eZy zoEF*jR!`p)d2Raf?a{nje#Orpe!4N&{O<3Am$yZ-_NfX;B;GrAI9BNFzeRkRNBx78 ze_g$8sQun%gH)>N+P6Du_TSVAneQfdVojXghdIj)j&ClUXePNez;m_CktJPG((A){ zqQCg4UD5KLddK+Ufzl^0Tg0s$O>_45U54*zIJt z9Wd`q@^oB`Ga2HTk)MpQ*aIIlsRAeg?r)tgSOzU0sfTdoMnHg36LG zuPC>$KL5J^b(MCkuBxe`p*3AsXYBm$+^}m`+p=jLW_6oOOAcl|{rZKsf~WU`)twth zLU@*3J9FpIrBk=q)^A+Jbf+jv;p(LKqFXR}Sm%AlR zF*c}f;JLo#i;Bp(xO;qd>-NReIb8k6=u;6ZBk@FDM@>vf>X`svh^|zl``X$R5fis> z+8^ARJuQ>xWLf$oeLL)!BXi;IqIVXe$JH4`RkKu8S2rga92JpJS-IoNvQCDpN0y|g zq@_M*h}>D}pd>&2QPZKnzq`A<8+49c5?JtP)8F5vrwcX9uHD#weZK>j z{mq|I?dOElfcu}AlIQd8e)LrPkcw0o6SJ<&EV+ijKI5xvg_zp3xII3WtPoFW=u&^k zX|-5tfpM7g4V?onJJNLJjs|HuT>f;eF*cDqW!?J2i)S2k;g?9LJiW_2CuSnYnb6sn zK4{L%X6Tw?diCU2g{seDY}(W>*s`~{eciot zoV%|HhHx?M{_b+-{_cK_r6EiVHO69gbKmsj0h6g}iEBhjN@7W>RdP`(kYX@0FtpG$ zG}1M)2r;y@GBUCJO``bVb44$rjF6*2UngChB B;wAt9 diff --git a/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@3x.png b/WireGuard/WireGuard/UI/macOS/Assets.xcassets/WireGuardMacStatusBarIcon.imageset/WireGuardMacStatusBarIcon@3x.png deleted file mode 100644 index e1bcc3513cab4f8729f2c7372f46ac3447c8b4c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1956 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&|3?#2~eYgdrSkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZk1_q|A z0G|+7pn_2_8UnNqf&c&iJE#k20IfMw666=mz$3uT$Zu1#{lnL@6O2PPEN?8@aXNs> zYt!F-9L%n121aYdgI;WI|95WZjbg4`mY*+Iuj;vcc-LCTQ|qU8b>ECzc|xPGZO-vu zTAt4wI^Vsjx0aMR)E~|3vvvQX3jOdenWC*1wI95_bA|m+gOBL6hCUbhy($iCPgr)rs zMnbVWIPy$K{3sA)a&#-8VWty+KMY?U$Z8TD(7#r4eo_*qCT_@zuIKyScVG;hbkaO(<^Z zV5^u^!nV&cdWSd(H1tm*F&K7+?W^k5%XcwP zka0Wj_u^bq_PxG6o0~&UxRx(dSobbc@cr?`+iRR&pLQv?V|b)|)B52OfwkwwBkdR$ zHA^gWb0^nz%@6*>pVM`I(bRMULtrLTEpd$~Nl7e8wMs5Z1yT$~ z28I^8hDN$Z79oa~Rz^lv21eQjW>y9UjfU;%C>nC}Q!>*kaclUHV}Bc{fx*+&&t;uc GLK6VpZ$9P# diff --git a/WireGuard/WireGuard/UI/macOS/StatusItemController.swift b/WireGuard/WireGuard/UI/macOS/StatusItemController.swift new file mode 100644 index 0000000..2568c15 --- /dev/null +++ b/WireGuard/WireGuard/UI/macOS/StatusItemController.swift @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018-2019 WireGuard LLC. All Rights Reserved. + +import Cocoa + +class StatusItemController { + var currentTunnel: TunnelContainer? { + didSet { + updateStatusItemImage() + } + } + + let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength) + private let statusBarImageWhenActive = NSImage(named: "StatusBarIcon")! + private let statusBarImageWhenInactive = NSImage(named: "StatusBarIconDimmed")! + + private let animationImages = [ + NSImage(named: "StatusBarIconDot1")!, + NSImage(named: "StatusBarIconDot2")!, + NSImage(named: "StatusBarIconDot3")! + ] + private var animationImageIndex: Int = 0 + private var animationTimer: Timer? + + init() { + updateStatusItemImage() + } + + func updateStatusItemImage() { + guard let currentTunnel = currentTunnel else { + stopActivatingAnimation() + statusItem.button?.image = statusBarImageWhenInactive + return + } + switch currentTunnel.status { + case .inactive: + stopActivatingAnimation() + statusItem.button?.image = statusBarImageWhenInactive + case .active: + stopActivatingAnimation() + statusItem.button?.image = statusBarImageWhenActive + case .activating, .waiting, .reasserting, .restarting: + startActivatingAnimation() + case .deactivating: + break + } + } + + func startActivatingAnimation() { + guard animationTimer == nil else { return } + let timer = Timer(timeInterval: 0.3, repeats: true) { [weak self] _ in + guard let self = self else { return } + self.statusItem.button?.image = self.animationImages[self.animationImageIndex] + self.animationImageIndex = (self.animationImageIndex + 1) % self.animationImages.count + } + RunLoop.main.add(timer, forMode: .default) + animationTimer = timer + } + + func stopActivatingAnimation() { + guard let timer = self.animationTimer else { return } + timer.invalidate() + animationTimer = nil + animationImageIndex = 0 + } +} diff --git a/WireGuard/WireGuard/UI/macOS/StatusMenu.swift b/WireGuard/WireGuard/UI/macOS/StatusMenu.swift index 78e71ba..a2f02d8 100644 --- a/WireGuard/WireGuard/UI/macOS/StatusMenu.swift +++ b/WireGuard/WireGuard/UI/macOS/StatusMenu.swift @@ -13,6 +13,8 @@ class StatusMenu: NSMenu { var firstTunnelMenuItemIndex = 0 var numberOfTunnelMenuItems = 0 + @objc dynamic var currentTunnel: TunnelContainer? + var manageTunnelsRootVC: ManageTunnelsRootViewController? lazy var manageTunnelsWindow: NSWindow = { manageTunnelsRootVC = ManageTunnelsRootViewController(tunnelsManager: tunnelsManager) @@ -30,7 +32,11 @@ class StatusMenu: NSMenu { addStatusMenuItems() addItem(NSMenuItem.separator()) for index in 0 ..< tunnelsManager.numberOfTunnels() { - let isUpdated = updateStatusMenuItems(with: tunnelsManager.tunnel(at: index), ignoreInactive: true) + let tunnel = tunnelsManager.tunnel(at: index) + if tunnel.status != .inactive { + currentTunnel = tunnel + } + let isUpdated = updateStatusMenuItems(with: tunnel, ignoreInactive: true) if isUpdated { break } @@ -176,6 +182,13 @@ extension StatusMenu { updateTunnelMenuItem(menuItem) let statusObservationToken = tunnel.observe(\.status) { [weak self] tunnel, _ in updateTunnelMenuItem(menuItem) + if tunnel.status == .deactivating || tunnel.status == .inactive { + if self?.currentTunnel == tunnel { + self?.currentTunnel = self?.tunnelsManager.waitingTunnel() + } + } else { + self?.currentTunnel = tunnel + } self?.updateStatusMenuItems(with: tunnel, ignoreInactive: false) } tunnelStatusObservers.insert(statusObservationToken, at: tunnelIndex)