2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 23:55:12 +00:00

Slightly refactored display of media preview.

- Removed showMediaPreview from facades.
This commit is contained in:
23rd
2019-06-29 13:29:04 +03:00
committed by John Preston
parent da6baeb1a7
commit 7c98f64cdb
9 changed files with 71 additions and 70 deletions

View File

@@ -1030,9 +1030,11 @@ void FieldAutocompleteInner::selectByMouse(QPoint globalPosition) {
if (_down >= 0 && _sel >= 0 && _down != _sel) {
_down = _sel;
if (_down >= 0 && _down < _srows->size()) {
Ui::showMediaPreview(
(*_srows)[_down].document->stickerSetOrigin(),
(*_srows)[_down].document);
if (const auto w = App::wnd()) {
w->showMediaPreview(
(*_srows)[_down].document->stickerSetOrigin(),
(*_srows)[_down].document);
}
}
}
}
@@ -1050,10 +1052,12 @@ void FieldAutocompleteInner::onParentGeometryChanged() {
void FieldAutocompleteInner::showPreview() {
if (_down >= 0 && _down < _srows->size()) {
Ui::showMediaPreview(
(*_srows)[_down].document->stickerSetOrigin(),
(*_srows)[_down].document);
_previewShown = true;
if (const auto w = App::wnd()) {
w->showMediaPreview(
(*_srows)[_down].document->stickerSetOrigin(),
(*_srows)[_down].document);
_previewShown = true;
}
}
}