mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Player bar visibility modes and settings
This commit is contained in:
@@ -21,6 +21,9 @@ struct BrowsingSettings: View {
|
||||
@Default(.showOpenActionsToolbarItem) private var showOpenActionsToolbarItem
|
||||
@Default(.homeHistoryItems) private var homeHistoryItems
|
||||
@Default(.visibleSections) private var visibleSections
|
||||
@Default(.playerButtonSingleTapGesture) private var playerButtonSingleTapGesture
|
||||
@Default(.playerButtonDoubleTapGesture) private var playerButtonDoubleTapGesture
|
||||
@Default(.playerButtonShowsControlButtonsWhenMinimized) private var playerButtonShowsControlButtonsWhenMinimized
|
||||
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
|
||||
@@ -65,6 +68,7 @@ struct BrowsingSettings: View {
|
||||
interface
|
||||
}
|
||||
#else
|
||||
playerBarSettings
|
||||
interface
|
||||
#endif
|
||||
if !accounts.isEmpty {
|
||||
@@ -150,6 +154,32 @@ struct BrowsingSettings: View {
|
||||
}
|
||||
}
|
||||
|
||||
#if !os(tvOS)
|
||||
private var playerBarSettings: some View {
|
||||
Section(header: SettingsHeader(text: "Player Bar".localized()), footer: playerBarFooter) {
|
||||
Toggle("Always show controls buttons", isOn: $playerButtonShowsControlButtonsWhenMinimized)
|
||||
playerBarGesturePicker("Single tap gesture", selection: $playerButtonSingleTapGesture)
|
||||
playerBarGesturePicker("Double tap gesture", selection: $playerButtonDoubleTapGesture)
|
||||
}
|
||||
}
|
||||
|
||||
func playerBarGesturePicker(_ label: String, selection: Binding<PlayerTapGestureAction>) -> some View {
|
||||
Picker(label, selection: selection) {
|
||||
ForEach(PlayerTapGestureAction.allCases, id: \.rawValue) { action in
|
||||
Text(action.label).tag(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var playerBarFooter: some View {
|
||||
#if os(iOS)
|
||||
Text("Tap and hold channel thumbnail to open context menu with more actions")
|
||||
#elseif os(macOS)
|
||||
Text("Right click channel thumbnail to open context menu with more actions")
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
private var interfaceSettings: some View {
|
||||
Section(header: SettingsHeader(text: "Interface".localized())) {
|
||||
#if !os(tvOS)
|
||||
|
@@ -10,7 +10,7 @@ struct SettingsView: View {
|
||||
case browsing, player, quality, history, sponsorBlock, locations, advanced, help
|
||||
}
|
||||
|
||||
@State private var selection: Tabs?
|
||||
@State private var selection: Tabs = .browsing
|
||||
#endif
|
||||
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@@ -224,10 +224,8 @@ struct SettingsView: View {
|
||||
#if os(macOS)
|
||||
private var windowHeight: Double {
|
||||
switch selection {
|
||||
case nil:
|
||||
return accounts.isEmpty ? 680 : 580
|
||||
case .browsing:
|
||||
return 580
|
||||
return 680
|
||||
case .player:
|
||||
return 900
|
||||
case .quality:
|
||||
|
Reference in New Issue
Block a user