Add shouldShowChaptersInfoInBottomOverlay to Settings.Overlay
This commit is contained in:
parent
add9615aa8
commit
f1bf247f5a
|
@ -354,6 +354,8 @@ internal enum L10n {
|
|||
internal static var settings: String { return L10n.tr("Localizable", "settings") }
|
||||
/// Show Cast & Crew
|
||||
internal static var showCastAndCrew: String { return L10n.tr("Localizable", "showCastAndCrew") }
|
||||
/// Show Chapters Info In Bottom Overlay
|
||||
internal static var showChaptersInfoInBottomOverlay: String { return L10n.tr("Localizable", "showChaptersInfoInBottomOverlay") }
|
||||
/// Flatten Library Items
|
||||
internal static var showFlattenView: String { return L10n.tr("Localizable", "showFlattenView") }
|
||||
/// Show Missing Episodes
|
||||
|
|
|
@ -73,6 +73,10 @@ extension Defaults.Keys {
|
|||
default: true,
|
||||
suite: SwiftfinStore.Defaults.generalSuite)
|
||||
|
||||
static let shouldShowChaptersInfoInBottomOverlay = Key<Bool>("shouldShowChaptersInfoInBottomOverlay",
|
||||
default: true,
|
||||
suite: SwiftfinStore.Defaults.generalSuite)
|
||||
|
||||
// Experimental settings
|
||||
enum Experimental {
|
||||
static let syncSubtitleStateWithAdjacent = Key<Bool>("experimental.syncSubtitleState",
|
||||
|
|
|
@ -131,6 +131,7 @@ final class VideoPlayerViewModel: ViewModel {
|
|||
let systemControlGesturesEnabled: Bool
|
||||
let seekSlideGestureEnabled: Bool
|
||||
let playerGesturesLockGestureEnabled: Bool
|
||||
let shouldShowChaptersInfoInBottomOverlay: Bool
|
||||
let resumeOffset: Bool
|
||||
let streamType: ServerStreamType
|
||||
let container: String
|
||||
|
@ -263,6 +264,7 @@ final class VideoPlayerViewModel: ViewModel {
|
|||
self.playerGesturesLockGestureEnabled = Defaults[.playerGesturesLockGestureEnabled]
|
||||
self.seekSlideGestureEnabled = Defaults[.seekSlideGestureEnabled]
|
||||
self.shouldShowJumpButtonsInOverlayMenu = Defaults[.shouldShowJumpButtonsInOverlayMenu]
|
||||
self.shouldShowChaptersInfoInBottomOverlay = Defaults[.shouldShowChaptersInfoInBottomOverlay]
|
||||
|
||||
self.resumeOffset = Defaults[.resumeOffset]
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ struct OverlaySettingsView: View {
|
|||
var shouldShowAutoPlay
|
||||
@Default(.shouldShowJumpButtonsInOverlayMenu)
|
||||
var shouldShowJumpButtonsInOverlayMenu
|
||||
@Default(.shouldShowChaptersInfoInBottomOverlay)
|
||||
var shouldShowChaptersInfoInBottomOverlay
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
|
@ -52,6 +54,13 @@ struct OverlaySettingsView: View {
|
|||
}
|
||||
}
|
||||
|
||||
Toggle(isOn: $shouldShowChaptersInfoInBottomOverlay) {
|
||||
HStack {
|
||||
Image(systemName: "photo.on.rectangle")
|
||||
L10n.showChaptersInfoInBottomOverlay.text
|
||||
}
|
||||
}
|
||||
|
||||
Toggle(L10n.editJumpLengths, isOn: $shouldShowJumpButtonsInOverlayMenu)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -340,7 +340,7 @@ struct VLCPlayerOverlayView: View {
|
|||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
if viewModel.overlayType == .normal,
|
||||
if viewModel.shouldShowChaptersInfoInBottomOverlay,
|
||||
let currentChapter = viewModel.currentChapter
|
||||
{
|
||||
Button {
|
||||
|
@ -352,7 +352,6 @@ struct VLCPlayerOverlayView: View {
|
|||
}
|
||||
.font(.system(size: 16, weight: .semibold, design: .default))
|
||||
}
|
||||
.padding(.leading, 16)
|
||||
}
|
||||
|
||||
HStack {
|
||||
|
@ -399,7 +398,7 @@ struct VLCPlayerOverlayView: View {
|
|||
Capsule().foregroundColor(.purple))
|
||||
.background(Capsule().foregroundColor(Color.gray.opacity(0.75)))
|
||||
|
||||
if viewModel.overlayType == .normal {
|
||||
if viewModel.shouldShowChaptersInfoInBottomOverlay {
|
||||
// Chapters seek masks
|
||||
ForEach(viewModel.chapters, id: \.startPositionTicks) { chapter in
|
||||
let ticksRatio = CGFloat(chapter.startPositionTicks ?? 0) /
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue