Changing picker style

pull/11/head
Johan LACHENAL 11 months ago
parent 2154d4401e
commit 1962e025bf

@ -19,10 +19,13 @@ struct DoushiQiPicker<EnumType: RawRepresentable & Identifiable & Hashable>: Vie
}
var body: some View {
VStack(spacing: 0) {
Divider().background(Color.gray)
Menu {
Picker(title, selection: $selectedOption) {
ForEach(options) { option in
Text(option.rawValue.description)
.padding()
}
}
.labelsHidden()
@ -30,17 +33,17 @@ struct DoushiQiPicker<EnumType: RawRepresentable & Identifiable & Hashable>: Vie
} label: {
HStack {
Text(title)
.foregroundColor(.white)
.foregroundColor(.black)
.padding()
Spacer()
Text(selectedOption.rawValue.description)
.foregroundColor(.white)
.foregroundColor(.black)
.padding()
}
.frame(maxWidth: .infinity)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.background(Color.black)
.clipShape(Capsule())
.padding(EdgeInsets(top: 0, leading: 32, bottom: 0, trailing: 32))
}
Divider().background(Color.gray)
}
}
}

@ -17,7 +17,7 @@ struct MainMenuButton<Content : View>: View {
}
var body: some View {
NavigationLink(title){
NavigationLink("parties enregistrées"){
// ici mettre la vue sur les parties enregistrées à la place du texte n'hésite pas à tester sur la preview la navigation ça marche, faire pareil pour les autres
content
}
@ -29,6 +29,7 @@ struct MainMenuButton<Content : View>: View {
.background(.black)
.buttonBorderShape(.roundedRectangle)
.clipShape(Capsule())
Spacer().frame(height: 50)
}
}

@ -22,7 +22,7 @@ enum Language: String, CaseIterable, Identifiable, Hashable {
}
enum Rules: String, CaseIterable, Identifiable, Hashable {
case Easy = "Simple"
case Easy = "Simplifié"
case Regular = "Normal"
var id: String { self.rawValue }
}
@ -32,7 +32,7 @@ struct ParametersMenuView: View {
@State private var selectedLanguageOption: Language = .French
@State private var selectedRulesOption: Rules = .Regular
var body: some View {
VStack {
VStack(alignment: .leading) {
ToggleView()
DoushiQiPicker(title: "Sélectionne une IA :",
selectedOption: $selectedAIOption,
@ -44,7 +44,7 @@ struct ParametersMenuView: View {
selectedOption: $selectedRulesOption,
options: Rules.allCases)
}
}.frame(maxHeight: .infinity, alignment: .top)
}
}

Loading…
Cancel
Save