mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Add action buttons label setting
This commit is contained in:
parent
5ae6f321cd
commit
93ea943c54
@ -148,14 +148,7 @@ extension Defaults.Keys {
|
|||||||
static let playerControlsPlaybackModeEnabled = Key<Bool>("playerControlsPlaybackModeEnabled", default: false)
|
static let playerControlsPlaybackModeEnabled = Key<Bool>("playerControlsPlaybackModeEnabled", default: false)
|
||||||
static let playerControlsMusicModeEnabled = Key<Bool>("playerControlsMusicModeEnabled", default: false)
|
static let playerControlsMusicModeEnabled = Key<Bool>("playerControlsMusicModeEnabled", default: false)
|
||||||
|
|
||||||
// TODO: IMPLEMENT THIS
|
static let playerActionsButtonLabelStyle = Key<ButtonLabelStyle>("playerActionsButtonLabelStyle", default: .iconAndText)
|
||||||
// ** rgdfo;fgks iojsiojf
|
|
||||||
#if os(macOS)
|
|
||||||
static let playerDetailsPageButtonLabelStyleDefault = ButtonLabelStyle.iconAndText
|
|
||||||
#else
|
|
||||||
static let playerDetailsPageButtonLabelStyleDefault = UIDevice.current.userInterfaceIdiom == .phone ? ButtonLabelStyle.iconOnly : .iconAndText
|
|
||||||
#endif
|
|
||||||
static let playerActionsButtonLabelStyle = Key<ButtonLabelStyle>("playerActionsButtonLabelStyle", default: playerDetailsPageButtonLabelStyleDefault)
|
|
||||||
|
|
||||||
static let actionButtonShareEnabled = Key<Bool>("actionButtonShareEnabled", default: true)
|
static let actionButtonShareEnabled = Key<Bool>("actionButtonShareEnabled", default: true)
|
||||||
static let actionButtonAddToPlaylistEnabled = Key<Bool>("actionButtonAddToPlaylistEnabled", default: true)
|
static let actionButtonAddToPlaylistEnabled = Key<Bool>("actionButtonAddToPlaylistEnabled", default: true)
|
||||||
@ -438,6 +431,15 @@ enum ButtonLabelStyle: String, CaseIterable, Defaults.Serializable {
|
|||||||
var text: Bool {
|
var text: Bool {
|
||||||
self == .iconAndText
|
self == .iconAndText
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var description: String {
|
||||||
|
switch self {
|
||||||
|
case .iconOnly:
|
||||||
|
"Icon only"
|
||||||
|
case .iconAndText:
|
||||||
|
"Icon and text"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ThumbnailsQuality: String, CaseIterable, Defaults.Serializable {
|
enum ThumbnailsQuality: String, CaseIterable, Defaults.Serializable {
|
||||||
|
@ -15,6 +15,7 @@ struct PlayerControlsSettings: View {
|
|||||||
@Default(.gestureBackwardSeekDuration) private var gestureBackwardSeekDuration
|
@Default(.gestureBackwardSeekDuration) private var gestureBackwardSeekDuration
|
||||||
@Default(.gestureForwardSeekDuration) private var gestureForwardSeekDuration
|
@Default(.gestureForwardSeekDuration) private var gestureForwardSeekDuration
|
||||||
@Default(.systemControlsSeekDuration) private var systemControlsSeekDuration
|
@Default(.systemControlsSeekDuration) private var systemControlsSeekDuration
|
||||||
|
@Default(.playerActionsButtonLabelStyle) private var playerActionsButtonLabelStyle
|
||||||
@Default(.actionButtonShareEnabled) private var actionButtonShareEnabled
|
@Default(.actionButtonShareEnabled) private var actionButtonShareEnabled
|
||||||
@Default(.actionButtonSubscribeEnabled) private var actionButtonSubscribeEnabled
|
@Default(.actionButtonSubscribeEnabled) private var actionButtonSubscribeEnabled
|
||||||
@Default(.actionButtonCloseEnabled) private var actionButtonCloseEnabled
|
@Default(.actionButtonCloseEnabled) private var actionButtonCloseEnabled
|
||||||
@ -117,6 +118,15 @@ struct PlayerControlsSettings: View {
|
|||||||
Section(header: SettingsHeader(text: "Actions Buttons".localized())) {
|
Section(header: SettingsHeader(text: "Actions Buttons".localized())) {
|
||||||
actionButtonToggles
|
actionButtonToggles
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Picker("Action button labels", selection: $playerActionsButtonLabelStyle) {
|
||||||
|
ForEach(ButtonLabelStyle.allCases, id: \.rawValue) { style in
|
||||||
|
Text(style.description).tag(style)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.modifier(SettingsPickerModifier())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var systemControlsCommandsPicker: some View {
|
private var systemControlsCommandsPicker: some View {
|
||||||
|
@ -307,7 +307,7 @@ struct SettingsView: View {
|
|||||||
case .browsing:
|
case .browsing:
|
||||||
return 800
|
return 800
|
||||||
case .player:
|
case .player:
|
||||||
return 500
|
return 550
|
||||||
case .controls:
|
case .controls:
|
||||||
return 920
|
return 920
|
||||||
case .quality:
|
case .quality:
|
||||||
|
Loading…
Reference in New Issue
Block a user