mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Add recent documents to home on iOS
This commit is contained in:
@@ -8,6 +8,7 @@ struct BrowsingSettings: View {
|
||||
#endif
|
||||
@Default(.accountPickerDisplaysAnonymousAccounts) private var accountPickerDisplaysAnonymousAccounts
|
||||
#if os(iOS)
|
||||
@Default(.homeRecentDocumentsItems) private var homeRecentDocumentsItems
|
||||
@Default(.lockPortraitWhenBrowsing) private var lockPortraitWhenBrowsing
|
||||
#endif
|
||||
@Default(.thumbnailsQuality) private var thumbnailsQuality
|
||||
@@ -24,6 +25,9 @@ struct BrowsingSettings: View {
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
|
||||
@State private var homeHistoryItemsText = ""
|
||||
#if os(iOS)
|
||||
@State private var homeRecentDocumentsItemsText = ""
|
||||
#endif
|
||||
#if os(macOS)
|
||||
@State private var presentingEditFavoritesSheet = false
|
||||
#endif
|
||||
@@ -87,6 +91,22 @@ struct BrowsingSettings: View {
|
||||
}
|
||||
.multilineTextAlignment(.trailing)
|
||||
|
||||
HStack {
|
||||
Text("Recent documents")
|
||||
TextField("Recent documents", text: $homeRecentDocumentsItemsText)
|
||||
.labelsHidden()
|
||||
#if !os(macOS)
|
||||
.keyboardType(.numberPad)
|
||||
#endif
|
||||
.onAppear {
|
||||
homeRecentDocumentsItemsText = String(homeRecentDocumentsItems)
|
||||
}
|
||||
.onChange(of: homeRecentDocumentsItemsText) { newValue in
|
||||
homeRecentDocumentsItems = Int(newValue) ?? 3
|
||||
}
|
||||
}
|
||||
.multilineTextAlignment(.trailing)
|
||||
|
||||
if !accounts.isEmpty {
|
||||
Toggle("Show Favorites", isOn: $showFavoritesInHome)
|
||||
|
||||
|
Reference in New Issue
Block a user