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 @State private var segmentedSelection: SegementedSelection = .search
var body: some View { var body: some View {
NavigationStack { NavigationStack {
Picker("", selection: $segmentedSelection) { VStack {
ForEach(SegementedSelection.allCases, id: \.self) { sel in Picker("", selection: $segmentedSelection) {
Text(sel.rawValue).tag(sel) 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 { var body: some View {
VStack { VStack {
TextField("Search", text: $query) TextField("Search", text: $query)
.padding()
.padding(.bottom, 0)
.onSubmit { .onSubmit {
brew.getInfo(on: query) brew.getInfo(on: query)
} }