From f79d70d112aad9d223d033a4bbf58abc45be1edd Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 30 Aug 2024 18:01:49 +0400 Subject: [PATCH] Use Ui::Text::String in Ui::RoundButton. --- Telegram/SourceFiles/boxes/boxes.style | 6 +++--- .../boxes/peers/edit_peer_requests_box.cpp | 6 +++--- Telegram/SourceFiles/boxes/stickers_box.cpp | 11 ++++++----- .../SourceFiles/chat_helpers/chat_helpers.style | 8 ++++++-- .../chat_helpers/emoji_list_widget.cpp | 12 ++++++------ .../chat_helpers/stickers_list_widget.cpp | 15 +++++++++------ Telegram/SourceFiles/export/view/export.style | 8 ++++++-- .../export/view/export_view_progress.cpp | 4 ++-- .../view/history_view_paid_reaction_toast.cpp | 4 ++-- .../history/view/history_view_sticker_toast.cpp | 2 +- .../history/view/history_view_translate_bar.cpp | 2 +- .../boosts/giveaway/giveaway.style | 6 ++---- .../channel_statistics/earn/channel_earn.style | 5 ++--- Telegram/SourceFiles/info/info.style | 9 +++++---- Telegram/SourceFiles/intro/intro.style | 4 +++- Telegram/SourceFiles/media/view/media_view.style | 14 ++++++++++---- .../media/view/media_view_overlay_widget.cpp | 2 +- Telegram/SourceFiles/passport/passport.style | 4 +++- Telegram/SourceFiles/payments/ui/payments.style | 12 +++++++++--- .../SourceFiles/profile/profile_back_button.cpp | 2 +- Telegram/SourceFiles/settings/settings.style | 2 +- .../SourceFiles/settings/settings_premium.cpp | 2 +- Telegram/SourceFiles/statistics/statistics.style | 4 +++- .../ui/chat/attach/attach_bot_webview.cpp | 2 +- .../ui/controls/filter_link_header.cpp | 2 +- Telegram/SourceFiles/ui/effects/premium.style | 8 ++++---- Telegram/lib_ui | 2 +- 27 files changed, 93 insertions(+), 65 deletions(-) diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index 0a3a357cf..b977c1c60 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -787,7 +787,7 @@ backgroundConfirmPadding: margins(24px, 16px, 24px, 16px); backgroundConfirm: RoundButton(defaultActiveButton) { height: 44px; textTop: 12px; - font: font(13px semibold); + style: semiboldTextStyle; } backgroundConfirmCancel: RoundButton(backgroundConfirm) { textFg: mediaviewSaveMsgFg; @@ -799,7 +799,7 @@ backgroundConfirmCancel: RoundButton(backgroundConfirm) { height: 44px; textTop: 12px; - font: font(13px semibold); + style: semiboldTextStyle; ripple: RippleAnimation(defaultRippleAnimation) { color: shadowFg; @@ -951,7 +951,7 @@ sponsoredUrlButton: RoundButton(defaultActiveButton) { textFg: historyLinkInFg; textFgOver: historyLinkInFg; textTop: 7px; - font: normalFont; + style: defaultTextStyle; ripple: RippleAnimation(defaultRippleAnimation) { color: windowBgOver; diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp index 406c8a978..c28847bcc 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp @@ -241,8 +241,8 @@ RequestsBoxController::RowHelper::RowHelper(bool isGroup) ? tr::lng_group_requests_add(tr::now) : tr::lng_group_requests_add_channel(tr::now)) , _rejectText(tr::lng_group_requests_dismiss(tr::now)) -, _acceptTextWidth(st::requestsAcceptButton.font->width(_acceptText)) -, _rejectTextWidth(st::requestsRejectButton.font->width(_rejectText)) { +, _acceptTextWidth(st::requestsAcceptButton.style.font->width(_acceptText)) +, _rejectTextWidth(st::requestsRejectButton.style.font->width(_rejectText)) { } RequestsBoxController::RequestsBoxController( @@ -491,7 +491,7 @@ void RequestsBoxController::RowHelper::paintButton( const auto textLeft = geometry.x() + ((geometry.width() - textWidth) / 2); const auto textTop = geometry.y() + st.textTop; - p.setFont(st.font); + p.setFont(st.style.font); p.setPen(over ? st.textFgOver : st.textFg); p.drawTextLeft(textLeft, textTop, outerWidth, text); } diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index 0597a8fa2..7509b898c 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -1216,11 +1216,12 @@ StickersBox::Inner::Inner( }) , _itemsTop(st::lineWidth) , _addText(tr::lng_stickers_featured_add(tr::now)) -, _addWidth(st::stickersTrendingAdd.font->width(_addText)) +, _addWidth(st::stickersTrendingAdd.style.font->width(_addText)) , _undoText(tr::lng_stickers_return(tr::now)) -, _undoWidth(st::stickersUndoRemove.font->width(_undoText)) +, _undoWidth(st::stickersUndoRemove.style.font->width(_undoText)) , _installedText(tr::lng_stickers_featured_installed(tr::now)) -, _installedWidth(st::stickersTrendingInstalled.font->width(_installedText)) { +, _installedWidth(st::stickersTrendingInstalled.style.font->width( + _installedText)) { setup(); } @@ -1666,7 +1667,7 @@ void StickersBox::Inner::paintFakeButton(Painter &p, not_null row, int ind row->ripple.reset(); } } - p.setFont(st.font); + p.setFont(st.style.font); p.setPen(st.textFg); p.drawTextLeft(rect.x() - (st.width / 2), rect.y() + st.textTop, width(), text, textWidth); } else { @@ -1700,7 +1701,7 @@ void StickersBox::Inner::paintFakeButton(Painter &p, not_null row, int ind row->ripple.reset(); } } - p.setFont(st.font); + p.setFont(st.style.font); p.setPen(selected ? st.textFgOver : st.textFg); p.drawTextLeft(rect.x() - (st.width / 2), rect.y() + st.textTop, width(), text, textWidth); } diff --git a/Telegram/SourceFiles/chat_helpers/chat_helpers.style b/Telegram/SourceFiles/chat_helpers/chat_helpers.style index 63cf5048a..42be4499d 100644 --- a/Telegram/SourceFiles/chat_helpers/chat_helpers.style +++ b/Telegram/SourceFiles/chat_helpers/chat_helpers.style @@ -296,7 +296,9 @@ emojiPanButton: RoundButton(defaultActiveButton) { textTop: 2px; } emojiPanExpand: RoundButton(defaultActiveButton) { - font: font(12px bold); + style: TextStyle(semiboldTextStyle) { + font: font(12px bold); + } width: -8px; height: 19px; textTop: 1px; @@ -1499,5 +1501,7 @@ pickLocationChooseOnMap: RoundButton(defaultActiveButton) { height: 44px; textTop: 11px; width: -96px; - font: font(15px semibold); + style: TextStyle(semiboldTextStyle) { + font: font(15px semibold); + } } diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index c91ccf1d1..7ea95f736 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -1450,17 +1450,17 @@ void EmojiListWidget::drawCollapsedBadge( int count) { const auto &st = st::emojiPanExpand; const auto text = u"+%1"_q.arg(count - _columnCount * kCollapsedRows + 1); - const auto textWidth = st.font->width(text); + const auto textWidth = st.style.font->width(text); const auto buttonw = std::max(textWidth - st.width, st.height); const auto buttonh = st.height; const auto buttonx = position.x() + (_singleSize.width() - buttonw) / 2; const auto buttony = position.y() + (_singleSize.height() - buttonh) / 2; _collapsedBg.paint(p, QRect(buttonx, buttony, buttonw, buttonh)); p.setPen(this->st().bg); - p.setFont(st.font); + p.setFont(st.style.font); p.drawText( buttonx + (buttonw - textWidth) / 2, - (buttony + st.textTop + st.font->ascent), + (buttony + st.textTop + st.style.font->ascent), text); } @@ -2546,12 +2546,12 @@ int EmojiListWidget::paintButtonGetWidth( : selected ? st::emojiPanButton.textFgOver : st::emojiPanButton.textFg); - p.setFont(st::emojiPanButton.font); + p.setFont(st::emojiPanButton.style.font); p.drawText( rect.x() - (st::emojiPanButton.width / 2), (rect.y() + st::emojiPanButton.textTop - + st::emojiPanButton.font->ascent), + + st::emojiPanButton.style.font->ascent), button.text); return emojiRight() - rect.x(); } @@ -2678,7 +2678,7 @@ void EmojiListWidget::initButton( const QString &text, bool gradient) { button.text = text; - button.textWidth = st::emojiPanButton.font->width(text); + button.textWidth = st::emojiPanButton.style.font->width(text); const auto width = button.textWidth - st::emojiPanButton.width; const auto height = st::emojiPanButton.height; const auto factor = style::DevicePixelRatio(); diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index e1e40cc62..c3af5e262 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -213,11 +213,14 @@ StickersListWidget::StickersListWidget( st().pathBg, st().pathFg, [=] { update(); })) -, _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st().headerLeft) +, _megagroupSetAbout(st::columnMinimalWidthThird + - st::emojiScroll.width + - st().headerLeft) , _addText(tr::lng_stickers_featured_add(tr::now)) -, _addWidth(st::stickersTrendingAdd.font->width(_addText)) +, _addWidth(st::stickersTrendingAdd.style.font->width(_addText)) , _installedText(tr::lng_stickers_featured_installed(tr::now)) -, _installedWidth(st::stickersTrendingInstalled.font->width(_installedText)) +, _installedWidth( + st::stickersTrendingInstalled.style.font->width(_installedText)) , _settings(this, tr::lng_stickers_you_have(tr::now)) , _previewTimer([=] { showPreview(); }) , _premiumMark(std::make_unique( @@ -974,7 +977,7 @@ void StickersListWidget::paintStickers(Painter &p, QRect clip) { const auto &st = installedSet ? st::stickersTrendingInstalled : st::stickersTrendingAdd; - p.setFont(st.font); + p.setFont(st.style.font); p.setPen(selected ? st.textFgOver : st.textFg); p.drawTextLeft( add.x() - (st.width / 2), @@ -1238,7 +1241,7 @@ void StickersListWidget::paintMegagroupEmptySet(Painter &p, int y, bool buttonSe _megagroupSetButtonRipple.reset(); } } - p.setFont(st::stickerGroupCategoryAdd.font); + p.setFont(st::stickerGroupCategoryAdd.style.font); p.setPen(buttonSelected ? st::stickerGroupCategoryAdd.textFgOver : st::stickerGroupCategoryAdd.textFg); p.drawTextLeft(button.x() - (st::stickerGroupCategoryAdd.width / 2), button.y() + st::stickerGroupCategoryAdd.textTop, width(), _megagroupSetButtonText, _megagroupSetButtonTextWidth); } @@ -2734,7 +2737,7 @@ void StickersListWidget::refreshMegagroupSetGeometry() { auto left = megagroupSetInfoLeft(); auto availableWidth = (width() - left); auto top = _megagroupSetAbout.countHeight(availableWidth) + st::stickerGroupCategoryAddMargin.top(); - _megagroupSetButtonTextWidth = st::stickerGroupCategoryAdd.font->width(_megagroupSetButtonText); + _megagroupSetButtonTextWidth = st::stickerGroupCategoryAdd.style.font->width(_megagroupSetButtonText); auto buttonWidth = _megagroupSetButtonTextWidth - st::stickerGroupCategoryAdd.width; _megagroupSetButtonRect = QRect(left, top, buttonWidth, st::stickerGroupCategoryAdd.height); } diff --git a/Telegram/SourceFiles/export/view/export.style b/Telegram/SourceFiles/export/view/export.style index d72530823..29092edb5 100644 --- a/Telegram/SourceFiles/export/view/export.style +++ b/Telegram/SourceFiles/export/view/export.style @@ -70,14 +70,18 @@ exportCancelButton: RoundButton(attentionBoxButton) { width: 200px; height: 44px; textTop: 12px; - font: font(semibold 15px); + style: TextStyle(semiboldTextStyle) { + font: font(semibold 15px); + } } exportCancelBottom: 30px; exportDoneButton: RoundButton(defaultActiveButton) { width: 200px; height: 44px; textTop: 12px; - font: font(semibold 15px); + style: TextStyle(semiboldTextStyle) { + font: font(semibold 15px); + } } exportAboutLabel: FlatLabel(boxLabel) { diff --git a/Telegram/SourceFiles/export/view/export_view_progress.cpp b/Telegram/SourceFiles/export/view/export_view_progress.cpp index 5b946428b..dabda8280 100644 --- a/Telegram/SourceFiles/export/view/export_view_progress.cpp +++ b/Telegram/SourceFiles/export/view/export_view_progress.cpp @@ -362,9 +362,9 @@ void ProgressWidget::showDone() { tr::lng_export_done(), st::exportDoneButton); const auto desired = std::min( - st::exportDoneButton.font->width(tr::lng_export_done(tr::now)) + st::exportDoneButton.style.font->width(tr::lng_export_done(tr::now)) + st::exportDoneButton.height - - st::exportDoneButton.font->height, + - st::exportDoneButton.style.font->height, st::exportPanelSize.width() - 2 * st::exportCancelBottom); if (_done->width() < desired) { _done->setFullWidth(desired); diff --git a/Telegram/SourceFiles/history/view/history_view_paid_reaction_toast.cpp b/Telegram/SourceFiles/history/view/history_view_paid_reaction_toast.cpp index ef279d68f..566b1f72d 100644 --- a/Telegram/SourceFiles/history/view/history_view_paid_reaction_toast.cpp +++ b/Telegram/SourceFiles/history/view/history_view_paid_reaction_toast.cpp @@ -91,7 +91,7 @@ constexpr auto kPremiumToastDuration = 5 * crl::time(1000); result->paintRequest() | rpl::start_with_next([=] { auto p = QPainter(result); - const auto font = st::historyPremiumViewSet.font; + const auto font = st::historyPremiumViewSet.style.font; const auto top = (result->height() - font->height) / 2; auto pen = st::historyPremiumViewSet.textFg->p; p.setPen(pen); @@ -229,7 +229,7 @@ void PaidReactionToast::showFor( child->show(); const auto leftSkip = skip + size + skip - st.padding.left(); - const auto undoFont = st::historyPremiumViewSet.font; + const auto undoFont = st::historyPremiumViewSet.style.font; const auto rightSkip = undoFont->width(undoText) + st::toastUndoSpace diff --git a/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp b/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp index bf8dc8e3a..b35239841 100644 --- a/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp +++ b/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp @@ -154,7 +154,7 @@ void StickerToast::showWithTitle(const QString &title) { ? tr::lng_animated_emoji_saved_open(tr::now) : tr::lng_sticker_premium_view(tr::now); _st.padding.setLeft(skip + size + skip); - _st.padding.setRight(st::historyPremiumViewSet.font->width(view) + _st.padding.setRight(st::historyPremiumViewSet.style.font->width(view) - st::historyPremiumViewSet.width); clearHiddenHiding(); diff --git a/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp b/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp index bf3268ba3..88db9ee2d 100644 --- a/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp @@ -518,7 +518,7 @@ void TranslateBar::showToast( const QString &buttonText, Fn buttonCallback) { const auto st = std::make_shared(st::historyPremiumToast); - st->padding.setRight(st::historyPremiumViewSet.font->width(buttonText) + st->padding.setRight(st::historyPremiumViewSet.style.font->width(buttonText) - st::historyPremiumViewSet.width); const auto weak = Ui::Toast::Show(_wrap.window(), Ui::Toast::Config{ diff --git a/Telegram/SourceFiles/info/channel_statistics/boosts/giveaway/giveaway.style b/Telegram/SourceFiles/info/channel_statistics/boosts/giveaway/giveaway.style index 2715dfe95..8a0043b20 100644 --- a/Telegram/SourceFiles/info/channel_statistics/boosts/giveaway/giveaway.style +++ b/Telegram/SourceFiles/info/channel_statistics/boosts/giveaway/giveaway.style @@ -60,9 +60,7 @@ giveawayGiftCodeQuantitySubtitle: FlatLabel(defaultFlatLabel) { align: align(right); } giveawayGiftCodeQuantityFloat: FlatLabel(defaultFlatLabel) { - style: TextStyle(semiboldTextStyle) { - font: font(13px); - } + style: semiboldTextStyle; textFg: windowActiveTextFg; minWidth: 50px; align: align(center); @@ -164,7 +162,7 @@ giveawayGiftCodeBox: Box(defaultBox) { button: RoundButton(defaultActiveButton) { height: 42px; textTop: 12px; - font: font(13px semibold); + style: semiboldTextStyle; } shadowIgnoreTopSkip: true; } diff --git a/Telegram/SourceFiles/info/channel_statistics/earn/channel_earn.style b/Telegram/SourceFiles/info/channel_statistics/earn/channel_earn.style index ab88fa2ba..15df2c282 100644 --- a/Telegram/SourceFiles/info/channel_statistics/earn/channel_earn.style +++ b/Telegram/SourceFiles/info/channel_statistics/earn/channel_earn.style @@ -32,8 +32,7 @@ channelEarnOverviewSubMinorLabel: FlatLabel(channelEarnOverviewMinorLabel) { } channelEarnOverviewSubMinorLabelPos: point(4px, 2px); channelEarnSemiboldLabel: FlatLabel(channelEarnOverviewMajorLabel) { - style: TextStyle(semiboldTextStyle) { - } + style: semiboldTextStyle; } channelEarnHeaderLabel: FlatLabel(channelEarnOverviewMajorLabel) { style: TextStyle(statisticsHeaderTitleTextStyle) { @@ -91,7 +90,7 @@ channelEarnHistoryRecipientButton: RoundButton { iconPosition: point(0px, 0px); - font: semiboldFont; + style: semiboldTextStyle; ripple: RippleAnimation(defaultRippleAnimation) { color: windowBgRipple; diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index bf1920738..2978d66c4 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -368,7 +368,9 @@ infoProfileCover: InfoProfileCover { width: -12px; height: 18px; textTop: 0px; - font: font(12px); + style: TextStyle(defaultTextStyle) { + font: font(12px); + } ripple: defaultRippleAnimation; } showLastSeenPosition: point(3px, 58px); @@ -607,8 +609,7 @@ infoMembersCancelSearch: CrossButton { } infoMembersSearchTop: 15px; -infoMediaHeaderStyle: TextStyle(semiboldTextStyle) { -} +infoMediaHeaderStyle: semiboldTextStyle; infoMediaHeaderHeight: 28px; infoMediaHeaderPosition: point(14px, 6px); infoMediaSkip: 2px; @@ -1100,7 +1101,7 @@ similarChannelsLockFade: 58px; similarChannelsLock: RoundButton(defaultActiveButton) { height: 44px; textTop: 12px; - font: font(13px semibold); + style: semiboldTextStyle; } similarChannelsLockLabel: FlatLabel(defaultFlatLabel) { textFg: premiumButtonFg; diff --git a/Telegram/SourceFiles/intro/intro.style b/Telegram/SourceFiles/intro/intro.style index ae504be09..a6b8a7a4c 100644 --- a/Telegram/SourceFiles/intro/intro.style +++ b/Telegram/SourceFiles/intro/intro.style @@ -81,7 +81,9 @@ introNextButton: RoundButton(defaultActiveButton) { height: 42px; radius: 6px; textTop: 11px; - font: font(boxFontSize semibold); + style: TextStyle(semiboldTextStyle) { + font: font(boxFontSize semibold); + } } introFragmentIcon: icon{{ "fragment", activeButtonFg }}; introFragmentIconOver: icon{{ "fragment", activeButtonFgOver }}; diff --git a/Telegram/SourceFiles/media/view/media_view.style b/Telegram/SourceFiles/media/view/media_view.style index b01baa4f2..d7569cb22 100644 --- a/Telegram/SourceFiles/media/view/media_view.style +++ b/Telegram/SourceFiles/media/view/media_view.style @@ -371,11 +371,15 @@ themePreviewLoadingFont: font(16px); themePreviewLoadingFg: windowSubTextFg; themePreviewApplyButton: RoundButton(defaultActiveButton) { height: 38px; - font: font(15px semibold); + style: TextStyle(semiboldTextStyle) { + font: font(15px semibold); + } } themePreviewCancelButton: RoundButton(defaultLightButton) { height: 38px; - font: font(15px semibold); + style: TextStyle(semiboldTextStyle) { + font: font(15px semibold); + } } themePreviewButtonsSkip: 20px; themePreviewDialogsWidth: 312px; @@ -796,7 +800,9 @@ storiesComposeControls: ComposeControls(defaultComposeControls) { width: -12px; height: 18px; textTop: 0px; - font: font(12px); + style: TextStyle(defaultTextStyle) { + font: font(12px); + } ripple: storiesComposeRipple; } buttonSkip: 6px; @@ -959,7 +965,7 @@ storiesStealthBox: Box(defaultBox) { button: RoundButton(defaultBoxButton) { height: 42px; textTop: 12px; - font: font(13px semibold); + style: semiboldTextStyle; textFg: storiesComposeWhiteText; textFgOver: storiesComposeWhiteText; diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 6c3aadc5e..6baa8638a 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -4917,7 +4917,7 @@ void OverlayWidget::paintThemePreviewContent( + (_themeShare->y() - _themePreviewRect.y()) + st::themePreviewCancelButton.padding.top() + st::themePreviewCancelButton.textTop - + st::themePreviewCancelButton.font->ascent; + + st::themePreviewCancelButton.style.font->ascent; p.drawText( left, baseline, diff --git a/Telegram/SourceFiles/passport/passport.style b/Telegram/SourceFiles/passport/passport.style index c5bf74443..f3a498575 100644 --- a/Telegram/SourceFiles/passport/passport.style +++ b/Telegram/SourceFiles/passport/passport.style @@ -49,7 +49,9 @@ passportPasswordSubmit: RoundButton(defaultActiveButton) { width: 200px; height: 44px; textTop: 12px; - font: font(semibold 15px); + style: TextStyle(semiboldTextStyle) { + font: font(semibold 15px); + } } passportPasswordSubmitBottom: 72px; passportPasswordForgotBottom: 36px; diff --git a/Telegram/SourceFiles/payments/ui/payments.style b/Telegram/SourceFiles/payments/ui/payments.style index df4799309..86138bc7a 100644 --- a/Telegram/SourceFiles/payments/ui/payments.style +++ b/Telegram/SourceFiles/payments/ui/payments.style @@ -14,12 +14,16 @@ paymentsPanelSize: size(392px, 600px); paymentsPanelButton: RoundButton(defaultBoxButton) { width: -36px; height: 36px; - font: boxButtonFont; + style: TextStyle(defaultTextStyle) { + font: boxButtonFont; + } } paymentsPanelSubmit: RoundButton(defaultActiveButton) { width: -36px; height: 36px; - font: boxButtonFont; + style: TextStyle(defaultTextStyle) { + font: boxButtonFont; + } } paymentsPanelPadding: margins(8px, 12px, 15px, 12px); @@ -139,6 +143,8 @@ paymentsLoading: InfiniteRadialAnimation(defaultInfiniteRadialAnimation) { botWebViewPanelSize: size(384px, 694px); botWebViewBottomButton: RoundButton(paymentsPanelSubmit) { height: 56px; - font: boxButtonFont; + style: TextStyle(defaultTextStyle) { + font: boxButtonFont; + } textTop: 19px; } diff --git a/Telegram/SourceFiles/profile/profile_back_button.cpp b/Telegram/SourceFiles/profile/profile_back_button.cpp index 939859a1e..15b2f2858 100644 --- a/Telegram/SourceFiles/profile/profile_back_button.cpp +++ b/Telegram/SourceFiles/profile/profile_back_button.cpp @@ -61,7 +61,7 @@ void BackButton::paintEvent(QPaintEvent *e) { p.fillRect(e->rect(), st::profileBg); st::topBarBack.paint(p, (st::topBarArrowPadding.left() - st::topBarBack.width()) / 2, (st::topBarHeight - st::topBarBack.height()) / 2, width()); - p.setFont(st::topBarButton.font); + p.setFont(st::topBarButton.style.font); p.setPen(st::topBarButton.textFg); p.drawTextLeft(st::topBarArrowPadding.left(), st::topBarButton.padding.top() + st::topBarButton.textTop, width(), _text); } diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index 6ffd1842a..df59546a6 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -531,7 +531,7 @@ filterInviteBox: Box(defaultBox) { button: RoundButton(defaultActiveButton) { height: 42px; textTop: 12px; - font: font(13px semibold); + style: semiboldTextStyle; } } filterInviteButtonStyle: TextStyle(defaultTextStyle) { diff --git a/Telegram/SourceFiles/settings/settings_premium.cpp b/Telegram/SourceFiles/settings/settings_premium.cpp index 579683fd2..6c239c49e 100644 --- a/Telegram/SourceFiles/settings/settings_premium.cpp +++ b/Telegram/SourceFiles/settings/settings_premium.cpp @@ -1429,7 +1429,7 @@ not_null CreateLockedButton( const auto labelSt = result->lifetime().make_state( st::defaultFlatLabel); - labelSt->style.font = st.font; + labelSt->style.font = st.style.font; labelSt->textFg = st.textFg; const auto label = Ui::CreateChild( diff --git a/Telegram/SourceFiles/statistics/statistics.style b/Telegram/SourceFiles/statistics/statistics.style index 3ba67a2c8..3dd6a3f93 100644 --- a/Telegram/SourceFiles/statistics/statistics.style +++ b/Telegram/SourceFiles/statistics/statistics.style @@ -68,7 +68,9 @@ statisticsHeaderButton: RoundButton(defaultLightButton) { width: -14px; height: 20px; textTop: 2px; - font: font(11px semibold); + style: TextStyle(semiboldTextStyle) { + font: font(11px semibold); + } } statisticsLoadingSubtext: FlatLabel(changePhoneDescription) { diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp index da161ff06..9ff122833 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp @@ -276,7 +276,7 @@ void Panel::Button::paintEvent(QPaintEvent *e) { paintRipple(p, rect().topLeft(), &ripple); } - p.setFont(_st.font); + p.setFont(_st.style.font); const auto height = rect().height(); const auto progress = st::paymentsLoading.size; diff --git a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp index 475d04ca5..099720ae1 100644 --- a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp +++ b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp @@ -396,7 +396,7 @@ object_ptr FilterLinkProcessButton( const auto label = result->lifetime().make_state