-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
457 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
Swiftfin/Views/SettingsView/CustomizeViewsSettings/Components/Sections/FilterSection.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// Swiftfin is subject to the terms of the Mozilla Public | ||
// License, v2.0. If a copy of the MPL was not distributed with this | ||
// file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors | ||
// | ||
|
||
import Defaults | ||
import SwiftUI | ||
|
||
extension CustomizeViewsSettings { | ||
|
||
struct FilterSection: View { | ||
|
||
@Default(.Customization.Library.letterPickerEnabled) | ||
private var letterPickerEnabled | ||
@Default(.Customization.Library.letterPickerOrientation) | ||
private var letterPickerOrientation | ||
@Default(.Customization.Library.enabledDrawerFilters) | ||
private var libraryEnabledDrawerFilters | ||
@Default(.Customization.Search.enabledDrawerFilters) | ||
private var searchEnabledDrawerFilters | ||
|
||
@EnvironmentObject | ||
private var router: SettingsCoordinator.Router | ||
|
||
var body: some View { | ||
|
||
Section(L10n.filters) { | ||
|
||
// MARK: Letter Picker Toggle | ||
|
||
Toggle( | ||
L10n.letterPicker.localizedCapitalized, | ||
isOn: $letterPickerEnabled | ||
) | ||
|
||
if letterPickerEnabled { | ||
|
||
// MARK: Letter Picker Orientation | ||
|
||
CaseIterablePicker( | ||
L10n.orientation.localizedCapitalized, | ||
selection: $letterPickerOrientation | ||
) | ||
} | ||
|
||
// MARK: Library Filters | ||
|
||
ChevronButton(L10n.library) | ||
.onSelect { | ||
router.route(to: \.itemFilterDrawerSelector, $libraryEnabledDrawerFilters) | ||
} | ||
|
||
// MARK: Search Filters | ||
|
||
ChevronButton(L10n.search) | ||
.onSelect { | ||
router.route(to: \.itemFilterDrawerSelector, $searchEnabledDrawerFilters) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.