Skip to content

Commit

Permalink
[Update]: Change design of buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Louise P committed Mar 13, 2021
1 parent 16d02db commit 29c9ca4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
11 changes: 9 additions & 2 deletions Meep/Meep/Menu/KeysView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,22 @@ struct KeysView: View {
HStack(alignment: .center) {
Text(touch.name)
Spacer()
Button(touch.touch, action: {
Button(action: {
changeKey(touch: touch.slug)
}, label: {
Text(touch.touch)
.frame(width: 200, height: .none, alignment: .center)
.padding(.all, 8)
.foregroundColor(.white)
.background(Color.gray)
.cornerRadius(40)
}).font(.title)
}
})
if changeTouch {
Text(self.textAlert)
}
}.frame(width: 400, height: .none, alignment: .center)
}.frame(width: 600, height: .none, alignment: .center)
.buttonStyle(PlainButtonStyle())
Spacer()

Expand Down
41 changes: 33 additions & 8 deletions Meep/Meep/Menu/LanguageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,46 @@ struct LanguageView: View {
menuData.lang = "fr"
UserDefaults.standard.setValue("fr", forKey: "Lang")
self.en.toggle()
}, label: {Text("Français")}).buttonStyle(PlainButtonStyle())
if !en {
Image(systemName: "checkmark")
}
}, label: {
HStack(alignment: .center, spacing: 15) {
Text("Français")
if !en {
Image(systemName: "checkmark")
} else {
Image(systemName: "multiply")
}
}.font(.title)
.frame(width: 150, height: .none, alignment: .center)
.padding(.all, 8)
.foregroundColor(.white)
.background(Color.gray)
.cornerRadius(40)
})
.buttonStyle(PlainButtonStyle())

}

HStack(alignment: .center) {
Button(action: {
menuData.lang = "en"
UserDefaults.standard.setValue("en", forKey: "Lang")
self.en.toggle()
}, label: {Text("English")}).buttonStyle(PlainButtonStyle())
if en {
Image(systemName: "checkmark")
}
}, label: {
HStack(alignment: .center, spacing: 15) {
Text("English")
if en {
Image(systemName: "checkmark")
} else {
Image(systemName: "multiply")
}
}.font(.title)
.frame(width: 150, height: .none, alignment: .center)
.padding(.all, 8)
.foregroundColor(.white)
.background(Color.gray)
.cornerRadius(40)
})
.buttonStyle(PlainButtonStyle())
}
}.frame(width: 400, height: .none, alignment: .center)

Expand Down

0 comments on commit 29c9ca4

Please sign in to comment.