2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

added stickers preview

This commit is contained in:
John Preston
2015-12-07 16:05:00 +03:00
parent 6b565acbd6
commit e312adb786
17 changed files with 448 additions and 129 deletions

View File

@@ -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;
}