Fix image resizing when keyboard is open

This commit is contained in:
Benoit Martins 2024-05-30 14:21:23 +02:00
parent 00a7f305a5
commit 45714fa633
2 changed files with 6 additions and 6 deletions

View file

@ -169,19 +169,19 @@ struct ChatBubbleView: View {
.if(result.0 < geometryProxy.size.width - 110) { view in
view.frame(maxWidth: result.0)
}
.if(result.1 < geometryProxy.size.height/2) { view in
.if(result.1 < UIScreen.main.bounds.height/2) { view in
view.frame(maxHeight: result.1)
}
.if(result.0 >= result.1 && geometryProxy.size.width > 0 && result.0 >= geometryProxy.size.width - 110 && result.1 >= geometryProxy.size.height/2.5) { view in
.if(result.0 >= result.1 && geometryProxy.size.width > 0 && result.0 >= geometryProxy.size.width - 110 && result.1 >= UIScreen.main.bounds.height/2.5) { view in
view.frame(
maxWidth: geometryProxy.size.width - 110,
maxHeight: result.1 * ((geometryProxy.size.width - 110) / result.0)
)
}
.if(result.0 < result.1 && geometryProxy.size.width > 0 && result.1 >= geometryProxy.size.height/2.5) { view in
.if(result.0 < result.1 && geometryProxy.size.width > 0 && result.1 >= UIScreen.main.bounds.height/2.5) { view in
view.frame(
maxWidth: result.0 * ((geometryProxy.size.height/2.5) / result.1),
maxHeight: geometryProxy.size.height/2.5
maxWidth: result.0 * ((UIScreen.main.bounds.height/2.5) / result.1),
maxHeight: UIScreen.main.bounds.height/2.5
)
}

View file

@ -65,7 +65,7 @@ struct ConversationFragment: View {
Image("caret-left")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.grayMain2c500)
.foregroundStyle(Color.orangeMain500)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
.padding(.top, 4)