Fix browser settings labels

This commit is contained in:
Arkadiusz Fal 2022-11-19 12:54:37 +01:00
parent 708c6fc112
commit 5d7bc809cb

View File

@ -82,26 +82,12 @@ struct BrowsingSettings: View {
} }
#endif #endif
Toggle("Show Open Videos quick actions", isOn: $showOpenActionsInHome) Toggle("Show Open Videos quick actions", isOn: $showOpenActionsInHome)
HStack {
Text("Recent History")
TextField("Recent History", text: $homeHistoryItemsText)
.labelsHidden()
#if !os(macOS)
.keyboardType(.numberPad)
#endif
.onAppear {
homeHistoryItemsText = String(homeHistoryItems)
}
.onChange(of: homeHistoryItemsText) { newValue in
homeHistoryItems = Int(newValue) ?? 10
}
}
.multilineTextAlignment(.trailing)
#if os(iOS) #if os(iOS)
HStack { HStack {
Text("Recent Documents") Text("Recent Documents")
TextField("Recent Documents", text: $homeRecentDocumentsItemsText) TextField("Recent Documents", text: $homeRecentDocumentsItemsText)
.multilineTextAlignment(.trailing)
.labelsHidden() .labelsHidden()
#if !os(macOS) #if !os(macOS)
.keyboardType(.numberPad) .keyboardType(.numberPad)
@ -113,9 +99,24 @@ struct BrowsingSettings: View {
homeRecentDocumentsItems = Int(newValue) ?? 3 homeRecentDocumentsItems = Int(newValue) ?? 3
} }
} }
.multilineTextAlignment(.trailing)
#endif #endif
HStack {
Text("Recent History")
TextField("Recent History", text: $homeHistoryItemsText)
.multilineTextAlignment(.trailing)
.labelsHidden()
#if !os(macOS)
.keyboardType(.numberPad)
#endif
.onAppear {
homeHistoryItemsText = String(homeHistoryItems)
}
.onChange(of: homeHistoryItemsText) { newValue in
homeHistoryItems = Int(newValue) ?? 10
}
}
if !accounts.isEmpty { if !accounts.isEmpty {
Toggle("Show Favorites", isOn: $showFavoritesInHome) Toggle("Show Favorites", isOn: $showFavoritesInHome)