| 1234567891011121314151617181920212223242526272829303132333435363738 |
- //
- // Dock.m
- // MG
- //
- // Created by Tim Debo on 5/22/14.
- //
- //
- #import "Dock.h"
- @implementation Dock
- - (JSValue *)badge {
- NSDockTile *tile = [[NSApplication sharedApplication] dockTile];
- return [JSValue valueWithObject:[tile badgeLabel] inContext:JSContext.currentContext];
- }
- - (void)addBadge:(NSString *)badge {
- NSDockTile *tile = [[NSApplication sharedApplication] dockTile];
- [tile setBadgeLabel:badge];
- }
- - (void)removeBadge {
- NSDockTile *tile = [[NSApplication sharedApplication] dockTile];
- [tile setBadgeLabel:nil];
- }
- - (void)hideIcon {
- [NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
- }
- - (void)showIcon {
- [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
- }
- @end
|