mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Scroll to bottom when sending a comment.
This commit is contained in:
parent
6f9ea1cc01
commit
608d8307d9
2 changed files with 19 additions and 13 deletions
|
@ -765,10 +765,7 @@ void RepliesWidget::send(Api::SendOptions options) {
|
||||||
//_saveDraftStart = crl::now();
|
//_saveDraftStart = crl::now();
|
||||||
//onDraftSave();
|
//onDraftSave();
|
||||||
|
|
||||||
_composeControls->hidePanelsAnimated();
|
finishSending();
|
||||||
|
|
||||||
//if (_previewData && _previewData->pendingTill) previewCancel();
|
|
||||||
_composeControls->focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RepliesWidget::edit(
|
void RepliesWidget::edit(
|
||||||
|
@ -881,8 +878,7 @@ bool RepliesWidget::sendExistingDocument(
|
||||||
//}
|
//}
|
||||||
|
|
||||||
_composeControls->cancelReplyMessage();
|
_composeControls->cancelReplyMessage();
|
||||||
_composeControls->hidePanelsAnimated();
|
finishSending();
|
||||||
_composeControls->focus();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -914,8 +910,7 @@ bool RepliesWidget::sendExistingPhoto(
|
||||||
Api::SendExistingPhoto(std::move(message), photo);
|
Api::SendExistingPhoto(std::move(message), photo);
|
||||||
|
|
||||||
_composeControls->cancelReplyMessage();
|
_composeControls->cancelReplyMessage();
|
||||||
_composeControls->hidePanelsAnimated();
|
finishSending();
|
||||||
_composeControls->focus();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,9 +957,7 @@ void RepliesWidget::sendInlineResult(
|
||||||
bots.push_front(bot);
|
bots.push_front(bot);
|
||||||
bot->session().local().writeRecentHashtagsAndBots();
|
bot->session().local().writeRecentHashtagsAndBots();
|
||||||
}
|
}
|
||||||
|
finishSending();
|
||||||
_composeControls->hidePanelsAnimated();
|
|
||||||
_composeControls->focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMenu::Type RepliesWidget::sendMenuType() const {
|
SendMenu::Type RepliesWidget::sendMenuType() const {
|
||||||
|
@ -998,14 +991,25 @@ void RepliesWidget::setupScrollDownButton() {
|
||||||
|
|
||||||
void RepliesWidget::scrollDownClicked() {
|
void RepliesWidget::scrollDownClicked() {
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier) {
|
if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier) {
|
||||||
showAtPosition(Data::MaxMessagePosition);
|
showAtEnd();
|
||||||
} else if (_replyReturn) {
|
} else if (_replyReturn) {
|
||||||
showAtPosition(_replyReturn->position());
|
showAtPosition(_replyReturn->position());
|
||||||
} else {
|
} else {
|
||||||
showAtPosition(Data::MaxMessagePosition);
|
showAtEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RepliesWidget::showAtEnd() {
|
||||||
|
showAtPosition(Data::MaxMessagePosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RepliesWidget::finishSending() {
|
||||||
|
_composeControls->hidePanelsAnimated();
|
||||||
|
//if (_previewData && _previewData->pendingTill) previewCancel();
|
||||||
|
_composeControls->focus();
|
||||||
|
showAtEnd();
|
||||||
|
}
|
||||||
|
|
||||||
void RepliesWidget::showAtPosition(
|
void RepliesWidget::showAtPosition(
|
||||||
Data::MessagePosition position,
|
Data::MessagePosition position,
|
||||||
HistoryItem *originItem) {
|
HistoryItem *originItem) {
|
||||||
|
|
|
@ -139,12 +139,14 @@ private:
|
||||||
void updateAdaptiveLayout();
|
void updateAdaptiveLayout();
|
||||||
void saveState(not_null<RepliesMemento*> memento);
|
void saveState(not_null<RepliesMemento*> memento);
|
||||||
void restoreState(not_null<RepliesMemento*> memento);
|
void restoreState(not_null<RepliesMemento*> memento);
|
||||||
|
void showAtEnd();
|
||||||
void showAtPosition(
|
void showAtPosition(
|
||||||
Data::MessagePosition position,
|
Data::MessagePosition position,
|
||||||
HistoryItem *originItem = nullptr);
|
HistoryItem *originItem = nullptr);
|
||||||
bool showAtPositionNow(
|
bool showAtPositionNow(
|
||||||
Data::MessagePosition position,
|
Data::MessagePosition position,
|
||||||
HistoryItem *originItem);
|
HistoryItem *originItem);
|
||||||
|
void finishSending();
|
||||||
|
|
||||||
void setupComposeControls();
|
void setupComposeControls();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue