mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Detect if shift key is held down ASAP when launching test app
This commit is contained in:
1 parent
57325c7507
commit
bbfcd564d2
3 files changed
+18
-2
No files matched your search
@@ -13,6 +13,7 @@
|
||||
@interface SUUpdateSettingsWindowController ()
|
||||
|
||||
@property (nonatomic) SPUUpdater *updater;
|
||||
@property (nonatomic, readonly) BOOL customUserDriver;
|
||||
@property (nonatomic) id<SPUStandardUserDriverProtocol> userDriver;
|
||||
|
||||
@end
|
||||
@@ -20,8 +21,18 @@
|
||||
@implementation SUUpdateSettingsWindowController
|
||||
|
||||
@synthesize updater = _updater;
|
||||
@synthesize customUserDriver = _customUserDriver;
|
||||
@synthesize userDriver = _userDriver;
|
||||
|
||||
- (instancetype)initWithCustomUserDriver:(BOOL)customUserDriver
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_customUserDriver = customUserDriver;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)windowNibName
|
||||
{
|
||||
return NSStringFromClass([self class]);
|
||||
@@ -34,7 +45,7 @@
|
||||
|
||||
// If the user is holding down command, we use the popup title user driver instead
|
||||
id<SPUUserDriver, SPUStandardUserDriverProtocol> userDriver;
|
||||
if (([NSEvent modifierFlags] & NSShiftKeyMask) != 0) {
|
||||
if (self.customUserDriver) {
|
||||
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithApplicationBundle:applicationBundle window:self.window];
|
||||
} else {
|
||||
userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:hostBundle applicationBundle:applicationBundle delegate:nil];
|
||||
|
||||
Reference in new issue
Block a user