From dac96bfc4aa28af62ef868c807936bd67229d3b9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 6 Nov 2016 21:08:52 +0300 Subject: [PATCH] Closed beta 10019002: redesign, fix emoji pan hide after inline bot. --- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/core/version.h | 2 +- Telegram/SourceFiles/historywidget.cpp | 1 - Telegram/SourceFiles/layerwidget.cpp | 5 ++++- Telegram/SourceFiles/stickers/emoji_pan.cpp | 12 ++++++------ Telegram/SourceFiles/stickers/emoji_pan.h | 4 ++-- Telegram/build/version | 2 +- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 2251dae346..288457f4db 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,19,1 - PRODUCTVERSION 0,10,19,1 + FILEVERSION 0,10,19,2 + PRODUCTVERSION 0,10,19,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.10.19.1" + VALUE "FileVersion", "0.10.19.2" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.19.1" + VALUE "ProductVersion", "0.10.19.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index 22abe67ef1..efe575eec8 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,19,1 - PRODUCTVERSION 0,10,19,1 + FILEVERSION 0,10,19,2 + PRODUCTVERSION 0,10,19,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Updater" - VALUE "FileVersion", "0.10.19.1" + VALUE "FileVersion", "0.10.19.2" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.19.1" + VALUE "ProductVersion", "0.10.19.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 595eb1879d..2c472b8fb4 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,7 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "core/utils.h" -#define BETA_VERSION_MACRO (10019001ULL) +#define BETA_VERSION_MACRO (10019002ULL) constexpr int AppVersion = 10020; constexpr str_const AppVersionStr = "0.10.20"; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index acc13358f0..20ff551118 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -7561,7 +7561,6 @@ void HistoryWidget::updatePinnedBar(bool force) { } } t_assert(_history != nullptr); - if (!_pinnedBar->msg) { _pinnedBar->msg = App::histItemById(_history->channelId(), _pinnedBar->msgId); } diff --git a/Telegram/SourceFiles/layerwidget.cpp b/Telegram/SourceFiles/layerwidget.cpp index f625b1f490..f6de4cce51 100644 --- a/Telegram/SourceFiles/layerwidget.cpp +++ b/Telegram/SourceFiles/layerwidget.cpp @@ -501,6 +501,7 @@ void MediaPreviewWidget::showPreview(PhotoData *photo) { startShow(); _photo = photo; _document = nullptr; + fillEmojiString(); resetGifAndCache(); } @@ -548,7 +549,9 @@ void MediaPreviewWidget::fillEmojiString() { return result; }; - if (auto sticker = _document->sticker()) { + if (_photo) { + _emojiList.clear(); + } else if (auto sticker = _document->sticker()) { auto &inputSet = sticker->set; if (inputSet.type() == mtpc_inputStickerSetID) { _emojiList = getStickerEmojiList(inputSet.c_inputStickerSetID().vid.v); diff --git a/Telegram/SourceFiles/stickers/emoji_pan.cpp b/Telegram/SourceFiles/stickers/emoji_pan.cpp index 3576aeedb3..41ab8dfa5e 100644 --- a/Telegram/SourceFiles/stickers/emoji_pan.cpp +++ b/Telegram/SourceFiles/stickers/emoji_pan.cpp @@ -2597,7 +2597,7 @@ EmojiPan::EmojiPan(QWidget *parent) : TWidget(parent) setCurrentTabIcon(dbietRecent); _hideTimer.setSingleShot(true); - connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(hideAnimated())); + connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(hideByTimerOrLeave())); connect(&e_inner, SIGNAL(scrollToY(int)), &e_scroll, SLOT(scrollToY(int))); connect(&e_inner, SIGNAL(disableScroll(bool)), &e_scroll, SLOT(disableScroll(bool))); @@ -2865,7 +2865,7 @@ bool EmojiPan::preventAutoHide() const { void EmojiPan::leaveEvent(QEvent *e) { if (preventAutoHide() || s_inner.inlineResultsShown()) return; if (_a_appearance.animating()) { - hideAnimated(); + hideByTimerOrLeave(); } else { _hideTimer.start(300); } @@ -2879,7 +2879,7 @@ void EmojiPan::otherEnter() { void EmojiPan::otherLeave() { if (preventAutoHide() || s_inner.inlineResultsShown()) return; if (_a_appearance.animating()) { - hideAnimated(); + hideByTimerOrLeave(); } else { _hideTimer.start(0); } @@ -3177,10 +3177,10 @@ void EmojiPan::step_appearance(float64 ms, bool timer) { if (timer) update(); } -void EmojiPan::hideAnimated() { +void EmojiPan::hideByTimerOrLeave() { if (isHidden() || preventAutoHide() || s_inner.inlineResultsShown()) return; - startHideAnimated(); + hideAnimated(); } void EmojiPan::prepareShowHideCache() { @@ -3193,7 +3193,7 @@ void EmojiPan::prepareShowHideCache() { } } -void EmojiPan::startHideAnimated() { +void EmojiPan::hideAnimated() { if (_hiding) return; prepareShowHideCache(); diff --git a/Telegram/SourceFiles/stickers/emoji_pan.h b/Telegram/SourceFiles/stickers/emoji_pan.h index 7545ae8051..afa4e63740 100644 --- a/Telegram/SourceFiles/stickers/emoji_pan.h +++ b/Telegram/SourceFiles/stickers/emoji_pan.h @@ -536,13 +536,14 @@ public: return s_inner.inlineResultsShown(); } -public slots: void showAnimated(); void hideAnimated(); +public slots: void refreshStickers(); private slots: + void hideByTimerOrLeave(); void refreshSavedGifs(); void hideFinish(); @@ -595,7 +596,6 @@ private: void updateContentHeight(); void leaveToChildEvent(QEvent *e, QWidget *child); - void startHideAnimated(); void prepareShowHideCache(); void updateSelected(); diff --git a/Telegram/build/version b/Telegram/build/version index 121e18f19d..8301c82a1b 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.10 AppVersionStrSmall 0.10.20 AppVersionStr 0.10.20 AlphaChannel 0 -BetaVersion 10019001 +BetaVersion 10019002