diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift index 332f744dbb..f261be57a9 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift @@ -416,10 +416,10 @@ final class AuthorizationSequencePaymentScreenComponent: Component { transition: transition, component: AnyComponent(ButtonComponent( background: ButtonComponent.Background( + style: .glass, color: environment.theme.list.itemCheckColors.fillColor, foreground: environment.theme.list.itemCheckColors.foregroundColor, - pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9), - cornerRadius: 10.0 + pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9) ), content: AnyComponentWithIdentity( id: AnyHashable(buttonString), diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequencePhoneEntryControllerNode.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequencePhoneEntryControllerNode.swift index 6181df65d9..784136d90c 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequencePhoneEntryControllerNode.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequencePhoneEntryControllerNode.swift @@ -284,7 +284,14 @@ private final class ContactSyncNode: ASDisplayNode { } func updateLayout(width: CGFloat) -> CGSize { - let switchSize = CGSize(width: 51.0, height: 31.0) + var switchSize = CGSize(width: 51.0, height: 31.0) + if let switchView = self.switchNode.view as? UISwitch { + if self.switchNode.bounds.size.width.isZero { + switchView.sizeToFit() + } + switchSize = switchView.bounds.size + } + let inset: CGFloat = 24.0 let titleSize = self.titleNode.updateLayout(CGSize(width: width - switchSize.width - inset * 2.0 - 8.0, height: .greatestFiniteMagnitude)) let height: CGFloat = 40.0 diff --git a/submodules/Display/Source/ActionSheetSwitchItem.swift b/submodules/Display/Source/ActionSheetSwitchItem.swift index b9de851c4c..75d0651a30 100644 --- a/submodules/Display/Source/ActionSheetSwitchItem.swift +++ b/submodules/Display/Source/ActionSheetSwitchItem.swift @@ -110,7 +110,13 @@ public class ActionSheetSwitchNode: ActionSheetItemNode { let labelSize = self.label.updateLayout(CGSize(width: max(1.0, size.width - 51.0 - 16.0 * 2.0), height: size.height)) self.label.frame = CGRect(origin: CGPoint(x: 16.0, y: floorToScreenPixels((size.height - labelSize.height) / 2.0)), size: labelSize) - let switchSize = CGSize(width: 51.0, height: 31.0) + var switchSize = CGSize(width: 51.0, height: 31.0) + if let switchView = self.switchNode.view as? UISwitch { + if self.switchNode.bounds.size.width.isZero { + switchView.sizeToFit() + } + switchSize = switchView.bounds.size + } self.switchNode.frame = CGRect(origin: CGPoint(x: size.width - 16.0 - switchSize.width, y: floor((size.height - switchSize.height) / 2.0)), size: switchSize) self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size) diff --git a/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift b/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift index 499100d72b..0f4cf342a6 100644 --- a/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift +++ b/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift @@ -1027,7 +1027,7 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo var additionalLeftInset: CGFloat = 0.0 var leftInset: CGFloat = params.leftInset var rightInset: CGFloat = params.rightInset - let switchSize = CGSize(width: 51.0, height: 31.0) + var switchSize = CGSize(width: 51.0, height: 31.0) var checkImage: UIImage? if let switchValue = item.switchValue { @@ -1056,6 +1056,13 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo currentCheckNode = nil } + if let currentSwitchNode, let switchView = currentSwitchNode.view as? UISwitch { + if currentSwitchNode.bounds.size.width.isZero { + switchView.sizeToFit() + } + switchSize = switchView.bounds.size + } + let titleColor: UIColor switch item.nameColor { case .primary: diff --git a/submodules/ReactionSelectionNode/Sources/ReactionContextBackgroundNode.swift b/submodules/ReactionSelectionNode/Sources/ReactionContextBackgroundNode.swift index 10802fe6e7..0fda32b42e 100644 --- a/submodules/ReactionSelectionNode/Sources/ReactionContextBackgroundNode.swift +++ b/submodules/ReactionSelectionNode/Sources/ReactionContextBackgroundNode.swift @@ -237,7 +237,7 @@ final class ReactionContextBackgroundNode: ASDisplayNode { var glassBackgroundFrame = contentBounds.insetBy(dx: 10.0, dy: 10.0) glassBackgroundFrame.size.height -= 8.0 transition.updateFrame(view: glassBackgroundView, frame: glassBackgroundFrame, beginWithCurrentState: true) - glassBackgroundView.update(size: glassBackgroundFrame.size, cornerRadius: 23.0, isDark: true, tintColor: .init(kind: .custom, color: UIColor(rgb: 0x1b1d22)), transition: ComponentTransition(transition)) + glassBackgroundView.update(size: glassBackgroundFrame.size, cornerRadius: 23.0, isDark: true, tintColor: .init(kind: .panel, color: UIColor(rgb: 0x1f1f27)), transition: ComponentTransition(transition)) transition.updateFrame(view: self.backgroundTintView, frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: contentBounds.width, height: contentBounds.height)).insetBy(dx: -10.0, dy: -10.0)) } else { diff --git a/submodules/TelegramCallsUI/Sources/Components/MessageItemComponent.swift b/submodules/TelegramCallsUI/Sources/Components/MessageItemComponent.swift index 536551eef4..2e87d6d599 100644 --- a/submodules/TelegramCallsUI/Sources/Components/MessageItemComponent.swift +++ b/submodules/TelegramCallsUI/Sources/Components/MessageItemComponent.swift @@ -106,8 +106,8 @@ final class MessageItemComponent: Component { transition.setPosition(view: textSnapshotView, position: CGPoint(x: textSnapshotView.center.x + 71.0, y: textSnapshotView.center.y)) let initialSize = self.background.frame.size - self.background.update(size: globalFrame.size, cornerRadius: cornerRadius, isDark: true, tintColor: .init(kind: .custom, color: UIColor(rgb: 0x1b1d22)), transition: .immediate) - self.background.update(size: initialSize, cornerRadius: 18.0, isDark: true, tintColor: .init(kind: .custom, color: UIColor(rgb: 0x1b1d22)), transition: transition) + self.background.update(size: globalFrame.size, cornerRadius: cornerRadius, isDark: true, tintColor: .init(kind: .panel, color: UIColor(rgb: 0x1f1f27)), transition: .immediate) + self.background.update(size: initialSize, cornerRadius: 18.0, isDark: true, tintColor: .init(kind: .panel, color: UIColor(rgb: 0x1f1f27)), transition: transition) let deltaX = (globalFrame.width - self.container.frame.width) / 2.0 let deltaY = (globalFrame.height - self.container.frame.height) / 2.0 @@ -209,7 +209,7 @@ final class MessageItemComponent: Component { transition.setFrame(view: self.container, frame: CGRect(origin: CGPoint(), size: size)) - self.background.update(size: size, cornerRadius: cornerRadius, isDark: true, tintColor: .init(kind: .custom, color: UIColor(rgb: 0x1b1d22)), transition: transition) + self.background.update(size: size, cornerRadius: cornerRadius, isDark: true, tintColor: .init(kind: .panel, color: UIColor(rgb: 0x1f1f27)), transition: transition) transition.setFrame(view: self.background, frame: CGRect(origin: CGPoint(), size: size)) if isFirstTime, let availableReactions = component.availableReactions, let textView = self.text.view { diff --git a/submodules/TelegramCallsUI/Sources/VideoChatActionButtonComponent.swift b/submodules/TelegramCallsUI/Sources/VideoChatActionButtonComponent.swift index da16339766..a8014d2037 100644 --- a/submodules/TelegramCallsUI/Sources/VideoChatActionButtonComponent.swift +++ b/submodules/TelegramCallsUI/Sources/VideoChatActionButtonComponent.swift @@ -208,7 +208,7 @@ final class VideoChatActionButtonComponent: Component { iconDiameter = 56.0 case .leave: titleText = component.strings.VoiceChat_Leave - backgroundColor = UIColor(rgb: 0x330d0b) + backgroundColor = UIColor(rgb: 0x4f1613) tintColorKind = .custom iconDiameter = 22.0 } diff --git a/submodules/TelegramCallsUI/Sources/VideoChatScreen.swift b/submodules/TelegramCallsUI/Sources/VideoChatScreen.swift index 85560da50a..0bcc243751 100644 --- a/submodules/TelegramCallsUI/Sources/VideoChatScreen.swift +++ b/submodules/TelegramCallsUI/Sources/VideoChatScreen.swift @@ -1380,7 +1380,7 @@ final class VideoChatScreenComponent: Component { guard !text.string.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return } - let entities = generateChatInputTextEntities(text) + let entities = generateTextEntities(text.string, enabledTypes: [.mention, .hashtag, .allUrl], currentEntities: generateChatInputTextEntities(text)) call.sendMessage(text: text.string, entities: entities) } diff --git a/submodules/TelegramUI/Components/Gifts/GiftSetupScreen/Sources/GiftSetupScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftSetupScreen/Sources/GiftSetupScreen.swift index c47b31dcc2..0d0effd69a 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftSetupScreen/Sources/GiftSetupScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftSetupScreen/Sources/GiftSetupScreen.swift @@ -869,11 +869,13 @@ final class GiftSetupScreenComponent: Component { transition: transition, component: AnyComponent(ListSectionComponent( theme: environment.theme, + style: .glass, header: nil, footer: nil, items: [ AnyComponentWithIdentity(id: 0, component: AnyComponent(ListActionItemComponent( theme: environment.theme, + style: .glass, title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent( MultilineTextComponent( @@ -998,6 +1000,7 @@ final class GiftSetupScreenComponent: Component { transition: transition, component: AnyComponent(ListSectionComponent( theme: environment.theme, + style: .glass, header: nil, footer: introFooter, items: introSectionItems @@ -1134,6 +1137,7 @@ final class GiftSetupScreenComponent: Component { transition: transition, component: AnyComponent(ListSectionComponent( theme: environment.theme, + style: .glass, header: nil, footer: AnyComponent(MultilineTextWithEntitiesComponent( context: component.context, @@ -1169,6 +1173,7 @@ final class GiftSetupScreenComponent: Component { items: [ AnyComponentWithIdentity(id: 0, component: AnyComponent(ListActionItemComponent( theme: environment.theme, + style: .glass, title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent( MultilineTextWithEntitiesComponent( @@ -1238,6 +1243,7 @@ final class GiftSetupScreenComponent: Component { transition: transition, component: AnyComponent(ListSectionComponent( theme: environment.theme, + style: .glass, header: nil, footer: AnyComponent(MultilineTextComponent( text: .plain(upgradeFooterText), @@ -1272,6 +1278,7 @@ final class GiftSetupScreenComponent: Component { items: [ AnyComponentWithIdentity(id: 0, component: AnyComponent(ListActionItemComponent( theme: environment.theme, + style: .glass, title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent( MultilineTextWithEntitiesComponent( @@ -1320,6 +1327,7 @@ final class GiftSetupScreenComponent: Component { transition: transition, component: AnyComponent(ListSectionComponent( theme: environment.theme, + style: .glass, header: nil, footer: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( @@ -1332,6 +1340,7 @@ final class GiftSetupScreenComponent: Component { items: [ AnyComponentWithIdentity(id: 0, component: AnyComponent(ListActionItemComponent( theme: environment.theme, + style: .glass, title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( @@ -1431,14 +1440,15 @@ final class GiftSetupScreenComponent: Component { buttonAttributedString.addAttribute(.kern, value: 2.0, range: NSRange(range, in: buttonAttributedString.string)) } + let buttonSideInset = environment.safeInsets.left + 36.0 let buttonSize = self.button.update( transition: transition, component: AnyComponent(ButtonComponent( background: ButtonComponent.Background( + style: .glass, color: environment.theme.list.itemCheckColors.fillColor, foreground: environment.theme.list.itemCheckColors.foregroundColor, pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9), - cornerRadius: 10.0, isShimmering: true ), content: AnyComponentWithIdentity( @@ -1452,7 +1462,7 @@ final class GiftSetupScreenComponent: Component { } )), environment: {}, - containerSize: CGSize(width: availableSize.width - sideInset * 2.0, height: buttonHeight) + containerSize: CGSize(width: availableSize.width - buttonSideInset * 2.0, height: buttonHeight) ) if let buttonView = self.button.view { if buttonView.superview == nil { diff --git a/submodules/TelegramUI/Components/ListActionItemComponent/Sources/ListActionItemComponent.swift b/submodules/TelegramUI/Components/ListActionItemComponent/Sources/ListActionItemComponent.swift index 91b1cb1f84..d9abc93708 100644 --- a/submodules/TelegramUI/Components/ListActionItemComponent/Sources/ListActionItemComponent.swift +++ b/submodules/TelegramUI/Components/ListActionItemComponent/Sources/ListActionItemComponent.swift @@ -684,7 +684,13 @@ public final class ListActionItemComponent: Component { switchNode.handleColor = component.theme.list.itemSwitchColors.handleColor } - let switchSize = CGSize(width: 51.0, height: 31.0) + var switchSize = CGSize(width: 51.0, height: 31.0) + if let switchView = switchNode.view as? UISwitch { + if switchNode.bounds.size.width.isZero { + switchView.sizeToFit() + } + switchSize = switchView.bounds.size + } let switchFrame = CGRect(origin: CGPoint(x: availableSize.width - 16.0 - switchSize.width, y: floor((min(60.0, contentHeight) - switchSize.height) * 0.5)), size: switchSize) switchTransition.setFrame(view: switchNode.view, frame: switchFrame) case .icons, .lock: @@ -727,7 +733,13 @@ public final class ListActionItemComponent: Component { switchNode.negativeContentColor = component.theme.list.itemSwitchColors.negativeColor } - let switchSize = CGSize(width: 51.0, height: 31.0) + var switchSize = CGSize(width: 51.0, height: 31.0) + if let switchView = switchNode.view as? UISwitch { + if switchNode.bounds.size.width.isZero { + switchView.sizeToFit() + } + switchSize = switchView.bounds.size + } let switchFrame = CGRect(origin: CGPoint(x: availableSize.width - 16.0 - switchSize.width, y: floor((min(60.0, contentHeight) - switchSize.height) * 0.5)), size: switchSize) switchTransition.setFrame(view: switchNode.view, frame: switchFrame) } diff --git a/submodules/TelegramUI/Components/MessageInputActionButtonComponent/Sources/MessageInputActionButtonComponent.swift b/submodules/TelegramUI/Components/MessageInputActionButtonComponent/Sources/MessageInputActionButtonComponent.swift index 6f598f29f5..6ecb348167 100644 --- a/submodules/TelegramUI/Components/MessageInputActionButtonComponent/Sources/MessageInputActionButtonComponent.swift +++ b/submodules/TelegramUI/Components/MessageInputActionButtonComponent/Sources/MessageInputActionButtonComponent.swift @@ -49,7 +49,7 @@ private class ButtonIcon: Equatable { case .repost: return generateTintedImage(image: UIImage(bundleImageName: "Stories/InputRepost"), color: .white) case .close: - return generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Search/DownButton"), color: .white) + return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/Close"), color: .white) case .apply: return generateImage(CGSize(width: 33.0, height: 33.0), contextGenerator: { size, context in context.clear(CGRect(origin: CGPoint(), size: size)) @@ -529,7 +529,7 @@ public final class MessageInputActionButtonComponent: Component { self.backgroundView = backgroundView } - var tintColor = UIColor(rgb: 0x1b1d22) + var tintColor = UIColor(rgb: 0x1f1f27) if case .send = component.mode { tintColor = UIColor(rgb: 0x0187ee) } diff --git a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift index 978e0c6dc9..dc7165399e 100644 --- a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift +++ b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift @@ -1076,7 +1076,7 @@ public final class MessageInputPanelComponent: Component { self.fieldBackgroundTint.isHidden = true } if let fieldGlassBackgroundView = self.fieldGlassBackgroundView { - fieldGlassBackgroundView.update(size: fieldBackgroundFrame.size, cornerRadius: baseFieldHeight * 0.5, isDark: true, tintColor: .init(kind: .custom, color: UIColor(rgb: 0x1b1d22)), transition: transition) + fieldGlassBackgroundView.update(size: fieldBackgroundFrame.size, cornerRadius: baseFieldHeight * 0.5, isDark: true, tintColor: .init(kind: .panel, color: UIColor(rgb: 0x1f1f27)), transition: transition) transition.setFrame(view: fieldGlassBackgroundView, frame: fieldBackgroundFrame) } default: diff --git a/submodules/TelegramUI/Components/Stories/StoryStealthModeSheetScreen/Sources/StoryStealthModeSheetScreen.swift b/submodules/TelegramUI/Components/Stories/StoryStealthModeSheetScreen/Sources/StoryStealthModeSheetScreen.swift index ba418b1545..cde05abfc0 100644 --- a/submodules/TelegramUI/Components/Stories/StoryStealthModeSheetScreen/Sources/StoryStealthModeSheetScreen.swift +++ b/submodules/TelegramUI/Components/Stories/StoryStealthModeSheetScreen/Sources/StoryStealthModeSheetScreen.swift @@ -265,6 +265,7 @@ private final class StoryStealthModeSheetContentComponent: Component { ], spacing: 4.0) )) } + let buttonSize = self.button.update( transition: transition, component: AnyComponent(ButtonComponent( diff --git a/submodules/TelegramUI/Images.xcassets/Media Editor/Close.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Media Editor/Close.imageset/Contents.json new file mode 100644 index 0000000000..dd974deb87 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Media Editor/Close.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "closekeyboard.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Media Editor/Close.imageset/closekeyboard.pdf b/submodules/TelegramUI/Images.xcassets/Media Editor/Close.imageset/closekeyboard.pdf new file mode 100644 index 0000000000..03574a1497 Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Media Editor/Close.imageset/closekeyboard.pdf differ