From 795c1a187a277d5f0bfd5ead755471247de62c4f Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Fri, 23 Dec 2022 21:05:15 +0100 Subject: [PATCH] Components alignment. --- Diffusion/Views/TextToImage.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Diffusion/Views/TextToImage.swift b/Diffusion/Views/TextToImage.swift index 040959a..aae2c21 100644 --- a/Diffusion/Views/TextToImage.swift +++ b/Diffusion/Views/TextToImage.swift @@ -92,13 +92,15 @@ struct ImageWithPlaceholder: View { VStack { imageView.resizable().clipShape(RoundedRectangle(cornerRadius: 20)) HStack { - if let interval = interval { - Text(String(format:"Time: %.1fs", interval)) - } - Spacer() - ShareButtons(image: theImage, name: lastPrompt) - Spacer() - } + let intervalString = String(format: "Time: %.1fs", interval ?? 0) + Rectangle().fill(.clear).overlay(Text(intervalString).frame(maxWidth: .infinity, alignment: .leading).padding(.leading)) + Rectangle().fill(.clear).overlay( + HStack { + Spacer() + ShareButtons(image: theImage, name: lastPrompt).padding(.trailing) + } + ) + }.frame(maxHeight: 25) }) } }