From 0251f58bf2815a944f5d43af70c1e5e2a8992806 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 May 2020 12:12:43 +0400 Subject: [PATCH] Use Semibold in names, use Bold in messages. Fixes #7813, fixes #7823. --- .../SourceFiles/api/api_text_entities.cpp | 1 + .../admin_log/history_admin_log_inner.cpp | 2 +- .../history/view/media/history_view_dice.cpp | 2 +- Telegram/SourceFiles/intro/intro_qr.cpp | 2 +- .../media/player/media_player_widget.cpp | 9 ++++++-- .../SourceFiles/overview/overview_layout.cpp | 22 +++++++++++++++---- Telegram/lib_ui | 2 +- 7 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/api/api_text_entities.cpp b/Telegram/SourceFiles/api/api_text_entities.cpp index eb3f0ebf1..919a18c63 100644 --- a/Telegram/SourceFiles/api/api_text_entities.cpp +++ b/Telegram/SourceFiles/api/api_text_entities.cpp @@ -82,6 +82,7 @@ MTPVector EntitiesToMTP( if (entity.length() <= 0) continue; if (option == ConvertOption::SkipLocal && entity.type() != EntityType::Bold + //&& entity.type() != EntityType::Semibold // Not in API. && entity.type() != EntityType::Italic && entity.type() != EntityType::Underline && entity.type() != EntityType::StrikeOut diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 0a8a5149f..98e60fb67 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -478,7 +478,7 @@ void InnerWidget::updateEmptyText() { options.flags |= TextParseMarkdown; auto hasSearch = !_searchQuery.isEmpty(); auto hasFilter = (_filter.flags != 0) || !_filter.allUsers; - auto text = Ui::Text::Bold((hasSearch || hasFilter) + auto text = Ui::Text::Semibold((hasSearch || hasFilter) ? tr::lng_admin_log_no_results_title(tr::now) : tr::lng_admin_log_no_events_title(tr::now)); auto description = hasSearch diff --git a/Telegram/SourceFiles/history/view/media/history_view_dice.cpp b/Telegram/SourceFiles/history/view/media/history_view_dice.cpp index 8a438534e..5dcc98492 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_dice.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_dice.cpp @@ -53,7 +53,7 @@ namespace { auto link = Ui::Text::Link( tr::lng_about_random_send(tr::now).toUpper()); link.entities.push_back( - EntityInText(EntityType::Bold, 0, link.text.size())); + EntityInText(EntityType::Semibold, 0, link.text.size())); config.text.append(' ').append(std::move(link)); config.filter = crl::guard(&history->session(), [=]( const ClickHandlerPtr &handler, diff --git a/Telegram/SourceFiles/intro/intro_qr.cpp b/Telegram/SourceFiles/intro/intro_qr.cpp index 51294a4a4..e2c00a82d 100644 --- a/Telegram/SourceFiles/intro/intro_qr.cpp +++ b/Telegram/SourceFiles/intro/intro_qr.cpp @@ -269,7 +269,7 @@ void QrWidget::setupControls() { st::introQrStepMargins); const auto number = Ui::CreateChild( steps, - rpl::single(Ui::Text::Bold(QString::number(++index) + ".")), + rpl::single(Ui::Text::Semibold(QString::number(++index) + ".")), st::defaultFlatLabel); rpl::combine( number->widthValue(), diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index ce4d2a12c..2bbad2d24 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -544,7 +544,7 @@ void Widget::handleSongChange() { textWithEntities.text = name + ' ' + date(); textWithEntities.entities.append(EntityInText( - EntityType::Bold, + EntityType::Semibold, 0, name.size(), QString())); @@ -565,7 +565,12 @@ void Widget::handleSongChange() { : TextUtilities::Clean(song->title); auto dash = QString::fromUtf8(" \xe2\x80\x93 "); textWithEntities.text = song->performer + dash + title; - textWithEntities.entities.append({ EntityType::Bold, 0, song->performer.size(), QString() }); + textWithEntities.entities.append({ + EntityType::Semibold, + 0, + song->performer.size(), + QString() + }); } } _nameLabel->setMarkedText(textWithEntities); diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 2b85773eb..442b5bf5a 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -55,13 +55,27 @@ TextWithEntities ComposeNameWithEntities(DocumentData *document) { result.text = document->filename().isEmpty() ? qsl("Unknown File") : document->filename(); - result.entities.push_back({ EntityType::Bold, 0, result.text.size() }); + result.entities.push_back({ + EntityType::Semibold, + 0, + result.text.size() + }); } else if (song->performer.isEmpty()) { result.text = song->title; - result.entities.push_back({ EntityType::Bold, 0, result.text.size() }); + result.entities.push_back({ + EntityType::Semibold, + 0, + result.text.size() + }); } else { - result.text = song->performer + QString::fromUtf8(" \xe2\x80\x93 ") + (song->title.isEmpty() ? qsl("Unknown Track") : song->title); - result.entities.push_back({ EntityType::Bold, 0, song->performer.size() }); + result.text = song->performer + + QString::fromUtf8(" \xe2\x80\x93 ") + + (song->title.isEmpty() ? qsl("Unknown Track") : song->title); + result.entities.push_back({ + EntityType::Semibold, + 0, + song->performer.size() + }); } return result; } diff --git a/Telegram/lib_ui b/Telegram/lib_ui index ab5a22605..0ef955826 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit ab5a2260562078b7e5abcda8bb0eb2a61984bfd5 +Subproject commit 0ef9558269d0af6ba9466c3ce548351185bd7266