Various improvements

This commit is contained in:
Ilya Laktyushin 2025-11-13 08:27:11 +04:00
parent 9527b2d8be
commit 3886b847ae
10 changed files with 69 additions and 13 deletions

View File

@ -15354,3 +15354,16 @@ Error: %8$@";
"ScheduleMessage.PremiumRequired.Title" = "Premium Required"; "ScheduleMessage.PremiumRequired.Title" = "Premium Required";
"ScheduleMessage.PremiumRequired.Text" = "Subscribe to **Telegram Premium** to schedule repeating messages."; "ScheduleMessage.PremiumRequired.Text" = "Subscribe to **Telegram Premium** to schedule repeating messages.";
"ScheduleMessage.PremiumRequired.Add" = "Add"; "ScheduleMessage.PremiumRequired.Add" = "Add";
"Stars.Transaction.GiftAuctionBid" = "Gift Auction Bid";
"Stars.Intro.Transaction.GiftAuctionBid" = "Gift Auction Bid";
"Stars.Intro.Transaction.LiveStreamReaction" = "Live Stream Reaction";
"Stars.Transaction.LiveStreamReaction" = "Live Stream Reaction";
"Stars.Transaction.LiveStreamReaction.Text" = "You receive **%@%** of the amount of each reaction.";
"Stars.Intro.Transaction.LiveStreamPaidMessage_1" = "Fee for %@ Live Stream Message";
"Stars.Intro.Transaction.LiveStreamPaidMessage_any" = "Fee for %@ Live Stream Messages";
"Stars.Transaction.LiveStreamPaidMessage_1" = "Fee for %@ Live Stream Message";
"Stars.Transaction.LiveStreamPaidMessage_any" = "Fee for %@ Live Stream Messages";
"Stars.Transaction.LiveStreamPaidMessage.Text" = "You receive **%@%** of the price that you charge for each incoming message.";

View File

