diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 4573b28a8b058..e0fd4fc9bc6f8 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2521,6 +2521,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_credits_small_balance_about" = "Buy **Stars** and use them on **{bot}** and other miniapps."; "lng_credits_small_balance_reaction" = "Buy **Stars** and send them to {channel} to support their posts."; "lng_credits_small_balance_subscribe" = "Buy **Stars** and subscribe to **{channel}** and other channels."; +"lng_credits_small_balance_star_gift" = "Buy **Stars** to send gifts to {user} and other contacts."; "lng_credits_small_balance_fallback" = "Buy **Stars** to unlock content and services on Telegram."; "lng_credits_purchase_blocked" = "Sorry, you can't purchase this item with Telegram Stars."; "lng_credits_enough" = "You have enough stars at the moment. {link}"; @@ -3049,6 +3050,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_gift_stars_about" = "Give {name} gifts that can be kept on your profile or converted to Stars. {link}"; "lng_gift_stars_link" = "What are Stars >"; "lng_gift_stars_limited" = "limited"; +"lng_gift_stars_sold_out" = "sold out"; "lng_gift_stars_tabs_all" = "All Gifts"; "lng_gift_stars_tabs_limited" = "Limited"; "lng_gift_send_title" = "Send a Gift"; @@ -3082,6 +3084,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_gift_display_done_hide" = "The gift is now hidden from your profile page."; "lng_gift_got_stars#one" = "You got **{count} Star** for this gift."; "lng_gift_got_stars#other" = "You got **{count} Stars** for this gift."; +"lng_gift_sold_out_title" = "Sold Out!"; +"lng_gift_sold_out_text#one" = "All {count} gift was already sold."; +"lng_gift_sold_out_text#other" = "All {count} gifts were already sold."; "lng_accounts_limit_title" = "Limit Reached"; "lng_accounts_limit1#one" = "You have reached the limit of **{count}** connected account."; diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index c5db9e6f7e0a9..c2a348d684147 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -10,7 +10,7 @@ + Version="5.6.1.0" /> Telegram Desktop Telegram Messenger LLP diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 80059b9581ddc..ca5a07a29b29f 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,6,0,0 - PRODUCTVERSION 5,6,0,0 + FILEVERSION 5,6,1,0 + PRODUCTVERSION 5,6,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -62,10 +62,10 @@ BEGIN BEGIN VALUE "CompanyName", "" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "5.6.0.0" + VALUE "FileVersion", "5.6.1.0" VALUE "LegalCopyright", "Copyright (C) 2014-2024" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "5.6.0.0" + VALUE "ProductVersion", "5.6.1.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index a07973bdba70c..527b09e4ba65c 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,6,0,0 - PRODUCTVERSION 5,6,0,0 + FILEVERSION 5,6,1,0 + PRODUCTVERSION 5,6,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -53,10 +53,10 @@ BEGIN BEGIN VALUE "CompanyName", "" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "5.6.0.0" + VALUE "FileVersion", "5.6.1.0" VALUE "LegalCopyright", "Copyright (C) 2014-2024" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "5.6.0.0" + VALUE "ProductVersion", "5.6.1.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/boxes/star_gift_box.cpp b/Telegram/SourceFiles/boxes/star_gift_box.cpp index ce239e2475609..f1eed48e2efe6 100644 --- a/Telegram/SourceFiles/boxes/star_gift_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_box.cpp @@ -514,6 +514,7 @@ void PreviewWrap::paintEvent(QPaintEvent *e) { .convertStars = gift.convertStars, .document = gift.document, .limitedCount = gift.limitedCount, + .limitedLeft = gift.limitedLeft, }); } auto &map = Map[session]; @@ -1081,6 +1082,7 @@ void SendGiftBox( } }; button->setClickedCallback([=] { + const auto star = std::get_if(&descriptor); if (v::is(descriptor)) { if (state->sending) { return; @@ -1093,6 +1095,15 @@ void SendGiftBox( api, GiftDetails{ descriptor }, premiumSent); + } else if (star && star->limitedCount && !star->limitedLeft) { + window->showToast({ + .title = tr::lng_gift_sold_out_title(tr::now), + .text = tr::lng_gift_sold_out_text( + tr::now, + lt_count_decimal, + star->limitedCount, + Ui::Text::RichLangValue), + }); } else { window->show( Box(SendGiftBox, window, peer, api, descriptor)); diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index e69d19923639c..fe4807bec5a2d 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -1149,6 +1149,7 @@ groupCallTitle: WindowTitle(defaultWindowTitle) { bgActive: groupCallBg; fg: transparent; fgActive: transparent; + oneSideControls: true; minimize: IconButton(groupCallTitleButton) { icon: groupCallTitleMinimizeIcon; iconOver: groupCallTitleMinimizeIconOver; diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index c3f94e0ecb175..6f0ab0f6a679b 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -198,7 +198,9 @@ void Panel::initWindow() { return Flag::None | Flag(0); } #ifndef Q_OS_MAC - if (_controls->controls.geometry().contains(widgetPoint)) { + using Result = Ui::Platform::HitTestResult; + const auto windowPoint = widget()->mapTo(window(), widgetPoint); + if (_controls->controls.hitTest(windowPoint) != Result::None) { return Flag::None | Flag(0); } #endif // !Q_OS_MAC diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index dfa9f19039488..1ca6e83537ceb 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -24,7 +24,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs; constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs; constexpr auto AppName = "Telegram Desktop"_cs; constexpr auto AppFile = "Telegram"_cs; -constexpr auto AppVersion = 5006000; -constexpr auto AppVersionStr = "5.6"; +constexpr auto AppVersion = 5006001; +constexpr auto AppVersionStr = "5.6.1"; constexpr auto AppBetaVersion = false; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; diff --git a/Telegram/SourceFiles/dialogs/dialogs.style b/Telegram/SourceFiles/dialogs/dialogs.style index f34114397ba5b..6451e79b4a0a7 100644 --- a/Telegram/SourceFiles/dialogs/dialogs.style +++ b/Telegram/SourceFiles/dialogs/dialogs.style @@ -430,6 +430,11 @@ dialogsUpdateButton: FlatButton { } dialogsInstallUpdate: icon {{ "install_update", activeButtonFg }}; dialogsInstallUpdateOver: icon {{ "install_update", activeButtonFgOver }}; +dialogsInstallUpdateIconSkip: 7px; +dialogsInstallUpdateIconSize: 20px; +dialogsInstallUpdateIconInnerMargin: 5px; +dialogsInstallUpdateIconSide1: 5px; +dialogsInstallUpdateIconSide2: 3px; dialogsLoadMoreButton: FlatButton(dialogsUpdateButton) { color: lightButtonFg; @@ -442,6 +447,8 @@ dialogsLoadMoreButton: FlatButton(dialogsUpdateButton) { height: 36px; textTop: 9px; + font: semiboldFont; + overFont: semiboldFont; } dialogsLoadMore: icon {{ "install_update-flip_vertical", lightButtonFg }}; dialogsLoadMoreLoading: InfiniteRadialAnimation(defaultInfiniteRadialAnimation) { diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index bbff3e225db25..a87c7ef1c0f31 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -36,6 +36,7 @@ For license and copyright information please follow this link: #include "ui/controls/download_bar.h" #include "ui/controls/jump_down_button.h" #include "ui/painter.h" +#include "ui/rect.h" #include "ui/ui_utility.h" #include "lang/lang_keys.h" #include "mainwindow.h" @@ -113,6 +114,56 @@ base::options::toggle OptionForumHideChatsList({ return false; } +[[nodiscard]] QImage UpdateIcon() { + const auto iconSize = st::dialogsInstallUpdateIconSize; + auto result = QImage( + Size(iconSize) * style::DevicePixelRatio(), + QImage::Format_ARGB32_Premultiplied); + result.fill(Qt::transparent); + { + auto p = QPainter(&result); + auto hq = PainterHighQualityEnabler(p); + auto path = QPainterPath(); + + const auto fullRect = QRectF(0, 0, iconSize, iconSize); + const auto rect = fullRect + - Margins(st::dialogsInstallUpdateIconInnerMargin); + p.setPen(Qt::NoPen); + p.setBrush(Qt::white); + p.drawEllipse(fullRect); + + p.setCompositionMode(QPainter::CompositionMode_Clear); + + auto pen = QPen(Qt::black); + pen.setWidthF(style::ConvertFloatScale(2.)); + pen.setCapStyle(Qt::RoundCap); + p.setPen(pen); + + using namespace arc; + constexpr auto kShift = int(20 * 16); + p.drawArc(rect, -kShift, kQuarterLength + kShift); + p.drawArc(rect, kHalfLength - kShift, kQuarterLength + kShift); + + const auto side1 = st::dialogsInstallUpdateIconSide1; + const auto side2 = st::dialogsInstallUpdateIconSide2; + const auto top = rect.y() - side1; + const auto bottom = rect::bottom(rect) - side1; + const auto centerX = rect::center(rect).x(); + path.moveTo(centerX, bottom + side1 + side2); + path.lineTo(centerX, bottom + side1 - side2); + path.lineTo(centerX + side2, bottom + side1); + path.closeSubpath(); + + path.moveTo(centerX, top + side1 + side2); + path.lineTo(centerX, top + side1 - side2); + path.lineTo(centerX - side2, top + side1); + path.closeSubpath(); + + p.fillPath(path, Qt::black); + } + return result; +} + } // namespace const char kOptionForumHideChatsList[] = "forum-hide-chats-list"; @@ -124,7 +175,8 @@ class Widget::BottomButton : public Ui::RippleButton { const QString &text, const style::FlatButton &st, const style::icon &icon, - const style::icon &iconOver); + const style::icon &iconOver, + bool hasTextIcon); void setText(const QString &text); @@ -140,8 +192,11 @@ class Widget::BottomButton : public Ui::RippleButton { const style::FlatButton &_st; const style::icon &_icon; const style::icon &_iconOver; + const bool _hasTextIcon; std::unique_ptr _loading; + QImage _textIcon; + }; Widget::BottomButton::BottomButton( @@ -149,13 +204,23 @@ Widget::BottomButton::BottomButton( const QString &text, const style::FlatButton &st, const style::icon &icon, - const style::icon &iconOver) + const style::icon &iconOver, + bool hasTextIcon) : RippleButton(parent, st.ripple) , _text(text) , _st(st) , _icon(icon) -, _iconOver(iconOver) { +, _iconOver(iconOver) +, _hasTextIcon(hasTextIcon) { resize(st::columnMinimalWidthLeft, _st.height); + + if (_hasTextIcon) { + rpl::single(rpl::empty_value()) | rpl::then( + style::PaletteChanged() + ) | rpl::start_with_next([this] { + _textIcon = UpdateIcon(); + }, lifetime()); + } } void Widget::BottomButton::setText(const QString &text) { @@ -189,20 +254,56 @@ void Widget::BottomButton::paintEvent(QPaintEvent *e) { const auto over = isOver() && !isDisabled(); - QRect r(0, height() - _st.height, width(), _st.height); - p.fillRect(r, over ? _st.overBgColor : _st.bgColor); + auto r = QRect(0, height() - _st.height, width(), _st.height); + + if (_hasTextIcon) { + auto gradient = QLinearGradient(0, 0, width(), 0); + gradient.setStops({ + { 0., st::groupCallLive1->c }, + { 1., st::groupCallLive2->c }, + }); + p.fillRect(r, QBrush(std::move(gradient))); + if (over) { + p.fillRect( + r, + anim::with_alpha(st::universalRippleAnimation.color->c, .3)); + } - if (!isDisabled()) { - paintRipple(p, 0, 0); + if (!isDisabled()) { + paintRipple(p, 0, 0, &st::universalRippleAnimation.color->c); + } + } else { + p.fillRect(r, over ? _st.overBgColor : _st.bgColor); + if (!isDisabled()) { + paintRipple(p, 0, 0); + } } - p.setFont(over ? _st.overFont : _st.font); + const auto &font = over ? _st.overFont : _st.font; + p.setFont(font); p.setRenderHint(QPainter::TextAntialiasing); p.setPen(over ? _st.overColor : _st.color); if (width() >= st::columnMinimalWidthLeft) { r.setTop(_st.textTop); - p.drawText(r, _text, style::al_top); + if (_hasTextIcon) { + const auto &icon = _textIcon; + const auto iconSize = icon.size() / style::DevicePixelRatio(); + const auto skip = st::dialogsInstallUpdateIconSkip; + const auto textWidth = font->width(_text); + const auto rect = QRect( + (width() - (iconSize.width() + textWidth + skip)) / 2, + r.y(), + textWidth, + r.height()); + p.drawText( + rect.translated(iconSize.width() + skip, 0), + _text, + style::al_top); + p.drawImage(rect.x(), (height() - iconSize.height()) / 2, icon); + } else { + p.drawText(r, _text, style::al_top); + } } else if (isDisabled() && _loading) { _loading->draw( p, @@ -211,7 +312,15 @@ void Widget::BottomButton::paintEvent(QPaintEvent *e) { (height() - st::dialogsLoadMoreLoading.size.height()) / 2), width()); } else { - (over ? _iconOver : _icon).paintInCenter(p, r); + if (_hasTextIcon) { + const auto size = _textIcon.size() / style::DevicePixelRatio(); + p.drawImage( + (width() - size.width()) / 2, + (height() - size.height()) / 2, + _textIcon); + } else { + (over ? _iconOver : _icon).paintInCenter(p, r); + } } } @@ -1609,7 +1718,8 @@ void Widget::checkUpdateStatus() { tr::lng_update_telegram(tr::now), st::dialogsUpdateButton, st::dialogsInstallUpdate, - st::dialogsInstallUpdateOver); + st::dialogsInstallUpdateOver, + true); _updateTelegram->show(); _updateTelegram->setClickedCallback([] { Core::checkReadyUpdate(); @@ -1977,7 +2087,8 @@ void Widget::refreshLoadMoreButton(bool mayBlock, bool isBlocked) { "Load more", st::dialogsLoadMoreButton, st::dialogsLoadMore, - st::dialogsLoadMore); + st::dialogsLoadMore, + false); _loadMoreChats->show(); _loadMoreChats->addClickHandler([=] { loadMoreBlockedByDate(); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 7af292c613630..5623faaabdb07 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -6306,7 +6306,8 @@ void HistoryWidget::updateHistoryGeometry( if (!initial) { visibleAreaUpdated(); } - + } + if (needResize || initial) { if (_autocomplete) { _autocomplete->setBoundings(_scroll->geometry()); } diff --git a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp index 45b26cd352c8a..83649bf5a4b11 100644 --- a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp +++ b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp @@ -253,15 +253,20 @@ void GiftButton::paintEvent(QPaintEvent *e) { p.setFont(font); const auto text = v::match(_descriptor, [&](GiftTypePremium data) { if (data.discountPercent > 0) { - p.setBrush(st::attentionBoxButton.textFg); + p.setBrush(st::attentionButtonFg); const auto kMinus = QChar(0x2212); return kMinus + QString::number(data.discountPercent) + '%'; } return QString(); }, [&](const GiftTypeStars &data) { if (const auto count = data.limitedCount) { - p.setBrush(st::windowActiveTextFg); - return !data.userpic + const auto soldOut = !data.userpic && !data.limitedLeft; + p.setBrush(soldOut + ? st::attentionButtonFg + : st::windowActiveTextFg); + return soldOut + ? tr::lng_gift_stars_sold_out(tr::now) + : !data.userpic ? tr::lng_gift_stars_limited(tr::now) : (count == 1) ? tr::lng_gift_limited_of_one(tr::now) diff --git a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.h b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.h index 5c63e8885b017..6fd2b74138d88 100644 --- a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.h +++ b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.h @@ -48,6 +48,7 @@ struct GiftTypeStars { DocumentData *document = nullptr; PeerData *from = nullptr; int limitedCount = 0; + int limitedLeft = 0; bool userpic = false; bool hidden = false; bool mine = false; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index e3a4eda65baa1..9094159883269 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1538,7 +1538,7 @@ void MainWidget::showForum( _dialogs->showForum(forum, params); if (params.activation != anim::activation::background) { - _controller->hideLayer(); + _controller->window().hideSettingsAndLayer(); } } diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 5c8fed0f75ab2..1f3a4f02282b4 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -659,11 +659,11 @@ OverlayWidget::OverlayWidget() }); _helper->mouseEvents( ) | rpl::start_with_next([=](not_null e) { - const auto type = e->type(); - const auto position = e->pos(); - if (_helper->skipTitleHitTest(position)) { + if (_helper->skipTitleHitTest(e->windowPos().toPoint())) { return; } + const auto type = e->type(); + const auto position = e->pos(); if (type == QEvent::MouseButtonPress) { handleMousePress(position, e->button()); } else if (type == QEvent::MouseButtonRelease) { @@ -804,7 +804,7 @@ void OverlayWidget::setupWindow() { using Flag = Ui::WindowTitleHitTestFlag; Ui::WindowTitleHitTestFlags result; if (!_widget->rect().contains(widgetPoint) - || _helper->skipTitleHitTest(widgetPoint)) { + || _helper->skipTitleHitTest(_widget->mapTo(_window, widgetPoint))) { return result; } if (widgetPoint.y() <= st::mediaviewTitleButton.height) { diff --git a/Telegram/SourceFiles/payments/payments_non_panel_process.cpp b/Telegram/SourceFiles/payments/payments_non_panel_process.cpp index 3f269a5341108..baa019072edb0 100644 --- a/Telegram/SourceFiles/payments/payments_non_panel_process.cpp +++ b/Telegram/SourceFiles/payments/payments_non_panel_process.cpp @@ -93,11 +93,14 @@ void ProcessCreditsPayment( }); }, box->lifetime()); }; - Settings::MaybeRequestBalanceIncrease( - show, - form->invoice.credits, - Settings::SmallBalanceBot{ .botId = form->botId }, - done); + using namespace Settings; + const auto starGift = std::get_if(&form->id.value); + auto source = !starGift + ? SmallBalanceSource(SmallBalanceBot{ .botId = form->botId }) + : SmallBalanceSource(SmallBalanceStarGift{ + .userId = peerToUser(starGift->user->id) + }); + MaybeRequestBalanceIncrease(show, form->invoice.credits, source, done); } void ProcessCreditsReceipt( diff --git a/Telegram/SourceFiles/platform/platform_overlay_widget.cpp b/Telegram/SourceFiles/platform/platform_overlay_widget.cpp index 0bde45063c696..59e6226ae89de 100644 --- a/Telegram/SourceFiles/platform/platform_overlay_widget.cpp +++ b/Telegram/SourceFiles/platform/platform_overlay_widget.cpp @@ -218,7 +218,8 @@ void DefaultOverlayWidgetHelper::orderWidgets() { } bool DefaultOverlayWidgetHelper::skipTitleHitTest(QPoint position) { - return _controls->controls.geometry().contains(position); + using namespace Ui::Platform; + return _controls->controls.hitTest(position) != HitTestResult::None; } rpl::producer<> DefaultOverlayWidgetHelper::controlsActivations() { diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index 407f22d169fca..01ffb1aff3014 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -1555,13 +1555,17 @@ void SmallBalanceBox( const auto owner = &show->session().data(); const auto name = v::match(source, [&](SmallBalanceBot value) { - return owner->peer(peerFromUser(value.botId))->name(); + return value.botId + ? owner->peer(peerFromUser(value.botId))->name() + : QString(); }, [&](SmallBalanceReaction value) { return owner->peer(peerFromChannel(value.channelId))->name(); }, [](SmallBalanceSubscription value) { return value.name; }, [](SmallBalanceDeepLink value) { return QString(); + }, [&](SmallBalanceStarGift value) { + return owner->peer(peerFromUser(value.userId))->shortName(); }); auto needed = show->session().credits().balanceValue( @@ -1591,6 +1595,14 @@ void SmallBalanceBox( : v::is(source) ? DeepLinkBalanceAbout( v::get(source).purpose) + : v::is(source) + ? tr::lng_credits_small_balance_star_gift( + lt_user, + rpl::single(Ui::Text::Bold(name)), + Ui::Text::RichLangValue) + : name.isEmpty() + ? tr::lng_credits_small_balance_fallback( + Ui::Text::RichLangValue) : tr::lng_credits_small_balance_about( lt_bot, rpl::single(TextWithEntities{ name }), diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.h b/Telegram/SourceFiles/settings/settings_credits_graphics.h index 37b14c949ccf6..bfc266e3ebe43 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.h +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.h @@ -138,11 +138,15 @@ struct SmallBalanceSubscription { struct SmallBalanceDeepLink { QString purpose; }; +struct SmallBalanceStarGift { + UserId userId = 0; +}; struct SmallBalanceSource : std::variant< SmallBalanceBot, SmallBalanceReaction, SmallBalanceSubscription, - SmallBalanceDeepLink> { + SmallBalanceDeepLink, + SmallBalanceStarGift> { using variant::variant; }; diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index 813ccc4182699..f8ae5a6a2adf2 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -457,7 +457,7 @@ def runStages(): stage('patches', """ git clone https://github.com/desktop-app/patches.git cd patches - git checkout 7e156bfee8 + git checkout 5943c8aca4 """) stage('msys64', """ diff --git a/Telegram/build/version b/Telegram/build/version index d63b78527e8f5..2ac0de6a0729e 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,7 +1,7 @@ -AppVersion 5006000 +AppVersion 5006001 AppVersionStrMajor 5.6 -AppVersionStrSmall 5.6 -AppVersionStr 5.6.0 +AppVersionStrSmall 5.6.1 +AppVersionStr 5.6.1 BetaChannel 0 AlphaVersion 0 -AppVersionOriginal 5.6 +AppVersionOriginal 5.6.1 diff --git a/Telegram/cmake/td_scheme.cmake b/Telegram/cmake/td_scheme.cmake index 10f2c57c40428..cf241941b080c 100644 --- a/Telegram/cmake/td_scheme.cmake +++ b/Telegram/cmake/td_scheme.cmake @@ -34,13 +34,6 @@ PUBLIC desktop-app::lib_tl ) -if (WIN32 AND NOT build_win64 AND NOT build_winarm) - target_compile_options(td_scheme - PRIVATE - /bigobj # scheme.cpp has too many sections. - ) -endif() - if (CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64") # Sometimes final linking may fail with error "relocation truncated to fit" # due to large scheme size. diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 641a591450e4d..dc22cd8e41074 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 641a591450e4df9bc1c025e49b73ebc3977e6f89 +Subproject commit dc22cd8e41074e70775d48040c08978e521256c2 diff --git a/changelog.txt b/changelog.txt index 4966a3eaae02f..b7cd736d6d867 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +5.6.1 (07.10.24) + +- Fix media viewer sometimes blocking the app after launch. + 5.6 (05.10.24) - Gifts for Telegram Stars. diff --git a/cmake b/cmake index cd40741ee7e08..82ae419da9914 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit cd40741ee7e089dc79e1d0a1d396aacf2155a8da +Subproject commit 82ae419da99140aa5f0e3e4e4ae214d0e948efea