mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-24 01:06:59 +00:00
Removed showDocument and showPhoto from Media::View::OverlayWidget.
This commit is contained in:
parent
7304f2b695
commit
c25779b844
@ -45,10 +45,12 @@ public:
|
||||
OpenRequest(
|
||||
Window::SessionController *controller,
|
||||
not_null<DocumentData*> document,
|
||||
HistoryItem *item)
|
||||
HistoryItem *item,
|
||||
bool continueStreaming = false)
|
||||
: _controller(controller)
|
||||
, _document(document)
|
||||
, _item(item) {
|
||||
, _item(item)
|
||||
, _continueStreaming(continueStreaming) {
|
||||
}
|
||||
OpenRequest(
|
||||
Window::SessionController *controller,
|
||||
@ -83,6 +85,10 @@ public:
|
||||
return _controller;
|
||||
}
|
||||
|
||||
bool continueStreaming() const {
|
||||
return _continueStreaming;
|
||||
}
|
||||
|
||||
private:
|
||||
Window::SessionController *_controller = nullptr;
|
||||
DocumentData *_document = nullptr;
|
||||
@ -90,6 +96,7 @@ private:
|
||||
PeerData *_peer = nullptr;
|
||||
HistoryItem *_item = nullptr;
|
||||
std::optional<Data::CloudTheme> _cloudTheme = std::nullopt;
|
||||
bool _continueStreaming = false;
|
||||
|
||||
};
|
||||
|
||||
|
@ -2249,76 +2249,6 @@ void OverlayWidget::activate() {
|
||||
setFocus();
|
||||
}
|
||||
|
||||
void OverlayWidget::showPhoto(
|
||||
not_null<PhotoData*> photo,
|
||||
HistoryItem *context) {
|
||||
setSession(&photo->session());
|
||||
|
||||
if (context) {
|
||||
setContext(context);
|
||||
} else {
|
||||
setContext(v::null);
|
||||
}
|
||||
|
||||
clearControlsState();
|
||||
_firstOpenedPeerPhoto = false;
|
||||
assignMediaPointer(photo);
|
||||
|
||||
displayPhoto(photo, context);
|
||||
preloadData(0);
|
||||
activateControls();
|
||||
}
|
||||
|
||||
void OverlayWidget::showPhoto(
|
||||
not_null<PhotoData*> photo,
|
||||
not_null<PeerData*> context) {
|
||||
setSession(&photo->session());
|
||||
setContext(context);
|
||||
|
||||
clearControlsState();
|
||||
_firstOpenedPeerPhoto = true;
|
||||
assignMediaPointer(photo);
|
||||
|
||||
displayPhoto(photo, nullptr);
|
||||
preloadData(0);
|
||||
activateControls();
|
||||
}
|
||||
|
||||
void OverlayWidget::showDocument(
|
||||
not_null<DocumentData*> document,
|
||||
HistoryItem *context) {
|
||||
showDocument(document, context, Data::CloudTheme(), false);
|
||||
}
|
||||
|
||||
void OverlayWidget::showTheme(
|
||||
not_null<DocumentData*> document,
|
||||
const Data::CloudTheme &cloud) {
|
||||
showDocument(document, nullptr, cloud, false);
|
||||
}
|
||||
|
||||
void OverlayWidget::showDocument(
|
||||
not_null<DocumentData*> document,
|
||||
HistoryItem *context,
|
||||
const Data::CloudTheme &cloud,
|
||||
bool continueStreaming) {
|
||||
setSession(&document->session());
|
||||
|
||||
if (context) {
|
||||
setContext(context);
|
||||
} else {
|
||||
setContext(v::null);
|
||||
}
|
||||
|
||||
clearControlsState();
|
||||
|
||||
_streamingStartPaused = false;
|
||||
displayDocument(document, context, cloud, continueStreaming);
|
||||
if (!isHidden()) {
|
||||
preloadData(0);
|
||||
activateControls();
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayWidget::show(OpenRequest request) {
|
||||
if (!request.controller()) {
|
||||
return;
|
||||
@ -3168,12 +3098,17 @@ float64 OverlayWidget::playbackControlsCurrentSpeed() {
|
||||
void OverlayWidget::switchToPip() {
|
||||
Expects(_streamed != nullptr);
|
||||
Expects(_document != nullptr);
|
||||
Expects(_controller != nullptr);
|
||||
|
||||
const auto document = _document;
|
||||
const auto msgId = _msgid;
|
||||
const auto closeAndContinue = [=] {
|
||||
_showAsPip = false;
|
||||
showDocument(document, document->owner().message(msgId), {}, true);
|
||||
show(OpenRequest(
|
||||
_controller,
|
||||
document,
|
||||
document->owner().message(msgId),
|
||||
true));
|
||||
};
|
||||
_showAsPip = true;
|
||||
_pip = std::make_unique<PipWrap>(
|
||||
|
@ -78,15 +78,6 @@ public:
|
||||
void setFocus();
|
||||
void activate();
|
||||
|
||||
void showPhoto(not_null<PhotoData*> photo, HistoryItem *context);
|
||||
void showPhoto(not_null<PhotoData*> photo, not_null<PeerData*> context);
|
||||
void showDocument(
|
||||
not_null<DocumentData*> document,
|
||||
HistoryItem *context);
|
||||
void showTheme(
|
||||
not_null<DocumentData*> document,
|
||||
const Data::CloudTheme &cloud);
|
||||
|
||||
void show(OpenRequest request);
|
||||
|
||||
//void leaveToChildEvent(QEvent *e, QWidget *child) override {
|
||||
@ -291,11 +282,6 @@ private:
|
||||
void resizeCenteredControls();
|
||||
void resizeContentByScreenSize();
|
||||
|
||||
void showDocument(
|
||||
not_null<DocumentData*> document,
|
||||
HistoryItem *context,
|
||||
const Data::CloudTheme &cloud,
|
||||
bool continueStreaming);
|
||||
void displayPhoto(not_null<PhotoData*> photo, HistoryItem *item);
|
||||
void displayDocument(
|
||||
DocumentData *document,
|
||||
|
Loading…
Reference in New Issue
Block a user