mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02: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 {
|
- (void) seekbarChanged:(NSSliderTouchBarItem *)sender {
|
||||||
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
// 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);
|
Media::Player::instance()->finishSeeking(kSongType, sender.slider.doubleValue);
|
||||||
|
} else {
|
||||||
|
Media::Player::instance()->startSeeking(kSongType);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue