Merge branch 'master' of github.com:TermiT/Flycut

This commit is contained in:
Gennadii Potapov 2020-12-22 17:42:33 +08:00
commit fe6b606b99
6 changed files with 27 additions and 8 deletions

4
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,4 @@
# These are supported funding model platforms
github: TermiT
custom: https://paypal.me/flycut

View file

@ -22,7 +22,7 @@
@class SGHotKey; @class SGHotKey;
@interface AppController : NSObject <NSMenuDelegate, NSApplicationDelegate, NSAlertDelegate, FlycutStoreDelegate, FlycutOperatorDelegate> { @interface AppController : NSObject <NSMenuDelegate, NSApplicationDelegate, NSAlertDelegate, FlycutStoreDelegate, FlycutOperatorDelegate, BezelWindowDelegate> {
BezelWindow *bezel; BezelWindow *bezel;
SGHotKey *mainHotKey; SGHotKey *mainHotKey;
IBOutlet SRRecorderControl *mainRecorder; IBOutlet SRRecorderControl *mainRecorder;
@ -97,6 +97,7 @@
-(void) processBezelKeyDown:(NSEvent *)theEvent; -(void) processBezelKeyDown:(NSEvent *)theEvent;
-(void) processBezelMouseEvents:(NSEvent *)theEvent; -(void) processBezelMouseEvents:(NSEvent *)theEvent;
-(void) metaKeysReleased; -(void) metaKeysReleased;
-(void) windowDidResignKey:(NSNotification *)notification;
// Menu related // Menu related
-(void) updateMenu; -(void) updateMenu;

View file

@ -758,6 +758,12 @@
} }
} }
- (void)windowDidResignKey:(NSNotification *)notification {
if ( isBezelPinned ) {
[self hideApp];
}
}
-(void)fakeKey:(NSNumber*) keyCode withCommandFlag:(BOOL) setFlag -(void)fakeKey:(NSNumber*) keyCode withCommandFlag:(BOOL) setFlag
/*" +fakeKey synthesizes keyboard events. "*/ /*" +fakeKey synthesizes keyboard events. "*/
{ {
@ -1059,8 +1065,8 @@ didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
-(void)hideApp -(void)hideApp
{ {
[self hideBezel];
isBezelPinned = NO; isBezelPinned = NO;
[self hideBezel];
[NSApp hide:self]; [NSApp hide:self];
} }

View file

@ -14,6 +14,13 @@
#import "RoundRecBezierPath.h" #import "RoundRecBezierPath.h"
#import "RoundRecTextField.h" #import "RoundRecTextField.h"
@protocol BezelWindowDelegate <NSWindowDelegate>
-(void)processBezelKeyDown:(NSEvent *)theEvent;
-(void)processBezelMouseEvents:(NSEvent *)theEvent;
-(void)metaKeysReleased;
@end
@interface BezelWindow : NSPanel { @interface BezelWindow : NSPanel {
// "n of n" text in bezel // "n of n" text in bezel
@ -33,7 +40,7 @@
RoundRecTextField *textField; RoundRecTextField *textField;
RoundRecTextField *charField; RoundRecTextField *charField;
NSImageView *iconView; NSImageView *iconView;
id delegate; id<BezelWindowDelegate> delegate;
Boolean color; Boolean color;
} }
@ -57,7 +64,7 @@
- (void)setDate:(NSString *)newDate; - (void)setDate:(NSString *)newDate;
- (void)setSourceIcon:(NSImage *)newSourceIcon; - (void)setSourceIcon:(NSImage *)newSourceIcon;
- (id)delegate; - (id<BezelWindowDelegate>)delegate;
- (void)setDelegate:(id)newDelegate; - (void)setDelegate:(id<BezelWindowDelegate>)newDelegate;
@end @end

View file

@ -365,12 +365,13 @@ static const float lineHeight = 16;
} }
} }
- (id)delegate { - (id<BezelWindowDelegate>)delegate {
return delegate; return delegate;
} }
- (void)setDelegate:(id)newDelegate { - (void)setDelegate:(id<BezelWindowDelegate>)newDelegate {
delegate = newDelegate; delegate = newDelegate;
super.delegate = newDelegate;
} }
@end @end

View file

@ -22,7 +22,7 @@ If you like Flycut, you can donate [here](https://paypal.me/flycut)
Download from the App Store [here](http://itunes.apple.com/us/app/flycut-clipboard-manager/id442160987?mt=12) Download from the App Store [here](http://itunes.apple.com/us/app/flycut-clipboard-manager/id442160987?mt=12)
**DRM-Free:** **DRM-Free:**
Download latest DRM-Free version [here](https://github.com/MarkJerde/Flycut/releases/latest) Download latest DRM-Free version [here](https://github.com/TermiT/Flycut/releases)
**iOS App Store:** **iOS App Store:**
Download from the App Store [here](https://itunes.apple.com/us/app/flycut/id1273639655?mt=8) Download from the App Store [here](https://itunes.apple.com/us/app/flycut/id1273639655?mt=8)