@ -890,7 +890,7 @@ private class ChatQrCodeScreenNode: ViewControllerTracingNode, ASScrollViewDeleg
self.animationNode = AnimationNode(animation: self.isDarkAppearance ? "anim_sun_reverse" : "anim_sun", colors: iconColors(theme: self.presentationData.theme), scale: 1.0) self.animationNode = AnimationNode(animation: self.isDarkAppearance ? "anim_sun_reverse" : "anim_sun", colors: iconColors(theme: self.presentationData.theme), scale: 1.0)
self.animationNode.isUserInteractionEnabled = false self.animationNode.isUserInteractionEnabled = false
self.doneButton = SolidRoundedButtonNode(theme: SolidRoundedButtonTheme(theme: self.presentationData.theme), height: 52.0, cornerRadius: 11.0) self.doneButton = SolidRoundedButtonNode(theme: SolidRoundedButtonTheme(theme: self.presentationData.theme), glass: true, height: 52.0, cornerRadius: 26.0)
switch controller.subject { switch controller.subject {
case .peer: case .peer:
self.doneButton.title = self.presentationData.strings.InviteLink_QRCode_Share self.doneButton.title = self.presentationData.strings.InviteLink_QRCode_Share

View File

@ -57,9 +57,9 @@ public final class ListSwitchItemComponent: Component {
self.state = state self.state = state
self.backgroundColor = component.theme.list.itemBlocksBackgroundColor self.backgroundColor = component.theme.list.itemBlocksBackgroundColor
self.layer.cornerRadius = 12.0 self.layer.cornerRadius = 26.0
let size = CGSize(width: availableSize.width, height: 44.0) let size = CGSize(width: availableSize.width, height: 52.0)
let rightInset: CGFloat = 16.0 let rightInset: CGFloat = 16.0
let leftInset: CGFloat = 16.0 let leftInset: CGFloat = 16.0
let spacing: CGFloat = 8.0 let spacing: CGFloat = 8.0

View File

@ -174,7 +174,7 @@ final class EmojiListInputComponent: Component {
let minSideInset: CGFloat = 12.0 let minSideInset: CGFloat = 12.0
self.backgroundColor = component.theme.list.itemBlocksBackgroundColor self.backgroundColor = component.theme.list.itemBlocksBackgroundColor
self.layer.cornerRadius = 12.0 self.layer.cornerRadius = 26.0
let maxItemsWidth = availableSize.width - minSideInset * 2.0 let maxItemsWidth = availableSize.width - minSideInset * 2.0
let itemsPerRow = Int(floor((maxItemsWidth + minItemSize * itemSpacingFactor) / (minItemSize + minItemSize * itemSpacingFactor))) let itemsPerRow = Int(floor((maxItemsWidth + minItemSize * itemSpacingFactor) / (minItemSize + minItemSize * itemSpacingFactor)))

View File

@ -1259,6 +1259,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
transition: transition, transition: transition,
component: AnyComponent(ListSectionComponent( component: AnyComponent(ListSectionComponent(
theme: environment.theme, theme: environment.theme,
style: .glass,
header: AnyComponent(MultilineTextComponent( header: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: environment.strings.PeerInfo_AllowedReactions_MaxCountSectionTitle, string: environment.strings.PeerInfo_AllowedReactions_MaxCountSectionTitle,
@ -1350,6 +1351,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
transition: transition, transition: transition,
component: AnyComponent(ListSectionComponent( component: AnyComponent(ListSectionComponent(
theme: environment.theme, theme: environment.theme,
style: .glass,
header: nil, header: nil,
footer: AnyComponent(MultilineTextComponent( footer: AnyComponent(MultilineTextComponent(
text: .plain(paidReactionsFooterText), text: .plain(paidReactionsFooterText),
@ -1534,10 +1536,12 @@ final class PeerAllowedReactionsScreenComponent: Component {
)))) ))))
} }
let buttonInsets = ContainerViewLayout.concentricInsets(bottomInset: environment.safeInsets.bottom, innerDiameter: 52.0, sideInset: 30.0)
let buttonSize = self.actionButton.update( let buttonSize = self.actionButton.update(
transition: transition, transition: transition,
component: AnyComponent(ButtonComponent( component: AnyComponent(ButtonComponent(
background: ButtonComponent.Background( background: ButtonComponent.Background(
style: .glass,
color: environment.theme.list.itemCheckColors.fillColor, color: environment.theme.list.itemCheckColors.fillColor,
foreground: environment.theme.list.itemCheckColors.foregroundColor, foreground: environment.theme.list.itemCheckColors.foregroundColor,
pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.8) pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.8)
@ -1556,7 +1560,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
} }
)), )),
environment: {}, environment: {},
containerSize: CGSize(width: availableSize.width - sideInset * 2.0, height: 50.0) containerSize: CGSize(width: availableSize.width - buttonInsets.left - buttonInsets.right, height: 52.0)
) )
contentHeight += buttonSize.height contentHeight += buttonSize.height
@ -1650,7 +1654,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
buttonY = availableSize.height - bottomInset - environment.safeInsets.bottom - buttonSize.height buttonY = availableSize.height - bottomInset - environment.safeInsets.bottom - buttonSize.height
} }
let buttonFrame = CGRect(origin: CGPoint(x: sideInset, y: buttonY), size: buttonSize) let buttonFrame = CGRect(origin: CGPoint(x: buttonInsets.left, y: buttonY), size: buttonSize)
if let buttonView = self.actionButton.view { if let buttonView = self.actionButton.view {
if buttonView.superview == nil { if buttonView.superview == nil {
self.addSubview(buttonView) self.addSubview(buttonView)

View File

@ -17,7 +17,6 @@ import ListSectionComponent
import BundleIconComponent import BundleIconComponent
import LottieComponent import LottieComponent
import ListSwitchItemComponent import ListSwitchItemComponent
import ListSwitchItemComponent
import ListActionItemComponent import ListActionItemComponent
import Markdown import Markdown
import TelegramStringFormatting import TelegramStringFormatting

View File

@ -425,6 +425,7 @@ private final class CollectibleItemInfoScreenContentComponent: Component {
transition: transition, transition: transition,
component: AnyComponent(ButtonComponent( component: AnyComponent(ButtonComponent(
background: ButtonComponent.Background( background: ButtonComponent.Background(
style: .glass,
color: environment.theme.list.itemCheckColors.fillColor, color: environment.theme.list.itemCheckColors.fillColor,
foreground: environment.theme.list.itemCheckColors.foregroundColor, foreground: environment.theme.list.itemCheckColors.foregroundColor,
pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.8) pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.8)
@ -450,9 +451,9 @@ private final class CollectibleItemInfoScreenContentComponent: Component {
} }
)), )),
environment: {}, environment: {},
containerSize: CGSize(width: availableSize.width - sideInset * 2.0, height: 50.0) containerSize: CGSize(width: availableSize.width - 30.0 * 2.0, height: 52.0)
) )
let buttonFrame = CGRect(origin: CGPoint(x: sideInset, y: contentHeight), size: buttonSize) let buttonFrame = CGRect(origin: CGPoint(x: 30.0, y: contentHeight), size: buttonSize)
if let buttonView = self.button.view { if let buttonView = self.button.view {
if buttonView.superview == nil { if buttonView.superview == nil {
self.addSubview(buttonView) self.addSubview(buttonView)
@ -618,6 +619,7 @@ private final class CollectibleItemInfoScreenComponent: Component {
}) })
} }
)), )),
style: .glass,
backgroundColor: .color(environment.theme.list.plainBackgroundColor), backgroundColor: .color(environment.theme.list.plainBackgroundColor),
animateOut: self.sheetAnimateOut animateOut: self.sheetAnimateOut
)), )),

