Skip to content

Commit

Permalink
more section headers
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonCat4012 committed Mar 12, 2024
1 parent 575b79d commit 57c48b8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Lotus/Screens/SettingsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ struct SettingsScreen: View {
}

Section {
HStack {
Text("settings_SectionEditTypes_exampleID")
Text("settings_SectionEditTypes_exampleName")
Spacer()
Text("settings_SectionEditTypes_exampleCount")
}.foregroundColor(.gray)
ForEach(vm.allTypes) { type in
HStack {
Text(String(type.rawValue)).foregroundColor(.gray)
Image(systemName: "heart.rectangle.fill")
.foregroundColor(Color(hexString: type.color))
typeView(type)
Text(type.name)
Spacer()
Text(String(vm.getTilesCountForType(type: type)))
Expand Down Expand Up @@ -74,4 +78,14 @@ struct SettingsScreen: View {
EditEntrysScreen()
}
}

func typeView(_ entry: Category) -> some View {
ZStack {
RoundedRectangle(cornerRadius: 8)
.fill(Color(hexString: entry.color))
.frame(width: 35, height: 25)
Text(String(entry.rawValue))
.frame(width: 35, height: 25)
}
}
}
2 changes: 2 additions & 0 deletions Lotus/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"addEntry_type"="Typ auswählen";
"addEntry_addButtonTitle"="Hinzufügen";

"settings_SectionEditTypes_exampleCount"="Anzahl";
"settings_SectionEditTypes_exampleName"="Name";
"settings_SectionEditTypes_exampleID"="Typ ID";
"settings_SectionEditTypes_exampleDate"="Datum";
"settings_SectionEditTypes_title"="Typ bearbeiten";
Expand Down
2 changes: 2 additions & 0 deletions Lotus/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"addEntry_type"="Choose a type";
"addEntry_addButtonTitle"="Add";

"settings_SectionEditTypes_exampleCount"="Count";
"settings_SectionEditTypes_exampleName"="Name";
"settings_SectionEditTypes_exampleID"="Type ID";
"settings_SectionEditTypes_exampleDate"="Date";
"settings_SectionEditTypes_title"="Edit Type";
Expand Down

0 comments on commit 57c48b8

Please sign in to comment.