Fixed padding on components

This commit is contained in:
cdricms
2024-07-10 11:49:48 +02:00
parent 4c9665a41b
commit 675f4ee89b
2 changed files with 12 additions and 11 deletions

View File

@@ -16,16 +16,19 @@ struct ContentView: View {
@State private var segmentedSelection: SegementedSelection = .search
var body: some View {
NavigationStack {
Picker("", selection: $segmentedSelection) {
ForEach(SegementedSelection.allCases, id: \.self) { sel in
Text(sel.rawValue).tag(sel)
VStack {
Picker("", selection: $segmentedSelection) {
ForEach(SegementedSelection.allCases, id: \.self) { sel in
Text(sel.rawValue).tag(sel)
}
}.pickerStyle(.segmented)
.padding(.leading, -8)
switch segmentedSelection {
case .search:
SearchView()
case .installed:
InstalledView()
}
}.pickerStyle(.segmented)
switch segmentedSelection {
case .search:
SearchView()
case .installed:
InstalledView()
}
}
}

View File

@@ -13,8 +13,6 @@ struct SearchView: View {
var body: some View {
VStack {
TextField("Search", text: $query)
.padding()
.padding(.bottom, 0)
.onSubmit {
brew.getInfo(on: query)
}