Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Xcode
.DS_Store
*/build/*
Build/*
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -15,3 +16,5 @@ profile
DerivedData
.idea/
*.hmap

Demo.xcodeproj/project.xcworkspace/xcshareddata/Demo.xccheckout
32 changes: 28 additions & 4 deletions AXStatusItemPopup/AXStatusItemPopup.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,37 @@

#import <Cocoa/Cocoa.h>

@interface AXStatusItemPopup : NSView
@interface NSWindow (canBecomeKeyWindow)

@end

@protocol AXStatusItemPopupDelegate <NSObject>

@optional

- (BOOL) shouldPopupOpen;
- (void) popupWillOpen;
- (void) popupDidOpen;

- (BOOL) shouldPopupClose;
- (void) popupWillClose;
- (void) popupDidClose;

@end

@interface AXStatusItemPopup : NSView <NSPopoverDelegate, NSWindowDelegate, NSApplicationDelegate>

// properties
@property(assign, nonatomic, getter=isActive) BOOL active;
@property(assign, nonatomic) BOOL animated;
@property(assign, nonatomic, getter=isAnimated) BOOL animated;
@property(strong, nonatomic) NSImage *image;
@property(strong, nonatomic) NSImage *alternateImage;
@property(strong, nonatomic) NSStatusItem *statusItem;
@property(weak) id<AXStatusItemPopupDelegate> delegate;


// alloc
+ (id)statusItemPopupWithViewController:(NSViewController *)controller;
+ (id)statusItemPopupWithViewController:(NSViewController *)controller image:(NSImage *)image;
+ (id)statusItemPopupWithViewController:(NSViewController *)controller image:(NSImage *)image alternateImage:(NSImage *)alternateImage;

// init
- (id)initWithViewController:(NSViewController *)controller;
Expand All @@ -25,6 +47,8 @@


// show / hide popover
- (void)togglePopover;
- (void)togglePopoverAnimated: (BOOL)animated;
- (void)showPopover;
- (void)showPopoverAnimated:(BOOL)animated;
- (void)hidePopover;
Expand Down
Loading