Skip to content

Commit

Permalink
UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jdamcd committed Dec 26, 2023
1 parent 6ec633e commit 5dc9a64
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
12 changes: 8 additions & 4 deletions macOS/Arrivals/ArrivalsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ struct ArrivalsView: View {
}
}
}
.padding(8)
.padding(.horizontal, 8)
.padding(.top, 8)
.frame(width: 350, height: 110)
.onAppear {
viewModel.load()
Expand All @@ -49,10 +50,10 @@ private struct MainDisplay<Content: View>: View {
@ViewBuilder var content: Content

var body: some View {
VStack {
VStack(spacing: 0) {
ZStack { content }
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding(10)
.padding(8)
.background(Color.black)
.cornerRadius(4)
ControlFooter(text: footerText, refresh: refreshBehaviour)
Expand Down Expand Up @@ -91,7 +92,10 @@ private struct ControlFooter: View {
Image(systemName: "x.circle.fill")
.foregroundColor(Color.yellow)
}
}.buttonStyle(PlainButtonStyle())
}
.buttonStyle(PlainButtonStyle())
.padding(.bottom, 2)
.frame(height: 28)
}
}

Expand Down
31 changes: 15 additions & 16 deletions macOS/Arrivals/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ struct SettingsView: View {
@State private var directionFilter: String = "all"

var body: some View {
VStack(alignment: .leading) {
Form {
HStack {
Text("Station")
DebouncingTextField(label: "Search", value: $searchQuery) { value in
if !value.isEmpty {
viewModel.performSearch(value)
Expand Down Expand Up @@ -53,14 +52,13 @@ struct SettingsView: View {
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
.background(.background)
}
Picker("Direction", selection: $directionFilter) {
ForEach(directions, id: \.self) {
Text($0)
}
}.pickerStyle(.segmented)
HStack {
Text("Platform")
TextField("No filter", text: $platformFilter)
Section {
Picker("Direction", selection: $directionFilter) {
ForEach(directions, id: \.self) {
Text($0)
}
}.pickerStyle(.segmented)
TextField("Platform", text: $platformFilter)
.autocorrectionDisabled()
}
HStack {
Expand All @@ -76,12 +74,13 @@ struct SettingsView: View {
}
}.disabled(selectedResult == nil)
}
}.padding()
.frame(width: 350, height: 250)
.onAppear {
platformFilter = viewModel.initialPlatform()
directionFilter = viewModel.initialDirection()
}
}
.padding()
.frame(width: 350, height: 250)
.onAppear {
platformFilter = viewModel.initialPlatform()
directionFilter = viewModel.initialDirection()
}
}
}

Expand Down

0 comments on commit 5dc9a64

Please sign in to comment.