mirror of https://github.com/procxx/kepka.git
Added passcode lock handler for touchbar.
This commit is contained in:
parent
92ff237c2d
commit
c424607603
|
@ -36,6 +36,7 @@ static NSTouchBarItemIdentifier _Nullable currentPosition = [NSString stringWith
|
||||||
|
|
||||||
@interface TouchBar : NSTouchBar
|
@interface TouchBar : NSTouchBar
|
||||||
@property TouchBarType touchBarType;
|
@property TouchBarType touchBarType;
|
||||||
|
@property TouchBarType touchBarTypeBeforeLock;
|
||||||
|
|
||||||
@property(retain) NSDictionary * _Nullable touchbarItems;
|
@property(retain) NSDictionary * _Nullable touchbarItems;
|
||||||
@property(retain) NSTouchBar * _Nullable touchBarMain;
|
@property(retain) NSTouchBar * _Nullable touchBarMain;
|
||||||
|
|
|
@ -268,6 +268,16 @@ auto lifetime = rpl::lifetime();
|
||||||
}
|
}
|
||||||
}, lifetime);
|
}, lifetime);
|
||||||
|
|
||||||
|
Core::App().passcodeLockChanges(
|
||||||
|
) | rpl::start_with_next([=](bool locked) {
|
||||||
|
if (locked) {
|
||||||
|
self.touchBarTypeBeforeLock = self.touchBarType;
|
||||||
|
[self setTouchBar:TouchBarType::None];
|
||||||
|
} else {
|
||||||
|
[self setTouchBar:self.touchBarTypeBeforeLock];
|
||||||
|
}
|
||||||
|
}, lifetime);
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,6 +351,8 @@ auto lifetime = rpl::lifetime();
|
||||||
[self.view setTouchBar:_touchBarMain];
|
[self.view setTouchBar:_touchBarMain];
|
||||||
} else if (type == TouchBarType::AudioPlayer) {
|
} else if (type == TouchBarType::AudioPlayer) {
|
||||||
[self.view setTouchBar:_touchBarAudioPlayer];
|
[self.view setTouchBar:_touchBarAudioPlayer];
|
||||||
|
} else if (type == TouchBarType::None) {
|
||||||
|
[self.view setTouchBar:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue