Various improvements

This commit is contained in:
Ilya Laktyushin 2025-12-05 18:41:50 +04:00
parent 6db5077642
commit 06cb1ece50
8 changed files with 27 additions and 13 deletions

View file

@ -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.";

View file

@ -1135,7 +1135,11 @@ static id<LegacyComponentsContext> _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);
}
}
}

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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
)),

View file

@ -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

View file

@ -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 {