diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index bf07a58f1..829ffc80c 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -105,7 +105,7 @@ ScheduledWidget::ScheduledWidget( this, controller, ComposeControls::Mode::Scheduled, - SendMenu::Type::Disabled)) + SendMenu::Type::PreviewOnly)) , _scrollDown( _scroll, controller->chatStyle()->value(lifetime(), st::historyToDown)) { @@ -127,6 +127,9 @@ ScheduledWidget::ScheduledWidget( .section = Dialogs::EntryState::Section::Scheduled, }; _topBar->setActiveChat(state, nullptr); + _topBar->setCustomTitle(_history->peer->isSelf() + ? tr::lng_reminder_messages(tr::now) + : tr::lng_scheduled_messages(tr::now)); _composeControls->setCurrentDialogsEntryState(state); _topBar->move(0, 0); diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index 605cc1da9..5186a3ff0 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -432,17 +432,10 @@ void TopBarWidget::paintTopBar(Painter &p) { const auto now = crl::now(); const auto history = _activeChat.key.history(); const auto folder = _activeChat.key.folder(); - if (folder - || history->peer->sharedMediaInfo() - || (_activeChat.section == Section::Scheduled) - || (_activeChat.section == Section::Pinned)) { + if (folder || history->peer->sharedMediaInfo()) { // #TODO feed name emoji. auto text = (_activeChat.section == Section::Scheduled) - ? ((history && history->peer->isSelf()) - ? tr::lng_reminder_messages(tr::now) - : tr::lng_scheduled_messages(tr::now)) - : (_activeChat.section == Section::Pinned) - ? _customTitleText + ? tr::lng_reminder_messages(tr::now) : folder ? folder->chatListName() : history->peer->isSelf() @@ -459,25 +452,33 @@ void TopBarWidget::paintTopBar(Painter &p) { (height() - st::historySavedFont->height) / 2, width(), text); - } else if (_activeChat.section == Section::Replies) { + } else if (_activeChat.section == Section::Replies + || _activeChat.section == Section::Scheduled + || _activeChat.section == Section::Pinned) { p.setPen(st::dialogsNameFg); - p.setFont(st::semiboldFont); - p.drawTextLeft( - nameleft, - nametop, - width(), - tr::lng_manage_discussion_group(tr::now)); + + Ui::Text::String textStr; + textStr.setText( + st::semiboldTextStyle, + (_activeChat.section == Section::Replies + ? tr::lng_manage_discussion_group(tr::now) + : history->peer->isSelf() + ? tr::lng_saved_messages(tr::now) + : history->peer->topBarNameText().toString()), + Ui::NameTextOptions()); + textStr.drawElided(p, nameleft, nametop, width()); p.setFont(st::dialogsTextFont); if (!paintConnectingState(p, nameleft, statustop, width()) - && !paintSendAction( - p, - nameleft, - statustop, - availableWidth, - width(), - st::historyStatusFgTyping, - now)) { + && (_activeChat.section != Section::Replies + || !paintSendAction( + p, + nameleft, + statustop, + availableWidth, + width(), + st::historyStatusFgTyping, + now))) { p.setPen(st::historyStatusFg); p.drawTextLeft(nameleft, statustop, width(), _customTitleText); }