mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
4663aab3da
- have a separate body view for each os - macOS: set navigation title for search - macOS: set min width to 835 for main content - macOS: set main window min height to 600 - macOS: don’t have text behind the cancel button - split SearchTextField into macOS and iOS/tvOS - iOS: move search menu to the right - iOS: unified search field - make min width a constant - add option to disable search suggestions Signed-off-by: Toni Förster <toni.foerster@gmail.com>
56 lines
2.7 KiB
Swift
56 lines
2.7 KiB
Swift
import Defaults
|
|
import SwiftyJSON
|
|
|
|
final class BrowsingSettingsGroupExporter: SettingsGroupExporter {
|
|
override var globalJSON: JSON {
|
|
[
|
|
"showHome": Defaults[.showHome],
|
|
"showOpenActionsInHome": Defaults[.showOpenActionsInHome],
|
|
"showQueueInHome": Defaults[.showQueueInHome],
|
|
"showFavoritesInHome": Defaults[.showFavoritesInHome],
|
|
"favorites": Defaults[.favorites].compactMap { jsonFromString(FavoriteItem.bridge.serialize($0)) },
|
|
"widgetsSettings": Defaults[.widgetsSettings].compactMap { widgetSettingsJSON($0) },
|
|
"startupSection": Defaults[.startupSection].rawValue,
|
|
"showSearchSuggestions": Defaults[.showSearchSuggestions],
|
|
"visibleSections": Defaults[.visibleSections].compactMap { $0.rawValue },
|
|
"showOpenActionsToolbarItem": Defaults[.showOpenActionsToolbarItem],
|
|
"accountPickerDisplaysAnonymousAccounts": Defaults[.accountPickerDisplaysAnonymousAccounts],
|
|
"showUnwatchedFeedBadges": Defaults[.showUnwatchedFeedBadges],
|
|
"expandChannelDescription": Defaults[.expandChannelDescription],
|
|
"keepChannelsWithUnwatchedFeedOnTop": Defaults[.keepChannelsWithUnwatchedFeedOnTop],
|
|
"showChannelAvatarInChannelsLists": Defaults[.showChannelAvatarInChannelsLists],
|
|
"showChannelAvatarInVideosListing": Defaults[.showChannelAvatarInVideosListing],
|
|
"playerButtonSingleTapGesture": Defaults[.playerButtonSingleTapGesture].rawValue,
|
|
"playerButtonDoubleTapGesture": Defaults[.playerButtonDoubleTapGesture].rawValue,
|
|
"playerButtonShowsControlButtonsWhenMinimized": Defaults[.playerButtonShowsControlButtonsWhenMinimized],
|
|
"playerButtonIsExpanded": Defaults[.playerButtonIsExpanded],
|
|
"playerBarMaxWidth": Defaults[.playerBarMaxWidth],
|
|
"channelOnThumbnail": Defaults[.channelOnThumbnail],
|
|
"timeOnThumbnail": Defaults[.timeOnThumbnail],
|
|
"roundedThumbnails": Defaults[.roundedThumbnails],
|
|
"thumbnailsQuality": Defaults[.thumbnailsQuality].rawValue
|
|
]
|
|
}
|
|
|
|
override var platformJSON: JSON {
|
|
var export = JSON()
|
|
|
|
#if os(iOS)
|
|
export["showDocuments"].bool = Defaults[.showDocuments]
|
|
export["lockPortraitWhenBrowsing"].bool = Defaults[.lockPortraitWhenBrowsing]
|
|
#endif
|
|
|
|
#if !os(tvOS)
|
|
export["accountPickerDisplaysUsername"].bool = Defaults[.accountPickerDisplaysUsername]
|
|
#endif
|
|
|
|
return export
|
|
}
|
|
|
|
private func widgetSettingsJSON(_ settings: WidgetSettings) -> JSON {
|
|
var json = JSON()
|
|
json.dictionaryObject = WidgetSettingsBridge().serialize(settings)
|
|
return json
|
|
}
|
|
}
|