diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 60892aea25..4e66631135 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -8377,7 +8377,7 @@ void GoToMessageClickHandler::onClickImpl() const { if (current && current->history()->peer->id == peer()) { App::main()->pushReplyReturn(current); } - Ui::showPeerHistory(peer(), msgid()); + Ui::showPeerHistory(peer(), msgid(), Ui::ShowWay::Forward); } } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 04d3e622ef..8ff04dd03c 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -3451,7 +3451,7 @@ void MainWidget::usernameResolveDone(QPair msgIdAndStartToken, c _history->resizeEvent(0); } } - Ui::showPeerHistory(peer->id, msgId); + Ui::showPeerHistory(peer->id, msgId, Ui::ShowWay::Forward); } } diff --git a/Telegram/SourceFiles/profile/profile_actions_widget.cpp b/Telegram/SourceFiles/profile/profile_actions_widget.cpp index 3527f95e2d..df96da74bb 100644 --- a/Telegram/SourceFiles/profile/profile_actions_widget.cpp +++ b/Telegram/SourceFiles/profile/profile_actions_widget.cpp @@ -98,15 +98,15 @@ Ui::LeftOutlineButton *ActionsWidget::addButton(const QString &text, const char result->show(); int top = buttonsBottom() + skipHeight; - resizeButton(result, top); + resizeButton(result, width(), top); _buttons.push_back(result); return result; }; -void ActionsWidget::resizeButton(Ui::LeftOutlineButton *button, int top) { +void ActionsWidget::resizeButton(Ui::LeftOutlineButton *button, int newWidth, int top) { int left = defaultOutlineButtonLeft(); - int availableWidth = width() - left - st::profileBlockMarginRight; + int availableWidth = newWidth - left - st::profileBlockMarginRight; accumulate_min(availableWidth, st::profileBlockOneLineWidthMax); button->resizeToWidth(availableWidth); button->moveToLeft(left, top); @@ -242,7 +242,7 @@ void ActionsWidget::refreshLeaveChannel() { int ActionsWidget::resizeGetHeight(int newWidth) { for_const (auto button, _buttons) { - resizeButton(button, button->y()); + resizeButton(button, newWidth, button->y()); } return buttonsBottom(); } diff --git a/Telegram/SourceFiles/profile/profile_actions_widget.h b/Telegram/SourceFiles/profile/profile_actions_widget.h index 08474c84e1..0043ccfb72 100644 --- a/Telegram/SourceFiles/profile/profile_actions_widget.h +++ b/Telegram/SourceFiles/profile/profile_actions_widget.h @@ -73,7 +73,7 @@ private: Ui::LeftOutlineButton *addButton(const QString &text, const char *slot , const style::OutlineButton &st = st::defaultLeftOutlineButton, int skipHeight = 0); - void resizeButton(Ui::LeftOutlineButton *button, int top); + void resizeButton(Ui::LeftOutlineButton *button, int newWidth, int top); QString getBlockButtonText() const; bool hasBotCommand(const QString &command) const; diff --git a/Telegram/SourceFiles/profile/profile_shared_media_widget.cpp b/Telegram/SourceFiles/profile/profile_shared_media_widget.cpp index 313aaad780..23c4063956 100644 --- a/Telegram/SourceFiles/profile/profile_shared_media_widget.cpp +++ b/Telegram/SourceFiles/profile/profile_shared_media_widget.cpp @@ -84,7 +84,7 @@ void SharedMediaWidget::notifyPeerUpdated(const Notify::PeerUpdate &update) { int SharedMediaWidget::resizeGetHeight(int newWidth) { int newHeight = contentTop(); - resizeButtons(&newHeight); + resizeButtons(newWidth, &newHeight); return newHeight; } @@ -135,11 +135,11 @@ void SharedMediaWidget::onMediaChosen() { } } -void SharedMediaWidget::resizeButtons(int *top) { +void SharedMediaWidget::resizeButtons(int newWidth, int *top) { t_assert(top != nullptr); int left = defaultOutlineButtonLeft(); - int availableWidth = width() - left - st::profileBlockMarginRight; + int availableWidth = newWidth - left - st::profileBlockMarginRight; accumulate_min(availableWidth, st::profileBlockOneLineWidthMax); for_const (auto button, _mediaButtons) { if (!button) continue; diff --git a/Telegram/SourceFiles/profile/profile_shared_media_widget.h b/Telegram/SourceFiles/profile/profile_shared_media_widget.h index 24db5cedcf..f225778b99 100644 --- a/Telegram/SourceFiles/profile/profile_shared_media_widget.h +++ b/Telegram/SourceFiles/profile/profile_shared_media_widget.h @@ -53,7 +53,7 @@ private: void refreshButton(MediaOverviewType type); void refreshVisibility(); - void resizeButtons(int *top); + void resizeButtons(int newWidth, int *top); Ui::LeftOutlineButton *_mediaButtons[OverviewCount] = { nullptr }; History *_history; diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 29e3623cfa..e6098fa03e 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -1636,7 +1636,7 @@ void PeerOpenClickHandler::onClickImpl() const { if (!peer()->asChannel()->isPublic() && !peer()->asChannel()->amIn()) { Ui::showLayer(new InformBox(lang((peer()->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible))); } else { - Ui::showPeerHistory(peer(), ShowAtUnreadMsgId); + Ui::showPeerHistory(peer(), ShowAtUnreadMsgId, Ui::ShowWay::Forward); } } else { Ui::showPeerProfile(peer());