From 1d895cd953d5f19904ffa7da71aa4edd1e865946 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 22 Dec 2016 16:30:27 +0300 Subject: [PATCH] Closed beta 10020004: stickers box fixed, manage admins box fixed. --- Telegram/Resources/icons/bubble_tail.png | Bin 137 -> 156 bytes Telegram/Resources/icons/bubble_tail@2x.png | Bin 221 -> 247 bytes Telegram/Resources/winrc/Telegram.rc | 8 +-- Telegram/Resources/winrc/Updater.rc | 8 +-- Telegram/SourceFiles/boxes/abstractbox.cpp | 16 +++--- Telegram/SourceFiles/boxes/stickers_box.cpp | 29 +++++----- Telegram/SourceFiles/boxes/stickers_box.h | 51 +++++++++--------- Telegram/SourceFiles/core/version.h | 2 +- Telegram/SourceFiles/ui/widgets/widgets.style | 6 +-- Telegram/build/version | 2 +- 10 files changed, 65 insertions(+), 57 deletions(-) diff --git a/Telegram/Resources/icons/bubble_tail.png b/Telegram/Resources/icons/bubble_tail.png index c8a9ebb2f3697dd4ef9a853a4dec21d8733d8c5f..b953ce8f62f2eb813ca6336966f929f54533447a 100644 GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJ#0V1dK=^F#7WKS2z5RRF-XEq8pCVBfCeQL8PN+bx`; z*1lv?cs?gqEobI;q#9@)gQu&X%Q~lo FCIIpYIeY*B literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1k!3HFMt$j8RNCkMhIEHY{j6JhZ@PGotfddK;k6sDy%KKFRDC{2 ne_D`Ca>cQz)AbK4=fqyT5&330&$3TIvl%>H{an^LB{Ts5Z)Gxh diff --git a/Telegram/Resources/icons/bubble_tail@2x.png b/Telegram/Resources/icons/bubble_tail@2x.png index 6f9debe046c6a23589a5b4b9c5dbf7444fe42188..f946cce57bc9737021c6a557e3dd5ad25e9235a0 100644 GIT binary patch literal 247 zcmVPl2ZjWLL?Gw^ODD9lRZs!~M+X=j9zh6vnB#Ie{$^h??!C;IQ2+=b zuIoZeWdKN$#4bqF6w2nLrfGmr@H(F7aa~u6Pb!K6T5I`+wrxq0q9BSQZrdggj4?cT z4Z<+wJkRo=u514C7?fqne{O>~jyX+}Ebx7w!!VrW%OD5>_I-aTpMosQIF943{0$t( xVO3RJmgP|_R=(E-*-&d_dP%u#&OKLt~Tttj(4{(%QC$8HXMe5&n{tI*Zg*Z zNs_QEOBg!m7{~F1POxp;OY{Ysrr|h_Ff7ZGZQE`UfU2r85rF1-HW7gH-V;TU^=Wzn X{TXNCP_T*200000NkvXXu0mjf_Vr#$ diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 2c1f11d24..03d6f6da6 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,20,3 - PRODUCTVERSION 0,10,20,3 + FILEVERSION 0,10,20,4 + PRODUCTVERSION 0,10,20,4 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.10.20.3" + VALUE "FileVersion", "0.10.20.4" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.20.3" + VALUE "ProductVersion", "0.10.20.4" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index addf208f0..33eaa43c4 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,20,3 - PRODUCTVERSION 0,10,20,3 + FILEVERSION 0,10,20,4 + PRODUCTVERSION 0,10,20,4 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.20.3" + VALUE "FileVersion", "0.10.20.4" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.20.3" + VALUE "ProductVersion", "0.10.20.4" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/boxes/abstractbox.cpp b/Telegram/SourceFiles/boxes/abstractbox.cpp index 90b3d3855..c465c2138 100644 --- a/Telegram/SourceFiles/boxes/abstractbox.cpp +++ b/Telegram/SourceFiles/boxes/abstractbox.cpp @@ -48,17 +48,19 @@ void BoxContent::setInner(object_ptr inner) { void BoxContent::setInner(object_ptr inner, const style::ScrollArea &st) { if (inner) { getDelegate()->setLayerType(true); - if (!_scroll) { - _scroll.create(this, st); - connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll())); - connect(_scroll, SIGNAL(innerResized()), this, SLOT(onInnerResize())); - + _scroll.create(this, st); + _scroll->setGeometryToLeft(0, _innerTopSkip, width(), 0); + _scroll->setOwnedWidget(std_::move(inner)); + if (_topShadow) { + _topShadow->raise(); + _bottomShadow->raise(); + } else { _topShadow.create(this, object_ptr(this)); _bottomShadow.create(this, object_ptr(this)); } - _scroll->setGeometryToLeft(0, _innerTopSkip, width(), 0); - _scroll->setOwnedWidget(std_::move(inner)); updateScrollAreaGeometry(); + connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll())); + connect(_scroll, SIGNAL(innerResized()), this, SLOT(onInnerResize())); } else { getDelegate()->setLayerType(false); _scroll.destroyDelayed(); diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index ee28607f6..5ff8efa88 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -39,8 +39,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org namespace { -constexpr int kArchivedLimitFirstRequest = 1;// 10; -constexpr int kArchivedLimitPerPage = 1;// 30; +constexpr int kArchivedLimitFirstRequest = 10; +constexpr int kArchivedLimitPerPage = 30; } // namespace @@ -401,6 +401,7 @@ void StickersBox::switchTab() { _tab = newTab; _section = newSection; setInnerWidget(_tab->takeWidget(), getTopSkip()); + _tabs->raise(); _tab->widget()->show(); rebuildList(); onScrollToY(_tab->getScrollTop()); @@ -449,8 +450,6 @@ void StickersBox::installSet(uint64 setId) { void StickersBox::installDone(const MTPmessages_StickerSetInstallResult &result) { if (result.type() == mtpc_messages_stickerSetInstallResultArchive) { Stickers::applyArchivedResult(result.c_messages_stickerSetInstallResultArchive()); - } else { - Stickers::applyArchivedResultFake(); } } @@ -520,22 +519,28 @@ void StickersBox::onStickersUpdated() { } } -void StickersBox::rebuildList() { - if (_tab == &_installed) { - _localOrder = _tab->widget()->getFullOrder(); - _localRemoved = _tab->widget()->getRemovedSets(); +void StickersBox::rebuildList(Tab *tab) { + if (!tab) tab = _tab; + + if (tab == &_installed) { + _localOrder = tab->widget()->getFullOrder(); + _localRemoved = tab->widget()->getRemovedSets(); } - _tab->widget()->rebuild(); - if (_tab == &_installed) { - _tab->widget()->setFullOrder(_localOrder); + tab->widget()->rebuild(); + if (tab == &_installed) { + tab->widget()->setFullOrder(_localOrder); } - _tab->widget()->setRemovedSets(_localRemoved); + tab->widget()->setRemovedSets(_localRemoved); } void StickersBox::closeHook() { if (!_installed.widget()) { return; } + + // Make sure that our changes in other tabs are applied in the Installed tab. + rebuildList(&_installed); + if (_someArchivedLoaded) { Local::writeArchivedStickers(); } diff --git a/Telegram/SourceFiles/boxes/stickers_box.h b/Telegram/SourceFiles/boxes/stickers_box.h index 0a3dffc4e..417659282 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.h +++ b/Telegram/SourceFiles/boxes/stickers_box.h @@ -62,31 +62,6 @@ private slots: void onStickersUpdated(); private: - void refreshTabs(); - void rebuildList(); - void updateTabsGeometry(); - void switchTab(); - void installSet(uint64 setId); - int getTopSkip() const; - - QPixmap grabContentCache(); - - void installDone(const MTPmessages_StickerSetInstallResult &result); - bool installFail(uint64 setId, const RPCError &error); - - void preloadArchivedSets(); - void requestArchivedSets(); - void loadMoreArchived(); - void getArchivedDone(uint64 offsetId, const MTPmessages_ArchivedStickers &result); - - object_ptr _tabs = { nullptr }; - QList
_tabIndices; - - class CounterWidget; - object_ptr _unreadBadge = { nullptr }; - - Section _section; - class Inner; class Tab { public: @@ -117,6 +92,32 @@ private: int _scrollTop = 0; }; + + void refreshTabs(); + void rebuildList(Tab *tab = nullptr); + void updateTabsGeometry(); + void switchTab(); + void installSet(uint64 setId); + int getTopSkip() const; + + QPixmap grabContentCache(); + + void installDone(const MTPmessages_StickerSetInstallResult &result); + bool installFail(uint64 setId, const RPCError &error); + + void preloadArchivedSets(); + void requestArchivedSets(); + void loadMoreArchived(); + void getArchivedDone(uint64 offsetId, const MTPmessages_ArchivedStickers &result); + + object_ptr _tabs = { nullptr }; + QList
_tabIndices; + + class CounterWidget; + object_ptr _unreadBadge = { nullptr }; + + Section _section; + Tab _installed; Tab _featured; Tab _archived; diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 7cd9723c4..65c5c451d 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 (10020003ULL) +#define BETA_VERSION_MACRO (10020004ULL) constexpr int AppVersion = 10020; constexpr str_const AppVersionStr = "0.10.20"; diff --git a/Telegram/SourceFiles/ui/widgets/widgets.style b/Telegram/SourceFiles/ui/widgets/widgets.style index 59e743ce9..b63f42395 100644 --- a/Telegram/SourceFiles/ui/widgets/widgets.style +++ b/Telegram/SourceFiles/ui/widgets/widgets.style @@ -677,11 +677,11 @@ defaultSettingsSlider: SettingsSlider { } defaultTabsSlider: SettingsSlider(defaultSettingsSlider) { - height: 49px; - barTop: 46px; + height: 53px; + barTop: 50px; barSkip: 0px; barFg: transparent; - labelTop: 16px; + labelTop: 19px; labelFont: semiboldFont; labelFg: windowSubTextFg; labelFgActive: lightButtonFg; diff --git a/Telegram/build/version b/Telegram/build/version index b2172bc8d..0ef9edf86 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 10020003 +BetaVersion 10020004