mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Fixed seeking of slider from audio player in touchbar.
This commit is contained in:
parent
62a6812259
commit
9873e6d75c
1 changed files with 9 additions and 2 deletions
|
@ -484,8 +484,15 @@ auto lifetime = rpl::lifetime();
|
|||
}
|
||||
|
||||
- (void) seekbarChanged:(NSSliderTouchBarItem *)sender {
|
||||
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
||||
Media::Player::instance()->finishSeeking(kSongType, sender.slider.doubleValue);
|
||||
// https://stackoverflow.com/a/45891017
|
||||
NSEvent *event = [[NSApplication sharedApplication] currentEvent];
|
||||
bool touchUp = [event touchesMatchingPhase:NSTouchPhaseEnded inView:nil].count > 0;
|
||||
Core::Sandbox::Instance().customEnterFromEventLoop([=] {
|
||||
if (touchUp) {
|
||||
Media::Player::instance()->finishSeeking(kSongType, sender.slider.doubleValue);
|
||||
} else {
|
||||
Media::Player::instance()->startSeeking(kSongType);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue