Fix text field insets in editor

This commit is contained in:
Ilya Laktyushin 2023-08-21 16:54:35 +04:00
parent f9060c696b
commit b53be04a2e
2 changed files with 25 additions and 25 deletions

View File

@ -2224,7 +2224,7 @@ final class ItemStack<ChildEnvironment: Equatable>: CombinedComponent {
let remainingWidth = context.availableSize.width - itemsWidth - context.component.padding * 2.0
spacing = remainingWidth / CGFloat(group.count - 1)
var nextX: CGFloat = context.component.padding
var nextX: CGFloat = floorToScreenPixels((context.availableSize.width - itemsWidth) / 2.0) //context.component.padding
for i in group {
let child = updatedChildren[i]
let frame = CGRect(origin: CGPoint(x: nextX, y: size.height + floorToScreenPixels((groupHeight - child.size.height) / 2.0)), size: child.size)
@ -2280,30 +2280,30 @@ final class StoryStickersContentView: UIView, EmojiCustomContentView {
}
})
)
),
AnyComponentWithIdentity(
id: "audio",
component: AnyComponent(
CameraButton(
content: AnyComponentWithIdentity(
id: "audio",
component: AnyComponent(
CustomContentButton(
theme: theme,
title: "AUDIO",
iconName: "Media Editor/Audio",
useOpaqueTheme: useOpaqueTheme,
tintContainerView: self.tintContainerView
)
)
),
action: { [weak self] in
if let self {
self.audioAction()
}
})
)
)
// AnyComponentWithIdentity(
// id: "audio",
// component: AnyComponent(
// CameraButton(
// content: AnyComponentWithIdentity(
// id: "audio",
// component: AnyComponent(
// CustomContentButton(
// theme: theme,
// title: "AUDIO",
// iconName: "Media Editor/Audio",
// useOpaqueTheme: useOpaqueTheme,
// tintContainerView: self.tintContainerView
// )
// )
// ),
// action: { [weak self] in
// if let self {
// self.audioAction()
// }
// })
// )
// )
],
padding: 18.0,
minSpacing: 8.0

View File

@ -736,7 +736,7 @@ public final class MessageInputPanelComponent: Component {
var fieldBackgroundFrame: CGRect
if hasMediaRecording {
fieldBackgroundFrame = CGRect(origin: CGPoint(x: mediaInsets.left, y: insets.top), size: CGSize(width: availableSize.width - mediaInsets.left - mediaInsets.right, height: textFieldSize.height))
} else if isEditing {
} else if isEditing || component.style == .editor {
fieldBackgroundFrame = fieldFrame
} else {
if component.forwardAction != nil && component.likeAction != nil {