mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
added stickers preview
This commit is contained in:
@@ -395,6 +395,7 @@ MainWidget::MainWidget(Window *window) : TWidget(window)
|
||||
, _hider(0)
|
||||
, _peerInStack(0)
|
||||
, _msgIdInStack(0)
|
||||
, _stickerPreview(0)
|
||||
, _playerHeight(0)
|
||||
, _contentScrollAddToY(0)
|
||||
, _mediaType(this)
|
||||
@@ -744,6 +745,20 @@ QPixmap MainWidget::grabTopBar() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::ui_showStickerPreview(DocumentData *sticker) {
|
||||
if (!sticker || !sticker->sticker()) return;
|
||||
if (!_stickerPreview) {
|
||||
_stickerPreview = new StickerPreviewWidget(this);
|
||||
resizeEvent(0);
|
||||
}
|
||||
_stickerPreview->showPreview(sticker);
|
||||
}
|
||||
|
||||
void MainWidget::ui_hideStickerPreview() {
|
||||
if (!_stickerPreview) return;
|
||||
_stickerPreview->hidePreview();
|
||||
}
|
||||
|
||||
void MainWidget::noHider(HistoryHider *destroyed) {
|
||||
if (_hider == destroyed) {
|
||||
_hider = 0;
|
||||
@@ -2566,6 +2581,7 @@ void MainWidget::orderWidgets() {
|
||||
dialogs.raise();
|
||||
_mediaType.raise();
|
||||
if (_hider) _hider->raise();
|
||||
if (_stickerPreview) _stickerPreview->raise();
|
||||
}
|
||||
|
||||
QRect MainWidget::historyRect() const {
|
||||
@@ -2826,6 +2842,7 @@ void MainWidget::resizeEvent(QResizeEvent *e) {
|
||||
_mediaType.moveToLeft(width() - _mediaType.width(), _playerHeight + st::topBarHeight);
|
||||
if (profile) profile->setGeometry(history.geometry());
|
||||
if (overview) overview->setGeometry(history.geometry());
|
||||
if (_stickerPreview) _stickerPreview->setGeometry(rect());
|
||||
_contentScrollAddToY = 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user