mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +00:00
add option to expand vertical chapters by default
This commit is contained in:
parent
d65224320e
commit
600b8d198b
@ -265,6 +265,7 @@ extension Defaults.Keys {
|
|||||||
static let hideWatched = Key<Bool>("hideWatched", default: false)
|
static let hideWatched = Key<Bool>("hideWatched", default: false)
|
||||||
static let showInspector = Key<ShowInspectorSetting>("showInspector", default: .onlyLocal)
|
static let showInspector = Key<ShowInspectorSetting>("showInspector", default: .onlyLocal)
|
||||||
static let showChapters = Key<Bool>("showChapters", default: true)
|
static let showChapters = Key<Bool>("showChapters", default: true)
|
||||||
|
static let expandChapters = Key<Bool>("expandChapters", default: true)
|
||||||
static let showRelated = Key<Bool>("showRelated", default: true)
|
static let showRelated = Key<Bool>("showRelated", default: true)
|
||||||
static let widgetsSettings = Key<[WidgetSettings]>("widgetsSettings", default: [])
|
static let widgetsSettings = Key<[WidgetSettings]>("widgetsSettings", default: [])
|
||||||
}
|
}
|
||||||
|
@ -191,6 +191,7 @@ struct VideoDetails: View {
|
|||||||
@Default(.showScrollToTopInComments) private var showScrollToTopInComments
|
@Default(.showScrollToTopInComments) private var showScrollToTopInComments
|
||||||
#endif
|
#endif
|
||||||
@Default(.expandVideoDescription) private var expandVideoDescription
|
@Default(.expandVideoDescription) private var expandVideoDescription
|
||||||
|
@Default(.expandChapters) private var expandChapters
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
@ -246,6 +247,7 @@ struct VideoDetails: View {
|
|||||||
.background(colorScheme == .dark ? Color.black : .white)
|
.background(colorScheme == .dark ? Color.black : .white)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
descriptionExpanded = expandVideoDescription
|
descriptionExpanded = expandVideoDescription
|
||||||
|
chaptersExpanded = expandChapters
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ struct PlayerSettings: View {
|
|||||||
|
|
||||||
@Default(.showInspector) private var showInspector
|
@Default(.showInspector) private var showInspector
|
||||||
@Default(.showChapters) private var showChapters
|
@Default(.showChapters) private var showChapters
|
||||||
|
@Default(.expandChapters) private var expandChapters
|
||||||
@Default(.showRelated) private var showRelated
|
@Default(.showRelated) private var showRelated
|
||||||
|
|
||||||
@ObservedObject private var accounts = AccountsModel.shared
|
@ObservedObject private var accounts = AccountsModel.shared
|
||||||
@ -80,6 +81,7 @@ struct PlayerSettings: View {
|
|||||||
expandVideoDescriptionToggle
|
expandVideoDescriptionToggle
|
||||||
collapsedLineDescriptionStepper
|
collapsedLineDescriptionStepper
|
||||||
showChaptersToggle
|
showChaptersToggle
|
||||||
|
expandChaptersToggle
|
||||||
showRelatedToggle
|
showRelatedToggle
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
HStack {
|
HStack {
|
||||||
@ -285,6 +287,12 @@ struct PlayerSettings: View {
|
|||||||
Toggle("Chapters (if available)", isOn: $showChapters)
|
Toggle("Chapters (if available)", isOn: $showChapters)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var expandChaptersToggle: some View {
|
||||||
|
Toggle("Open vertical chapters expanded", isOn: $expandChapters)
|
||||||
|
.disabled(!showChapters)
|
||||||
|
.foregroundColor(showChapters ? .primary : .secondary)
|
||||||
|
}
|
||||||
|
|
||||||
private var showRelatedToggle: some View {
|
private var showRelatedToggle: some View {
|
||||||
Toggle("Related", isOn: $showRelated)
|
Toggle("Related", isOn: $showRelated)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user