2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-29 13:47:47 +00:00

[Improvement] Video controls for GIFs

This commit is contained in:
RadRussianRus 2022-09-11 02:53:31 +03:00 committed by Eric Kotato
parent e5a9e8eb16
commit f33a8c1d7d
2 changed files with 8 additions and 3 deletions

View File

@ -175,6 +175,7 @@
"ktg_disable_chat_themes": "Disable chat themes",
"ktg_settings_remember_compress_images": "Remember compress images",
"ktg_settings_compress_images_default": "Compress images by default",
"ktg_pip_not_supported": "Sorry, Picture-in-Picture mode is not supported here.",
"ktg_forward_quiz_unquoted": "Sorry, quizzes that are currently open and unvoted on cannot be forwarded unquoted.",
"ktg_in_app_update_disabled": "In-app updater is disabled.",
"ktg_settings_view_profile_on_top": "Show \"View Profile\" first",

View File

@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "media/view/media_view_overlay_widget.h"
#include "kotato/kotato_lang.h"
#include "apiwrap.h"
#include "api/api_attached_stickers.h"
#include "api/api_peer_photo.h"
@ -1069,8 +1070,8 @@ QSize OverlayWidget::videoSize() const {
bool OverlayWidget::streamingRequiresControls() const {
return !_stories
&& _document
&& (!_document->isAnimation() || _document->isVideoMessage());
&& _document;
//&& (!_document->isAnimation() || _document->isVideoMessage());
}
QImage OverlayWidget::videoFrame() const {
@ -4225,8 +4226,11 @@ float64 OverlayWidget::playbackControlsCurrentSpeed(bool lastNonDefault) {
}
void OverlayWidget::switchToPip() {
if (_document == nullptr) {
Ui::Toast::Show(_widget, ktr("ktg_pip_not_supported"));
return;
}
Expects(_streamed != nullptr);
Expects(_document != nullptr);
const auto document = _document;
const auto messageId = _message ? _message->fullId() : FullMsgId();