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:
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;
|
||||
|
|
Loading…
Reference in New Issue