2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Add a floating player for round video messages.

This commit is contained in:
John Preston
2017-05-22 18:25:49 +03:00
parent 0bfff65306
commit b7550f63c9
33 changed files with 771 additions and 138 deletions

View File

@@ -20,6 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "profile/profile_section_memento.h"
#include "core/click_handler_types.h"
#include "media/media_clip_reader.h"
#include "observer_peer.h"
#include "mainwindow.h"
#include "mainwidget.h"
@@ -348,8 +349,8 @@ void inlineKeyboardMoved(const HistoryItem *item, int oldKeyboardTop, int newKey
}
bool switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo) {
if (auto m = App::main()) {
return m->notify_switchInlineBotButtonReceived(query, samePeerBot, samePeerReplyTo);
if (auto main = App::main()) {
return main->notify_switchInlineBotButtonReceived(query, samePeerBot, samePeerReplyTo);
}
return false;
}
@@ -367,13 +368,23 @@ void historyMuteUpdated(History *history) {
}
void handlePendingHistoryUpdate() {
if (MainWidget *m = App::main()) {
m->notify_handlePendingHistoryUpdate();
if (auto main = App::main()) {
main->notify_handlePendingHistoryUpdate();
}
for_const (HistoryItem *item, Global::PendingRepaintItems()) {
for (auto item : base::take(Global::RefPendingRepaintItems())) {
Ui::repaintHistoryItem(item);
// Start the video if it is waiting for that.
if (item->pendingInitDimensions()) {
if (auto media = item->getMedia()) {
if (auto reader = media->getClipReader()) {
if (!reader->started() && reader->mode() == Media::Clip::Reader::Mode::Video) {
item->history()->resizeGetHeight(item->history()->width);
}
}
}
}
}
Global::RefPendingRepaintItems().clear();
}
void unreadCounterUpdated() {