From 06cb1ece50a4b86e8447b11951e6de44bc004ce0 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 5 Dec 2025 18:41:50 +0400 Subject: [PATCH] Various improvements --- .../Telegram-iOS/en.lproj/Localizable.strings | 2 +- .../LegacyComponents/Sources/TGViewController.mm | 6 +++++- .../Sources/DefaultDarkPresentationTheme.swift | 4 ++-- .../DefaultDarkTintedPresentationTheme.swift | 4 ++-- .../GiftDemoScreen/Sources/GiftDemoScreen.swift | 2 +- .../Sources/GiftUpgradePreviewScreen.swift | 16 ++++++++++++---- .../Sources/SegmentControlComponent.swift | 2 +- .../Sources/StarsWithdrawalScreen.swift | 4 +++- 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 1ffc2483da..597ef1ad02 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -15614,7 +15614,7 @@ Error: %8$@"; "Notification.StarGiftOffer.Expiration.Hours_any" = "%@ h"; "Notification.StarGiftOffer.Expiration.Minutes_1" = "%@ m"; "Notification.StarGiftOffer.Expiration.Minutes_any" = "%@ m"; -"Notification.StarGiftOffer.Expiration.Delimiter" = ""; +"Notification.StarGiftOffer.Expiration.Delimiter" = " "; "Chat.GiftPurchaseOffer.AcceptConfirmation.Title" = "Confirm Sale"; "Chat.GiftPurchaseOffer.AcceptConfirmation.Text" = "Do you want to sell **%1$@** to %2$@ for **%3$@**? You'll receive **%4$@** after fees."; diff --git a/submodules/LegacyComponents/Sources/TGViewController.mm b/submodules/LegacyComponents/Sources/TGViewController.mm index ba4d35769a..cab3b420f0 100644 --- a/submodules/LegacyComponents/Sources/TGViewController.mm +++ b/submodules/LegacyComponents/Sources/TGViewController.mm @@ -1135,7 +1135,11 @@ static id _defaultContext = nil; return UIEdgeInsetsMake(0.0f, 44.0f, 21.0f, 44.0f); default: - return UIEdgeInsetsMake(44.0f, 0.0f, 34.0f, 0.0f); + if (iosMajorVersion() >= 26) { + return UIEdgeInsetsMake(44.0f, 0.0f, 20.0f, 0.0f); + } else { + return UIEdgeInsetsMake(44.0f, 0.0f, 34.0f, 0.0f); + } } } diff --git a/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift index 8c8e7f93b4..82018273d0 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift @@ -348,8 +348,8 @@ public func makeDefaultDarkPresentationTheme(extendingThemeReference: Presentati badgeBackgroundColor: UIColor(rgb: 0xffffff), badgeStrokeColor: UIColor(rgb: 0x1c1c1d), badgeTextColor: UIColor(rgb: 0x000000), - segmentedBackgroundColor: UIColor(rgb: 0x3a3b3d), - segmentedForegroundColor: UIColor(rgb: 0x6f7075), + segmentedBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.11), + segmentedForegroundColor: UIColor(rgb: 0xffffff, alpha: 0.36), segmentedTextColor: UIColor(rgb: 0xffffff), segmentedDividerColor: UIColor(rgb: 0x505155), clearButtonBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.1), diff --git a/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift index c3f7ff89ed..86c3dad638 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift @@ -139,7 +139,7 @@ public func customizeDefaultDarkTintedPresentationTheme(theme: PresentationTheme opaqueBackgroundColor: mainBackgroundColor, separatorColor: mainSeparatorColor, segmentedBackgroundColor: mainInputColor, - segmentedForegroundColor: mainBackgroundColor, + segmentedForegroundColor: mainSecondaryTextColor?.withAlphaComponent(0.4), segmentedDividerColor: mainSecondaryTextColor?.withAlphaComponent(0.5) ), navigationSearchBar: rootController.navigationSearchBar.withUpdated( @@ -571,7 +571,7 @@ public func makeDefaultDarkTintedPresentationTheme(extendingThemeReference: Pres badgeStrokeColor: UIColor(rgb: 0xef5b5b), badgeTextColor: UIColor(rgb: 0xffffff), segmentedBackgroundColor: mainInputColor, - segmentedForegroundColor: mainBackgroundColor, + segmentedForegroundColor: mainSecondaryTextColor.withAlphaComponent(0.4), segmentedTextColor: UIColor(rgb: 0xffffff), segmentedDividerColor: mainSecondaryTextColor.withAlphaComponent(0.5), clearButtonBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.1), diff --git a/submodules/TelegramUI/Components/Gifts/GiftDemoScreen/Sources/GiftDemoScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftDemoScreen/Sources/GiftDemoScreen.swift index a026d104eb..bdb59ec94f 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftDemoScreen/Sources/GiftDemoScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftDemoScreen/Sources/GiftDemoScreen.swift @@ -293,7 +293,7 @@ private final class DemoSheetContent: CombinedComponent { let bottomEdgeEffectHeight = 108.0 let bottomEdgeEffect = bottomEdgeEffect.update( component: EdgeEffectComponent( - color: .clear, + color: environment.theme.actionSheet.opaqueItemBackgroundColor, blur: true, alpha: 1.0, size: CGSize(width: context.availableSize.width, height: bottomEdgeEffectHeight), diff --git a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftUpgradePreviewScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftUpgradePreviewScreen.swift index 89a13a0c49..a5dac0f006 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftUpgradePreviewScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftUpgradePreviewScreen.swift @@ -732,15 +732,23 @@ private final class GiftUpgradePreviewScreenComponent: Component { transition.setFrame(view: titleView, frame: titleFrame) } + var subtitleItems: [AnimatedTextComponent.Item] = [] + let subtitleString = self.isPlaying ? environment.strings.Gift_Variants_RandomTraits : environment.strings.Gift_Variants_SelectedTraits + let words = subtitleString.components(separatedBy: " ") + for i in 0 ..< words.count { + var text = words[i] + if i > 0 { + text = " \(text)" + } + subtitleItems.append(AnimatedTextComponent.Item(id: text.lowercased(), content: .text(text))) + } + let subtitleSize = self.subtitle.update( transition: .spring(duration: 0.2), component: AnyComponent(AnimatedTextComponent( font: Font.regular(14.0), color: secondaryTextColor, - items: [ - AnimatedTextComponent.Item(id: self.isPlaying ? "random" : "selected", content: .text(self.isPlaying ? "Random" : "Selected")), - AnimatedTextComponent.Item(id: "traits", content: .text(" Traits")) - ], + items: subtitleItems, noDelay: true, blur: true )), diff --git a/submodules/TelegramUI/Components/SegmentControlComponent/Sources/SegmentControlComponent.swift b/submodules/TelegramUI/Components/SegmentControlComponent/Sources/SegmentControlComponent.swift index 69d6cb6853..012de5aafb 100644 --- a/submodules/TelegramUI/Components/SegmentControlComponent/Sources/SegmentControlComponent.swift +++ b/submodules/TelegramUI/Components/SegmentControlComponent/Sources/SegmentControlComponent.swift @@ -127,7 +127,7 @@ public final class SegmentControlComponent: Component { } if themeUpdated { - let backgroundColor = component.theme.overallDarkAppearance ? component.theme.list.itemBlocksBackgroundColor : component.theme.rootController.navigationBar.segmentedBackgroundColor + let backgroundColor = component.theme.rootController.navigationBar.segmentedBackgroundColor segmentedView.setTitleTextAttributes([ .font: Font.semibold(14.0), .foregroundColor: component.theme.rootController.navigationBar.segmentedTextColor diff --git a/submodules/TelegramUI/Components/Stars/StarsWithdrawalScreen/Sources/StarsWithdrawalScreen.swift b/submodules/TelegramUI/Components/Stars/StarsWithdrawalScreen/Sources/StarsWithdrawalScreen.swift index 80cc633365..17df881092 100644 --- a/submodules/TelegramUI/Components/Stars/StarsWithdrawalScreen/Sources/StarsWithdrawalScreen.swift +++ b/submodules/TelegramUI/Components/Stars/StarsWithdrawalScreen/Sources/StarsWithdrawalScreen.swift @@ -213,11 +213,13 @@ private final class SheetContent: CombinedComponent { case .stars: amountTitle = environment.strings.Gift_Offer_PriceSectionStars minAmount = StarsAmount(value: gift.minOfferStars ?? resaleConfiguration.starGiftResaleMinStarsAmount, nanos: 0) + maxAmount = StarsAmount(value: resaleConfiguration.starGiftResaleMaxStarsAmount, nanos: 0) case .ton: amountTitle = environment.strings.Gift_Offer_PriceSectionTon minAmount = StarsAmount(value: resaleConfiguration.starGiftResaleMinTonAmount, nanos: 0) + maxAmount = StarsAmount(value: resaleConfiguration.starGiftResaleMaxTonAmount, nanos: 0) } - maxAmount = nil + amountPlaceholder = environment.strings.Gift_Offer_PricePlaceholder if let usdWithdrawRate = withdrawConfiguration.usdWithdrawRate, let tonUsdRate = withdrawConfiguration.tonUsdRate, let amount = state.amount, amount > StarsAmount.zero {