UI adjustments

This commit is contained in:
Patrick Müller 2021-02-07 15:17:29 +01:00 committed by Patrick Müller
parent 99b996550e
commit dba2233312
3 changed files with 16 additions and 5 deletions

View File

@ -44,14 +44,16 @@ struct HomeView: View {
VStack { VStack {
Text("today".localized(tableName: "HomeView")) Text("today".localized(tableName: "HomeView"))
.font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/) .font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity, alignment: .leading)
VStack { VStack {
if(!todaysEvents.isEmpty){ if(!todaysEvents.isEmpty){
ForEach(todaysEvents, id: \.self) { exam in ForEach(todaysEvents, id: \.self) { exam in
Text(exam.value(forKey: "summary") as! String) Text(exam.value(forKey: "summary") as! String)
.frame(maxWidth: .infinity, alignment: .leading)
} }
} else { } else {
Text("noLectures".localized(tableName: "HomeView")) Text("noLectures".localized(tableName: "HomeView"))
.frame(maxWidth: .infinity, alignment: .leading)
} }
} }
} }
@ -64,14 +66,16 @@ struct HomeView: View {
VStack { VStack {
Text("tomorrow".localized(tableName: "HomeView")) Text("tomorrow".localized(tableName: "HomeView"))
.font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/) .font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity, alignment: .leading)
VStack { VStack {
if(!tomorrowsEvents.isEmpty){ if(!tomorrowsEvents.isEmpty){
ForEach(tomorrowsEvents, id: \.self) { exam in ForEach(tomorrowsEvents, id: \.self) { exam in
Text(exam.value(forKey: "summary") as! String) Text(exam.value(forKey: "summary") as! String)
.frame(maxWidth: .infinity, alignment: .leading)
} }
} else { } else {
Text("noLectures".localized(tableName: "HomeView")) Text("noLectures".localized(tableName: "HomeView"))
.frame(maxWidth: .infinity, alignment: .leading)
} }
} }
} }
@ -91,14 +95,16 @@ struct HomeView: View {
VStack { VStack {
Text("upcomingExams".localized(tableName: "HomeView")) Text("upcomingExams".localized(tableName: "HomeView"))
.font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/) .font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity, alignment: .leading)
VStack { VStack {
if(!upcomingExams.isEmpty){ if(!upcomingExams.isEmpty){
ForEach(upcomingExams, id: \.self) { exam in ForEach(upcomingExams, id: \.self) { exam in
Text(exam.value(forKey: "summary") as! String) Text(exam.value(forKey: "summary") as! String)
.frame(maxWidth: .infinity, alignment: .leading)
} }
} else { } else {
Text("noExams".localized(tableName: "HomeView")) Text("noExams".localized(tableName: "HomeView"))
.frame(maxWidth: .infinity, alignment: .leading)
} }
} }
} }
@ -116,7 +122,9 @@ struct HomeView: View {
} }
} }
.navigationBarTitle(Text("Home")) .navigationBarTitle(Text("Home"))
}.onAppear{ }
.navigationViewStyle(StackNavigationViewStyle())
.onAppear{
self.readFromCoreData() self.readFromCoreData()
self.todaysEvents = getTodaysEvents() self.todaysEvents = getTodaysEvents()
self.tomorrowsEvents = getTomorrowsEvents() self.tomorrowsEvents = getTomorrowsEvents()

View File

@ -55,7 +55,9 @@ struct LecturePlanList: View {
// Text("Switch order") // Text("Switch order")
// } // }
// }) // })
}.onAppear{ }
.navigationViewStyle(StackNavigationViewStyle())
.onAppear{
let sectionSortDescriptor = NSSortDescriptor(key: "startDate", ascending: true) let sectionSortDescriptor = NSSortDescriptor(key: "startDate", ascending: true)
let sortDescriptors = [sectionSortDescriptor] let sortDescriptors = [sectionSortDescriptor]
self.events = [] self.events = []

View File

@ -30,6 +30,7 @@ struct SettingsMain: View {
.navigationTitle("settings".localized(tableName: "General", plural: false)) .navigationTitle("settings".localized(tableName: "General", plural: false))
.listStyle(GroupedListStyle()) .listStyle(GroupedListStyle())
} }
.navigationViewStyle(StackNavigationViewStyle())
.alert(isPresented: $showLogoutConfirmationAlert, content: { .alert(isPresented: $showLogoutConfirmationAlert, content: {
Alert( Alert(
title: Text("logout".localized(tableName: "General", plural: false)), title: Text("logout".localized(tableName: "General", plural: false)),