From be939201fd529aced04cf0ab0285962e5811d908 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 15 Aug 2014 16:44:01 +0400 Subject: [PATCH] fixed media overview scroll init, version 0.5.16 --- Telegram/PrepareLinux.sh | 4 ++-- Telegram/PrepareLinux32.sh | 4 ++-- Telegram/PrepareMac.sh | 4 ++-- Telegram/Setup.iss | 6 +++--- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/overviewwidget.cpp | 12 ++++++++---- Telegram/SourceFiles/overviewwidget.h | 2 ++ Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | Bin 5566 -> 5566 bytes Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ 10 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Telegram/PrepareLinux.sh b/Telegram/PrepareLinux.sh index 64ec7876deab8..94a726a525d5b 100755 --- a/Telegram/PrepareLinux.sh +++ b/Telegram/PrepareLinux.sh @@ -1,5 +1,5 @@ -AppVersionStr=0.5.15 -AppVersion=5015 +AppVersionStr=0.5.16 +AppVersion=5016 if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then echo "Deploy folder for version $AppVersionStr already exists!" diff --git a/Telegram/PrepareLinux32.sh b/Telegram/PrepareLinux32.sh index f127ee219c72a..f306f6dabcb14 100755 --- a/Telegram/PrepareLinux32.sh +++ b/Telegram/PrepareLinux32.sh @@ -1,5 +1,5 @@ -AppVersionStr=0.5.15 -AppVersion=5015 +AppVersionStr=0.5.16 +AppVersion=5016 if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then echo "Deploy folder for version $AppVersionStr already exists!" diff --git a/Telegram/PrepareMac.sh b/Telegram/PrepareMac.sh index d8b0db8a07cda..f8260595db5b0 100755 --- a/Telegram/PrepareMac.sh +++ b/Telegram/PrepareMac.sh @@ -1,5 +1,5 @@ -AppVersionStr=0.5.15 -AppVersion=5015 +AppVersionStr=0.5.16 +AppVersion=5016 if [ -d "./../Mac/Release/deploy/$AppVersionStr" ]; then echo "Deploy folder for version $AppVersionStr already exists!" diff --git a/Telegram/Setup.iss b/Telegram/Setup.iss index 7a4cce25c2d2f..423e490af77d6 100644 --- a/Telegram/Setup.iss +++ b/Telegram/Setup.iss @@ -3,9 +3,9 @@ #define MyAppShortName "Telegram" #define MyAppName "Telegram Win (Unofficial)" -#define MyAppVersion "0.5.15" -#define MyAppVersionZero "0.5.15" -#define MyAppFullVersion "0.5.15.0" +#define MyAppVersion "0.5.16" +#define MyAppVersionZero "0.5.16" +#define MyAppFullVersion "0.5.16.0" #define MyAppPublisher "Telegram (Unofficial)" #define MyAppURL "https://tdesktop.com" #define MyAppExeName "Telegram.exe" diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 3427079098a05..f8cbf17f84870 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com */ #pragma once -static const int32 AppVersion = 5015; -static const wchar_t *AppVersionStr = L"0.5.15"; +static const int32 AppVersion = 5016; +static const wchar_t *AppVersionStr = L"0.5.16"; #ifdef Q_OS_WIN static const wchar_t *AppName = L"Telegram Win (Unofficial)"; #else diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 553831722d5ec..ed0bc0505ca96 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -614,6 +614,7 @@ OverviewWidget::OverviewWidget(QWidget *parent, const PeerData *peer, MediaOverv , _noDropResizeIndex(false) , _bg(st::msgBG) , _showing(false) + , _scrollSetAfterShow(0) { _scroll.setWidget(&_inner); _scroll.move(0, 0); @@ -677,10 +678,11 @@ void OverviewWidget::paintEvent(QPaintEvent *e) { } void OverviewWidget::scrollBy(int32 add) { - bool wasHidden = _scroll.isHidden(); - if (wasHidden) _scroll.show(); - _scroll.scrollToY(_scroll.scrollTop() + add); - if (wasHidden) _scroll.hide(); + if (_scroll.isHidden()) { + _scrollSetAfterShow += add; + } else { + _scroll.scrollToY(_scroll.scrollTop() + add); + } } void OverviewWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) { @@ -736,6 +738,7 @@ void OverviewWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimT App::main()->topBar()->stopAnim(); _animTopBarCache = myGrab(App::main()->topBar(), QRect(0, 0, width(), st::topBarHeight)); App::main()->topBar()->startAnim(); + _scrollSetAfterShow = _scroll.scrollTop(); _scroll.hide(); a_coord = back ? anim::ivalue(-st::introSlideShift, 0) : anim::ivalue(st::introSlideShift, 0); a_alpha = anim::fvalue(0, 1); @@ -761,6 +764,7 @@ bool OverviewWidget::animStep(float64 ms) { _bgAnimCache = _animCache = _animTopBarCache = _bgAnimTopBarCache = QPixmap(); App::main()->topBar()->stopAnim(); _scroll.show(); + _scroll.scrollToY(_scrollSetAfterShow); activate(); onScroll(); } else { diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index 6f1f653610868..ce6a08e606bf6 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -161,5 +161,7 @@ public slots: anim::ivalue a_coord, a_bgCoord; anim::fvalue a_alpha, a_bgAlpha; + int32 _scrollSetAfterShow; + }; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 9cdeaad84b8a2..b96cad668cea0 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5.15 + 0.5.16 CFBundleSignature ???? NOTE diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 0bd6ec1b747ec92f9e505f883563a918f06487c8..0bd2465cbceb78beef0cf54b31ccc1fa03709259 100644 GIT binary patch delta 58 zcmdm|y-$0C9yg=eWPNU9Rx<`227}2Pxg|F@a2GKFxq3kETwdMHDtvN`aIW~~IQ|4S E0JuyJ9smFU delta 58 zcmdm|y-$0C9yg=uWPNU9R#OHY27}2Pxg|F@a2GKFxq3kETwdMHDtvN`aIW~~IQ|4S E0Jp;q8UO$Q diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 523dfd5e9a7c9..540f58f0dddc1 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1478,7 +1478,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.5.15; + CURRENT_PROJECT_VERSION = 0.5.16; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1496,7 +1496,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.5.15; + CURRENT_PROJECT_VERSION = 0.5.16; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1521,10 +1521,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.5.15; + CURRENT_PROJECT_VERSION = 0.5.16; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.5; - DYLIB_CURRENT_VERSION = 0.5.15; + DYLIB_CURRENT_VERSION = 0.5.16; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; @@ -1650,10 +1650,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.5.15; + CURRENT_PROJECT_VERSION = 0.5.16; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.5; - DYLIB_CURRENT_VERSION = 0.5.15; + DYLIB_CURRENT_VERSION = 0.5.16; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO;