• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

BonzaiThePenguin/Loading: Simple network activity monitor for macOS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

BonzaiThePenguin/Loading

开源软件地址(OpenSource Url):

https://github.com/BonzaiThePenguin/Loading

开源编程语言(OpenSource Language):

Objective-C 99.6%

开源软件介绍(OpenSource Introduction):

Loading See when Mac apps are using your network

Similar to the network activity indicator on iOS, Loading shows a spinning progress wheel in your menu bar when your network is being used. Clicking the icon shows the apps that are using your network, and holding down the option key shows the individual processes.

The original project required OS X 10.7 or newer, but that was only because it used 10.7's NSPopover for the licensing functionality. Support for older versions of OS X remains untested.


Most of the functionality in this app was reverse-engineered from the private NetworkStatistics framework found here:

/System/Library/PrivateFrameworks/NetworkStatistics.framework

And it uses the private [NSStatusBarButtonCell _button] selector on OS X 10.9 and earlier, as [NSStatusBarButtonCell button] was not available until Yosemite.


Lastly, OS X has a large number of bugs regarding NSMenus:

  • [NSMenuItem setView:] is currently broken, as it will cause the keyboard controls to stop working after using the menu for the first time.

  • Using setView on an NSTextView to have wrapped text causes the selection background to render incorrectly, ignores the first mouse click on the menu item, and has the same broken keyboard controls as above. The workaround was to wrap the text using CTFramesetter and \n newlines.

  • NSStatusItem's menu will be drawn in the wrong position if you follow the recommended behavior of using [NSMenuDelegate menuNeedsUpdate:] OR menu:updateItem:atIndex:shouldCancel:. The only workaround I was able to find was swizzling [NSStatusBarButtonCell trackMouse:inRect:ofView:untilMouseUp:] and updating the menu there.

  • NSMenuItems with attributed titles cannot be updated when the item is selected or deselected, so you can't for example have a gray menu item that turns white when selected. Since the icons can be updated in the select/deselect event for some reason, one proposed workaround is to render the text into a large NSImage and set that as the icon for the menu item.

  • the NSMenuItem checked state can be modified when selected or deselected, but it causes the entire menu to flicker and redraw improperly.

  • [NSMenuItem setMixedStateImage:] has been available since 10.0 and has not been deprecated, but has never actually done anything.

  • "Cocoa" NSMenus are actually built entirely on Carbon, and even the Apple menu items are subclassed directly from IBCarbonMenuItem, but in 64-bit mode kEventParamMenuContextHeight is always 0.0 in both draw events. This is needed to flip the coordinate system on the CGContextRef for drawing into the menu (the alternative of using GetPortBounds is only available in 32-bit mode), so without it the feature seems useless? Combine that with the setView bugs and I have no clue how they're drawing the 1 new text next to the App Store menu item.


Website
https://bonzaiapps.com/loading/

Download
https://bonzaiapps.com/loading/Loading.zip

Language
English, Français, Deutsch, 汉语, 漢語, 日本語, Español, Italiano, Nederlands, 한국어, Português, Dansk, Suomi, Norsk bokmål, Svenska, Pу́сский, Polski, Türkçe, العربية, ภาษาไทย, Čeština, Magyar, Català, Hrvatski, Ελληνικά, עברית, Român, Slovenský jazyk, Yкраїнська мова, Bahasa Indonesia, Bahasa melayu, Tiếng việt




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap