Skip to content

Commit

Permalink
Closed beta 10020004: stickers box fixed, manage admins box fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Dec 30, 2016
1 parent eb4d2a3 commit 1d895cd
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 57 deletions.
Binary file modified Telegram/Resources/icons/bubble_tail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Telegram/Resources/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
16 changes: 9 additions & 7 deletions Telegram/SourceFiles/boxes/abstractbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ void BoxContent::setInner(object_ptr<TWidget> inner) {
void BoxContent::setInner(object_ptr<TWidget> 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<BoxLayerTitleShadow>(this));
_bottomShadow.create(this, object_ptr<BoxLayerTitleShadow>(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();
Expand Down
29 changes: 17 additions & 12 deletions Telegram/SourceFiles/boxes/stickers_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -401,6 +401,7 @@ void StickersBox::switchTab() {
_tab = newTab;
_section = newSection;
setInnerWidget(_tab->takeWidget(), getTopSkip());
_tabs->raise();
_tab->widget()->show();
rebuildList();
onScrollToY(_tab->getScrollTop());
Expand Down Expand Up @@ -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();
}
}

Expand Down Expand Up @@ -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();
}
Expand Down
51 changes: 26 additions & 25 deletions Telegram/SourceFiles/boxes/stickers_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Ui::SettingsSlider> _tabs = { nullptr };
QList<Section> _tabIndices;

class CounterWidget;
object_ptr<CounterWidget> _unreadBadge = { nullptr };

Section _section;

class Inner;
class Tab {
public:
Expand Down Expand Up @@ -117,6 +92,32 @@ private slots:
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<Ui::SettingsSlider> _tabs = { nullptr };
QList<Section> _tabIndices;

class CounterWidget;
object_ptr<CounterWidget> _unreadBadge = { nullptr };

Section _section;

Tab _installed;
Tab _featured;
Tab _archived;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/core/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions Telegram/SourceFiles/ui/widgets/widgets.style
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/build/version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ AppVersionStrMajor 0.10
AppVersionStrSmall 0.10.20
AppVersionStr 0.10.20
AlphaChannel 0
BetaVersion 10020003
BetaVersion 10020004

0 comments on commit 1d895cd

Please sign in to comment.