View File

@ -354,7 +354,11 @@ private final class StarsTransactionSheetContent: CombinedComponent {
if let starGift = transaction.starGift { if let starGift = transaction.starGift {
switch starGift { switch starGift {
case .generic: case .generic:
titleText = strings.Stars_Transaction_Gift_Title if transaction.flags.contains(.isStarGiftAuctionBid) {
titleText = strings.Stars_Transaction_GiftAuctionBid
} else {
titleText = strings.Stars_Transaction_Gift_Title
}
descriptionText = "" descriptionText = ""
case let .unique(gift): case let .unique(gift):
titleText = gift.title titleText = gift.title
@ -418,7 +422,24 @@ private final class StarsTransactionSheetContent: CombinedComponent {
isGift = true isGift = true
} else if let starrefCommissionPermille = transaction.starrefCommissionPermille { } else if let starrefCommissionPermille = transaction.starrefCommissionPermille {
isRefProgram = true isRefProgram = true
if transaction.flags.contains(.isPaidMessage) { if transaction.flags.contains(.isLiveStreamPaidMessage) {
isPaidMessage = true
if transaction.flags.contains(.isReaction) {
titleText = strings.Stars_Transaction_LiveStreamReaction
} else {
titleText = strings.Stars_Transaction_LiveStreamPaidMessage(transaction.paidMessageCount ?? 1)
}
if !transaction.flags.contains(.isRefund) {
countOnTop = true
if transaction.flags.contains(.isReaction) {
descriptionText = strings.Stars_Transaction_LiveStreamReaction_Text(formatPermille(1000 - starrefCommissionPermille)).string
} else {
descriptionText = strings.Stars_Transaction_LiveStreamPaidMessage_Text(formatPermille(1000 - starrefCommissionPermille)).string
}
} else {
descriptionText = ""
}
} else if transaction.flags.contains(.isPaidMessage) {
isPaidMessage = true isPaidMessage = true
titleText = strings.Stars_Transaction_PaidMessage(transaction.paidMessageCount ?? 1) titleText = strings.Stars_Transaction_PaidMessage(transaction.paidMessageCount ?? 1)
if !transaction.flags.contains(.isRefund) { if !transaction.flags.contains(.isRefund) {
@ -468,6 +489,13 @@ private final class StarsTransactionSheetContent: CombinedComponent {
if let months = transaction.premiumGiftMonths { if let months = transaction.premiumGiftMonths {
premiumGiftMonths = months premiumGiftMonths = months
titleText = strings.Stars_Transaction_TelegramPremium(months) titleText = strings.Stars_Transaction_TelegramPremium(months)
} else if transaction.flags.contains(.isLiveStreamPaidMessage) {
isPaidMessage = true
if transaction.flags.contains(.isReaction) {
titleText = strings.Stars_Transaction_LiveStreamReaction
} else {
titleText = strings.Stars_Transaction_LiveStreamPaidMessage(transaction.paidMessageCount ?? 1)
}
} else if transaction.flags.contains(.isPaidMessage) { } else if transaction.flags.contains(.isPaidMessage) {
isPaidMessage = true isPaidMessage = true
titleText = strings.Stars_Transaction_PaidMessage(transaction.paidMessageCount ?? 1) titleText = strings.Stars_Transaction_PaidMessage(transaction.paidMessageCount ?? 1)

View File

@ -311,11 +311,21 @@ final class StarsTransactionsListPanelComponent: Component {
itemTitle = environment.strings.Stars_Intro_Transaction_SearchFee itemTitle = environment.strings.Stars_Intro_Transaction_SearchFee
itemSubtitle = "" itemSubtitle = ""
itemPeer = .search itemPeer = .search
} else if item.flags.contains(.isLiveStreamPaidMessage) {
itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)
if item.flags.contains(.isReaction) {
itemSubtitle = environment.strings.Stars_Intro_Transaction_LiveStreamReaction
} else {
itemSubtitle = environment.strings.Stars_Intro_Transaction_LiveStreamPaidMessage(item.paidMessageCount ?? 1)
}
} else if item.flags.contains(.isPaidMessage) { } else if item.flags.contains(.isPaidMessage) {
itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast) itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)
itemSubtitle = environment.strings.Stars_Intro_Transaction_PaidMessage(item.paidMessageCount ?? 1) itemSubtitle = environment.strings.Stars_Intro_Transaction_PaidMessage(item.paidMessageCount ?? 1)
} else if let starGift = item.starGift { } else if let starGift = item.starGift {
if item.flags.contains(.isStarGiftPrepaidUpgrade) { if item.flags.contains(.isStarGiftAuctionBid), case let .generic(gift) = starGift {
itemTitle = gift.title ?? "Gift"
itemSubtitle = environment.strings.Stars_Intro_Transaction_GiftAuctionBid
} else if item.flags.contains(.isStarGiftPrepaidUpgrade) {
itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast) itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)
itemSubtitle = environment.strings.Stars_Intro_Transaction_PrepaidGiftUpgrade itemSubtitle = environment.strings.Stars_Intro_Transaction_PrepaidGiftUpgrade
} else if item.flags.contains(.isStarGiftDropOriginalDetails), case let .unique(gift) = starGift { } else if item.flags.contains(.isStarGiftDropOriginalDetails), case let .unique(gift) = starGift {

View File

@ -1126,10 +1126,10 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
} else { } else {
profileAudioComponent = AnyComponent(ButtonComponent( profileAudioComponent = AnyComponent(ButtonComponent(
background: ButtonComponent.Background( background: ButtonComponent.Background(
style: .glass,
color: self.presentationData.theme.list.itemCheckColors.fillColor, color: self.presentationData.theme.list.itemCheckColors.fillColor,
foreground: self.presentationData.theme.list.itemCheckColors.foregroundColor, foreground: self.presentationData.theme.list.itemCheckColors.foregroundColor,
pressedColor: self.presentationData.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9), pressedColor: self.presentationData.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9),
cornerRadius: 10.0
), ),
content: AnyComponentWithIdentity(id: AnyHashable(0 as Int), component: AnyComponent( content: AnyComponentWithIdentity(id: AnyHashable(0 as Int), component: AnyComponent(
HStack([ HStack([