Commit d8f21af3 authored by Oliver Wiese's avatar Oliver Wiese
Browse files

fix font size in contact view. Unable key info button if contact has no key

parent 4ae8be61
......@@ -30,7 +30,6 @@ struct ContactView <C: DisplayContact>: View {
VStack {
HStack {
avatar
VStack (alignment: .leading) {
contactName.padding(.bottom)
knownSince
......@@ -144,7 +143,7 @@ struct ContactView <C: DisplayContact>: View {
} label: {
Text("\(eachAddress)")
.fontWeight(.light)
.font(.title2)
.font(.body)
.foregroundColor(.blue)
.truncationMode(.middle)
.frame(maxWidth: .infinity,
......@@ -157,32 +156,11 @@ struct ContactView <C: DisplayContact>: View {
// This row shows the security rating and a button do display the keys
HStack{
rating
Button {
withAnimation{
properties.emailAddress = eachAddress
properties.showKeysPopup.toggle()
}
} label: {
ZStack {
Capsule()
.frame(height: 25, alignment: .center)
.shadow(color:.gray, radius:2)
.foregroundColor(contact.addressRating(contact).color)
HStack{
Text(Image(systemName: "key.fill"))
.rotationEffect(Angle(degrees: 30))
Text(NSLocalizedString("Contact.Key.Description", comment: "Contact.Key.Description"))
.fontWeight(.medium)
}.foregroundColor(.white)
.font(.body)
}
}
if contact.primaryKey != nil {
showKeyBotton(addr: eachAddress)
}
}.padding(.vertical,3)
if eachAddress != contact.emails.last{
Divider().padding(.top,1)
}
......@@ -193,6 +171,32 @@ struct ContactView <C: DisplayContact>: View {
}.padding(.horizontal,5)
}
private func showKeyBotton (addr: String) -> some View {
Button {
withAnimation{
properties.emailAddress = addr
properties.showKeysPopup.toggle()
}
} label: {
ZStack {
Capsule()
.frame(height: 25, alignment: .center)
.shadow(color:.gray, radius:2)
.foregroundColor(contact.addressRating(contact).color)
HStack{
Text(Image(systemName: "key.fill"))
.rotationEffect(Angle(degrees: 30))
Text(NSLocalizedString("Contact.Key.Description", comment: "Contact.Key.Description"))
.fontWeight(.medium)
}.foregroundColor(.white)
.font(.footnote)
}
}
}
/// Creates a frame for the address label.
/// TODO: Add an addressLabel property to the DisplayContact.
......@@ -250,11 +254,11 @@ struct ContactView <C: DisplayContact>: View {
private var rating: some View {
HStack{
Text(Image(systemName: contact.addressRating(contact).shield))
.font(.title3)
.font(.footnote)
Text(contact.addressRating(contact).name)
.fontWeight(.medium)
.font(.body)
.font(.footnote)
}
.foregroundColor(contact.addressRating(contact).color)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment