mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Remember that media view was switched to PIP and open it as PIP again.
Very useful, especially on large monitors. Since the permanent opening of the video in full screen interferes and hide other applications. This functionality allows remembering (in the current session) that the window has been switched to a PIP mode and will open a new video directly in the PIP mode.
This commit is contained in:
committed by
John Preston
parent
46ee5598f5
commit
99501d844d
@@ -2213,6 +2213,9 @@ void OverlayWidget::showDocument(
|
||||
displayDocument(document, context, cloud, continueStreaming);
|
||||
preloadData(0);
|
||||
activateControls();
|
||||
if (_showAsPip && !videoIsGifOrUserpic()) {
|
||||
switchToPip();
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayWidget::displayPhoto(not_null<PhotoData*> photo, HistoryItem *item) {
|
||||
@@ -2982,8 +2985,10 @@ void OverlayWidget::switchToPip() {
|
||||
const auto document = _document;
|
||||
const auto msgId = _msgid;
|
||||
const auto closeAndContinue = [=] {
|
||||
_showAsPip = false;
|
||||
showDocument(document, document->owner().message(msgId), {}, true);
|
||||
};
|
||||
_showAsPip = true;
|
||||
_pip = std::make_unique<PipWrap>(
|
||||
this,
|
||||
document,
|
||||
|
@@ -443,6 +443,7 @@ private:
|
||||
|
||||
std::unique_ptr<Streamed> _streamed;
|
||||
std::unique_ptr<PipWrap> _pip;
|
||||
bool _showAsPip = false;
|
||||
|
||||
const style::icon *_docIcon = nullptr;
|
||||
style::color _docIconColor;
|
||||
|
Reference in New Issue
Block a user