Disappearing of HistoryInner because of pending resize fixed.

This commit is contained in:
John Preston 2016-04-04 12:57:36 +04:00
parent 2826bb9134
commit 1875ee59ee
3 changed files with 28 additions and 9 deletions

View File

@ -201,7 +201,7 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
return;
}
if ((_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems())) {
if (hasPendingResizedItems()) {
return;
}
@ -1455,9 +1455,7 @@ void HistoryInner::visibleAreaUpdated(int top, int bottom) {
_visibleAreaBottom = bottom;
// if history has pending resize events we should not update scrollTopItem
if (_history->hasPendingResizedItems()) {
return;
} else if (_migrated && _migrated->hasPendingResizedItems()) {
if (hasPendingResizedItems()) {
return;
}
@ -1685,7 +1683,7 @@ void HistoryInner::onTouchSelect() {
}
void HistoryInner::onUpdateSelected() {
if (!_history || _history->hasPendingResizedItems() || (_migrated && _migrated->hasPendingResizedItems())) {
if (!_history || hasPendingResizedItems()) {
return;
}
@ -3241,7 +3239,13 @@ void HistoryWidget::sendActionDone(const MTPBool &result, mtpRequestId req) {
}
void HistoryWidget::activate() {
if (_history) updateListSize(true);
if (_history) {
if (!_histInited) {
updateListSize(true);
} else if (hasPendingResizedItems()) {
updateListSize();
}
}
if (App::wnd()) App::wnd()->setInnerFocus();
}
@ -5064,7 +5068,11 @@ void HistoryWidget::doneShow() {
updateReportSpamStatus();
updateBotKeyboard();
updateControlsVisibility();
updateListSize(true);
if (!_histInited) {
updateListSize(true);
} else if (hasPendingResizedItems()) {
updateListSize();
}
preloadHistoryIfNeeded();
if (App::wnd()) {
App::wnd()->checkHistoryActivation();
@ -6296,7 +6304,7 @@ void HistoryWidget::notify_automaticLoadSettingsChangedGif() {
}
void HistoryWidget::notify_handlePendingHistoryUpdate() {
if ((_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems())) {
if (hasPendingResizedItems()) {
updateListSize();
_list->update();
}

View File

@ -169,6 +169,11 @@ private:
void applyDragSelection(SelectedItems *toItems) const;
void addSelectionRange(SelectedItems *toItems, int32 fromblock, int32 fromitem, int32 toblock, int32 toitem, History *h) const;
// Does any of the shown histories has this flag set.
bool hasPendingResizedItems() const {
return (_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems());
}
enum DragAction {
NoDrag = 0x00,
PrepareDrag = 0x01,
@ -847,6 +852,11 @@ private:
};
void updateListSize(bool initial = false, bool loadedDown = false, const ScrollChange &change = { ScrollChangeNone, 0 });
// Does any of the shown histories has this flag set.
bool hasPendingResizedItems() const {
return (_history && _history->hasPendingResizedItems()) || (_migrated && _migrated->hasPendingResizedItems());
}
// Counts scrollTop for placing the scroll right at the unread
// messages bar, choosing from _history and _migrated unreadBar.
int unreadBarTop() const;

View File

@ -88,7 +88,7 @@
07084670195445A600B5AE3A /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0730;
};
buildConfigurationList = 07084673195445A600B5AE3A /* Build configuration list for PBXProject "Updater" */;
compatibilityVersion = "Xcode 3.2";
@ -138,6 +138,7 @@
CODE_SIGN_IDENTITY = "";
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Telegram.app/Contents/Frameworks";
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;